From 92eb3a3b4067f2bc279263c595706050c5dee912 Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 10:50:33 +0100 Subject: [PATCH 1/6] doc: additional prerequisites for wasm build --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 975132e0759..0c5fc862a1f 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,14 @@ this repository may be used on the following networks: - Install prerequisites: - [node.js](https://nodejs.org/) v16 - [docker](https://docs.docker.com/get-docker/) v20.10+ + - [rust](https://www.rust-lang.org/tools/install) v1.67+ + - WASM toolchain: + - `clang` + - `llvm` (Usually pre-installed with clang) + - IMPORTANT: built-in llvm on OSX does not work, needs to be installed from brew `brew install llvm` + - `cargo install wasm-bindgen-cli` + - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, libssl-dev)_ + - `rustup target add wasm32-unknown-unknown` - Run `corepack enable` to enable [corepack](https://nodejs.org/dist/latest/docs/api/corepack.html) and install yarn - Run `yarn setup` to install dependencies and configure and build all packages - Run `yarn start` to start the local dev environment built from the sources From 34a28bafe00fa48beb4faa71f04168c2b69f72fc Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 11:00:49 +0100 Subject: [PATCH 2/6] doc: add instruction for clang --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c5fc862a1f..62d8bf90e5c 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,11 @@ this repository may be used on the following networks: - [node.js](https://nodejs.org/) v16 - [docker](https://docs.docker.com/get-docker/) v20.10+ - [rust](https://www.rust-lang.org/tools/install) v1.67+ - - WASM toolchain: + - [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/): - `clang` + - _IMPORTANT: built-in `clang` on OSX does not work, needs to be installed from brew `brew install clang`_ - `llvm` (Usually pre-installed with clang) - - IMPORTANT: built-in llvm on OSX does not work, needs to be installed from brew `brew install llvm` + - _IMPORTANT: built-in `llvm` on OSX does not work, needs to be installed from brew `brew install llvm`_ - `cargo install wasm-bindgen-cli` - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, libssl-dev)_ - `rustup target add wasm32-unknown-unknown` From ace37e5db1b2020b7e3c8c8b0c5f493d1f96e322 Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 11:42:14 +0100 Subject: [PATCH 3/6] doc: remove clang instructions --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 62d8bf90e5c..15a766a7a4f 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,10 @@ this repository may be used on the following networks: - [node.js](https://nodejs.org/) v16 - [docker](https://docs.docker.com/get-docker/) v20.10+ - [rust](https://www.rust-lang.org/tools/install) v1.67+ - - [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/): - - `clang` - - _IMPORTANT: built-in `clang` on OSX does not work, needs to be installed from brew `brew install clang`_ - - `llvm` (Usually pre-installed with clang) - - _IMPORTANT: built-in `llvm` on OSX does not work, needs to be installed from brew `brew install llvm`_ + - [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/): + - **IMPORTANT (OSX only)**: built-in `llvm` on OSX does not work, needs to be installed from brew `brew install llvm` - `cargo install wasm-bindgen-cli` - - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, libssl-dev)_ + - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)_ - `rustup target add wasm32-unknown-unknown` - Run `corepack enable` to enable [corepack](https://nodejs.org/dist/latest/docs/api/corepack.html) and install yarn - Run `yarn setup` to install dependencies and configure and build all packages From 4a49334dd21c9d189271b29801a637e9c0513a67 Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 14:34:32 +0100 Subject: [PATCH 4/6] doc: add instruction to add path in profile file --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 15a766a7a4f..fdc014502c4 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,9 @@ this repository may be used on the following networks: - [docker](https://docs.docker.com/get-docker/) v20.10+ - [rust](https://www.rust-lang.org/tools/install) v1.67+ - [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/): - - **IMPORTANT (OSX only)**: built-in `llvm` on OSX does not work, needs to be installed from brew `brew install llvm` + - **IMPORTANT (OSX only)**: built-in `llvm` on OSX does not work, needs to be installed from brew: + - `brew install llvm` + - LLVM from brew keg only, and path to it must be provided in the profile file, e.g.`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` - `cargo install wasm-bindgen-cli` - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)_ - `rustup target add wasm32-unknown-unknown` From 25b788306ea55e2c49e9c66779b3a45b662a980b Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 14:37:25 +0100 Subject: [PATCH 5/6] doc: missing is --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fdc014502c4..980b514e6a9 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ this repository may be used on the following networks: - [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/): - **IMPORTANT (OSX only)**: built-in `llvm` on OSX does not work, needs to be installed from brew: - `brew install llvm` - - LLVM from brew keg only, and path to it must be provided in the profile file, e.g.`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` + - LLVM installed from brew is keg only, and path to it must be provided in the profile file, e.g.`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` - `cargo install wasm-bindgen-cli` - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)_ - `rustup target add wasm32-unknown-unknown` From f0840e3c44333aef1a8890e1566966ca7b11535f Mon Sep 17 00:00:00 2001 From: "markin.io" Date: Wed, 19 Apr 2023 19:57:28 +0100 Subject: [PATCH 6/6] doc: add instructions in wasm-dpp README --- packages/wasm-dpp/README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/wasm-dpp/README.md b/packages/wasm-dpp/README.md index 43e9919a27a..7f42341283c 100644 --- a/packages/wasm-dpp/README.md +++ b/packages/wasm-dpp/README.md @@ -15,27 +15,32 @@ In order for this binding to work, you have to have a rs-platform cloned alongside platform repo, so you can have access to the rust dpp. ## IMPORTANT! -### Build on a Mac - -To build on a mac, you need to perform two steps. First, install `clang` -from the homebrew. XCode's `clang` doesn't ship with the WASM support. Second, -just adding llvm to the `.zshrc` doesn't seem to work - run -`AR=/usr/local/opt/llvm/bin/llvm-ar CC=/usr/local/opt/llvm/bin/clang yarn workspace @dashevo/wasm-dpp build:node` -instead. -Alternatively, you can add the following to the `yarn workspace @dashevo/wasm-dpp build:node:mac` instead. +### Build on a Mac +Built-in `llvm` on OSX does not work, it needs to be installed from brew: +- `brew install llvm` +- LLVM installed from brew is keg only, and path to it must be provided in the profile file, e.g.`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` ### Class names minification Library consumers must ignore class names minification for `@dashevo/wasm-dpp` library in their bundlers. ## Table of Contents - -- [Install](#install) +- [Prerequisites](#Prerequisites) +- [Build](#build) - [Usage](#usage) - [Contributing](#contributing) - [License](#license) -## Install + + +## Prerequisites +- Install [Rust](https://www.rust-lang.org/tools/install) v1.67+ +- Add wasm32 target: `$ rustup target add wasm32-unknown-unknown` +- Install wasm-bingen-cli: `cargo install wasm-bindgen-cli` + - _Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)_ + +## Build +`$ yarn build` ## TODO