diff --git a/src/pages/_meta.json b/src/pages/_meta.json index 803d7ac..d42bc6a 100644 --- a/src/pages/_meta.json +++ b/src/pages/_meta.json @@ -53,6 +53,7 @@ "app-manifest": "Application Manifest", "function-names": "Function names", "golem-host-functions": "Golem Host Functions", + "installing-webassembly-tooling": "Installing WebAssembly Tooling", "json-wave-mapping": "JSON-WAVE Mapping", "rest-api": "REST API", "rib": "Rib", diff --git a/src/pages/ccpp-language-guide/setup.mdx b/src/pages/ccpp-language-guide/setup.mdx index 1920a2a..b6d03ed 100644 --- a/src/pages/ccpp-language-guide/setup.mdx +++ b/src/pages/ccpp-language-guide/setup.mdx @@ -7,62 +7,8 @@ To write **Golem components** in C or C++, a couple of common WebAssembly tools ## Install WebAssembly tooling -First of all, to install `wasm-tools` via `cargo`, you need to install the latest stable version of Rust. The recommended way to do so is using [https://rustup.rs](https://rustup.rs/): - - - -### Install Rust - -Install rustup - -```shell copy -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -``` - -Install the latest stable version of Rust - -```shell copy -rustup install stable && rustup default stable -``` - -Add the WASI target - -```shell copy -rustup target add wasm32-wasip1 -``` - -### Install `wasm-tools` - -```shell copy -cargo install --force --locked wasm-tools@1.223.0 -``` - -Confirm the installation: - -```shell -wasm-tools --version -wasm-tools 1.223.0 -``` - -### Install `wit-bindgen` - -```shell copy -cargo install --force --locked wit-bindgen-cli@0.37.0 -``` - -Confirm the installation: - -```shell -wit-bindgen --version -wit-bindgen-cli 0.37.0 -``` - - - - - Golem requires a **specific version** of `wasm-tools` and `wit-bindgen`. Please make sure the - correct version is installed with the commands described above. - +You will need both `wasm-tools` and `wit-bindgen` to work on C/C++ WebAssembly projects. +Consult the [dedicated page](/installing-webassembly-tooling) for instructions on how to install them. ## Install WASI SDK 25.0 diff --git a/src/pages/go-language-guide/setup.mdx b/src/pages/go-language-guide/setup.mdx index 2dc7637..8fd19cf 100644 --- a/src/pages/go-language-guide/setup.mdx +++ b/src/pages/go-language-guide/setup.mdx @@ -1,5 +1,6 @@ import { Callout } from "nextra/components" import { Steps } from "nextra/components" +import { MultiPlatformCommand } from "@/components/multi-platform-command" # Setup Go @@ -26,59 +27,5 @@ brew install tinygo ## Install WebAssembly tooling -First of all, to install `wasm-tools` via `cargo`, you need to install the latest stable version of Rust. The recommended way to do so is using [https://rustup.rs](https://rustup.rs/): - - - -### Install Rust - -Install rustup - -```bash copy -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -``` - -Install the latest stable version of Rust - -```bash copy -rustup install stable && rustup default stable -``` - -Add the WASI target - -```bash copy -rustup target add wasm32-wasip1 -``` - -### Install `wasm-tools` - -```bash copy -cargo install --force --locked wasm-tools@1.223.0 -``` - -Confirm the installation: - -```bash -wasm-tools --version -wasm-tools 1.223.0 -``` - -### Install `wit-bindgen` - -```bash copy -cargo install --force --locked wit-bindgen-cli@0.37.0 -``` - -Confirm the installation: - -```bash -wit-bindgen --version -wit-bindgen-cli 0.37.0 -``` - - - - - Golem requires a **specific version** of `wasm-tools` and `wit-bindgen`. Please make sure the - correct version is installed with the commands described above. - +You will need both `wasm-tools` and `wit-bindgen` to work on Go WebAssembly projects. +Consult the [dedicated page](/installing-webassembly-tooling) for instructions on how to install them. diff --git a/src/pages/installing-webassembly-tooling.mdx b/src/pages/installing-webassembly-tooling.mdx new file mode 100644 index 0000000..8309d92 --- /dev/null +++ b/src/pages/installing-webassembly-tooling.mdx @@ -0,0 +1,122 @@ +import { Callout } from "nextra/components" +import { Steps } from "nextra/components" +import { MultiPlatformCommand } from "@/components/multi-platform-command" +import { Tabs } from "nextra/components" + +# Installing WebAssembly tooling + + + Golem only supports **specific versions** of `wasm-tools` and `wit-bindgen`. Please make sure to + follow the guides carefully and install the correct versions. + + +You will need both `wasm-tools` and `wit-bindgen` to work with WebAssembly in a lot of languages. +You can either download these from GitHub or build from source using cargo. + + + + {/* Download (Linux) */} + + ### wit-bindgen + Download the correct asset for your system from the [GitHub Release](https://github.com/bytecodealliance/wit-bindgen/releases/tag/v0.37.0). + + Extract the downloaded archive: + ```bash copy + ❯ tar xvf wit-bindgen-0.37.0-x86_64-linux.tar.gz + x wit-bindgen-0.37.0-x86_64-linux/ + x wit-bindgen-0.37.0-x86_64-linux/README.md + x wit-bindgen-0.37.0-x86_64-linux/LICENSE-APACHE + x wit-bindgen-0.37.0-x86_64-linux/wit-bindgen + x wit-bindgen-0.37.0-x86_64-linux/LICENSE-MIT + x wit-bindgen-0.37.0-x86_64-linux/LICENSE-Apache-2.0_WITH_LLVM-exception + ``` + + Install to /usr/local/bin: + ```bash copy + ❯ sudo install -D -t /usr/local/bin wit-bindgen-0.37.0-x86_64-linux/wit-bindgen + ``` + + ### wasm-tools + Download the correct asset for your system from the [GitHub Release](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.223.0). + + Extract the downloaded archive: + ```bash copy + ❯ tar xvf wasm-tools-1.223.0-x86_64-linux.tar.gz + x wasm-tools-1.223.0-x86_64-linux/ + x wasm-tools-1.223.0-x86_64-linux/README.md + x wasm-tools-1.223.0-x86_64-linux/wasm-tools + x wasm-tools-1.223.0-x86_64-linux/LICENSE-APACHE + x wasm-tools-1.223.0-x86_64-linux/LICENSE-MIT + x wasm-tools-1.223.0-x86_64-linux/LICENSE-Apache-2.0_WITH_LLVM-exception + ``` + + Install to /usr/local/bin: + ```bash copy + ❯ sudo install -D -t wasm-tools-1.223.0-x86_64-linux/wasm-tools + ``` + + + + {/* Download (Windows) */} + Download the [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen/releases/tag/v0.37.0) and + [wasm-tools](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.223) Windows archives. + + Extract the archives and place the `wit-bindgen` and `wasm-tools` binaries into a folder. + + Add the folder to the PATH environment variable. + + + {/* Build from source */} + First of all, to install `wasm-tools` via `cargo`, you need to install the latest stable version of Rust. The recommended way to do so is using [https://rustup.rs](https://rustup.rs/): + + + + ### Install Rust + + Install rustup + + ```bash copy + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + + Install the latest stable version of Rust + + ```bash copy + rustup install stable && rustup default stable + ``` + + Add the WASI target + + ```bash copy + rustup target add wasm32-wasip1 + ``` + + ### Install `wasm-tools` + + ```bash copy + cargo install --force --locked wasm-tools@1.223.0 + ``` + + Confirm the installation: + + ```bash + wasm-tools --version + wasm-tools 1.223.0 + ``` + + ### Install `wit-bindgen` + + ```bash copy + cargo install --force --locked wit-bindgen-cli@0.37.0 + ``` + + Confirm the installation: + + ```bash + wit-bindgen --version + wit-bindgen-cli 0.37.0 + ``` + + + +