Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add note about installing ubuntu packages for WSL2 #457

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Words that are neither common nor directly related to Holochain but appear in
# Dev Portal content
adwaita
agent-centricity
Anwaar
Automerge
Expand All @@ -20,6 +21,11 @@ identicon
identicons
IPFS
Kleppmann
libasound
libatk
libcups
libgtk
libnss
NixOS
nixpkgs
pkgs
Expand All @@ -34,4 +40,6 @@ Tauri
Ulhaq
Wahlstrom
WebRTC
webview
webviews
workdir
1 change: 1 addition & 0 deletions .cspell/holochain-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DeepKey
dnas
DPKI
hApp
hApps
Holo
Holo's
Holochain
Expand Down
8 changes: 8 additions & 0 deletions src/pages/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ For Windows users, please note that the Nix package manager, which is used to in

Holochain is supported in WSL2 via the Ubuntu distribution.

You'll also need to install a few packages if you want to run two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in Tauri or Electron webviews:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are only needed for hc-launch. I never had problems with Tauri needing libraries.

adwaita-icon-theme solves a Tauri specific problem that Electron doesn't seem to have.

I get grouping them together to get people set up quickly. I wonder if it's worth keeping a note somewhere for ourselves about why we're recommending which libraries? I don't know if we can comment in the markdown here without it showing up in the generated page?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, and I can clarify in the advanced install guide.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, yeah that's exactly the kind of information I'd be after - thank you!


```shell
sudo apt install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-dev libasound2 adwaita-icon-theme
```

Read more about these fixes in the [Dev Tools Setup guide](/get-started/install-advanced/#opening-your-happs-gui-in-ubuntu-on-wsl2).

### 2.3. Set up development environment

Once you've ensured that your system meets the hardware requirements and set up WSL2 on Windows or a dual-boot Linux OS (if applicable), you can proceed with the installation of the Nix package manager and the binary package cache for Holochain.
Expand Down
16 changes: 16 additions & 0 deletions src/pages/get-started/install-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,19 @@ There are other fixes [outlined in the Ubuntu 24.04 release notes](https://disco
### Redistributable applications created with [`holochain-kangaroo-electron`](https://github.com/holochain-apps/holochain-kangaroo-electron) are also affected

Because the template repo `holochain-kangaroo-electron` also bundles Electron's chrome-sandbox in the binary that you'd distribute, your users will see the same error message when they try to run your application if you've used this repo. We're still researching the best solution, but since Ubuntu is recommending it, we recommend applying the first solution in the release notes, which involves creating an AppArmor profile for your app. This profile could then be distributed and installed alongside it. (Note: this won't work with portable application packages that aren't installed as root, such as `AppImage`s.)

## Opening your hApp's GUI in Ubuntu on WSL2 (Windows Subsystem for Linux) {#opening-your-happs-gui-in-ubuntu-on-wsl2}

There are two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in [Tauri](https://tauri.app/) or [Electron](https://www.electronjs.org/) webview containers, respectively. Because the Ubuntu OS installed from the Microsoft Store doesn't come with GUI packages by default, you'll need to install just a few in order to get these tools to work.

If you're only using `hc launch`, which uses the Tauri webview, install this package, which resolves a GDK error about cursors:

```shell
sudo apt install -y adwaita-icon-theme
```

If you're only using the more modern `hd spin`, which uses the Electron webview, install these missing packages that are needed by the `chrome-sandbox` binary:
pdaoust marked this conversation as resolved.
Show resolved Hide resolved

```shell
sudo apt install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-dev libasound2
```