-
Notifications
You must be signed in to change notification settings - Fork 44
build: use cargo binstall to speed up builds #2321
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
Changes from 20 commits
24177fa
dacc6db
306b86c
99fe5fa
cee3098
0d3e091
e421514
3d941ec
4bc0a65
dc48827
cafda11
b86f4e0
ae97f47
48cca1a
5c80069
fc0082d
d4c2f7d
88d3596
681bf72
1ac8d3b
fa4cf99
6584fae
8c880aa
113e695
6e02f6a
e395f2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,16 +44,30 @@ ENV PATH=$CARGO_HOME/bin:$PATH | |
| COPY rust-toolchain.toml . | ||
| RUN TOOLCHAIN_VERSION="$(grep channel rust-toolchain.toml | awk '{print $3}' | tr -d '"')" && \ | ||
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ | ||
| --profile minimal \ | ||
| -y \ | ||
| --default-toolchain "${TOOLCHAIN_VERSION}" \ | ||
| --target wasm32-unknown-unknown | ||
|
|
||
| # Install wasm-bindgen-cli in the same profile as other components, to sacrifice some performance & disk space to gain | ||
| # better build caching | ||
| RUN if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \ | ||
| RUSTFLAGS="-C target-feature=-crt-static" \ | ||
| # Meanwhile if you want to update wasm-bindgen you also need to update version in: | ||
| # - packages/wasm-dpp/Cargo.toml | ||
| # - packages/wasm-dpp/scripts/build-wasm.sh | ||
| cargo install [email protected] --locked | ||
| # Download and install cargo-binstall | ||
| ENV BINSTALL_VERSION=1.10.11 | ||
| RUN set -ex; \ | ||
| if [ "$TARGETARCH" = "amd64" ]; then \ | ||
| CARGO_BINSTALL_ARCH="x86_64-unknown-linux-musl"; \ | ||
| elif [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \ | ||
| CARGO_BINSTALL_ARCH="aarch64-unknown-linux-musl"; \ | ||
| else \ | ||
| echo "Unsupported architecture: $TARGETARCH"; exit 1; \ | ||
| fi; \ | ||
| DOWNLOAD_URL="https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-${CARGO_BINSTALL_ARCH}.tgz"; \ | ||
| curl -L --fail --show-error "$DOWNLOAD_URL" -o /tmp/cargo-binstall.tgz; \ | ||
| tar -xzf /tmp/cargo-binstall.tgz -C /tmp cargo-binstall; \ | ||
| chmod +x /tmp/cargo-binstall; \ | ||
| /tmp/cargo-binstall -y --force cargo-binstall; \ | ||
| rm /tmp/cargo-binstall; \ | ||
| cargo binstall -V | ||
|
|
||
| RUN cargo binstall [email protected] --locked \ | ||
| --no-discover-github-token \ | ||
| --disable-telemetry \ | ||
| --no-track \ | ||
| --no-confirm | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,9 +85,9 @@ runs: | |
| export PATH="${PATH}:${HOME}/.local/bin" | ||
|
|
||
| - name: Run sccache-cache | ||
| uses: mozilla-actions/[email protected].3 | ||
| uses: mozilla-actions/[email protected].6 | ||
| with: | ||
| version: "v0.7.1" # Must be the same as in Dockerfile | ||
| version: "v0.8.2" # Must be the same as in Dockerfile | ||
| if: inputs.cache == 'true' | ||
|
|
||
| - name: Hash ref_name | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,14 @@ jobs: | |||||||||||||
| - name: Setup Node.JS | ||||||||||||||
| uses: ./.github/actions/nodejs | ||||||||||||||
|
|
||||||||||||||
| - name: Install Cargo binstall | ||||||||||||||
| uses: cargo-bins/cargo-binstall@main | ||||||||||||||
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin cargo-binstall action to specific version for security. Using the - uses: cargo-bins/cargo-binstall@main
+ uses: cargo-bins/[email protected]📝 Committable suggestion
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| - name: Install wasm-bindgen-cli | ||||||||||||||
| run: cargo binstall [email protected] | ||||||||||||||
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||||||||||||||
|
|
||||||||||||||
| - name: Build packages | ||||||||||||||
| run: yarn build | ||||||||||||||
| env: | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -46,6 +46,14 @@ jobs: | |||||||||||||||
| with: | ||||||||||||||||
| target: wasm32-unknown-unknown | ||||||||||||||||
|
|
||||||||||||||||
| - name: Install Cargo binstall | ||||||||||||||||
| uses: cargo-bins/cargo-binstall@main | ||||||||||||||||
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||||||||||||||||
|
|
||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using @main tag for GitHub Actions. Using - - name: Install Cargo binstall
- uses: cargo-bins/cargo-binstall@main
+ - name: Install Cargo binstall
+ uses: cargo-bins/[email protected]📝 Committable suggestion
Suggested change
|
||||||||||||||||
| - name: Install wasm-bindgen-cli | ||||||||||||||||
| run: cargo binstall [email protected] | ||||||||||||||||
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||||||||||||||||
|
|
||||||||||||||||
| - name: Build JS packages | ||||||||||||||||
| run: yarn build | ||||||||||||||||
| if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # syntax = docker/dockerfile:1.5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # syntax = docker/dockerfile:1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lklimek marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Docker image for rs-drive-abci | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -30,13 +30,12 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SCCACHE_SERVER_PORT port to avoid conflicts in case of parallel compilation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG ALPINE_VERSION=3.18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG PROTOC_VERSION=27.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG RUSTC_WRAPPER | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # DEPS: INSTALL AND CACHE DEPENDENCIES | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM node:20-alpine${ALPINE_VERSION} as deps-base | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM node:20-alpine${ALPINE_VERSION} AS deps-base | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install some dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -82,7 +81,7 @@ RUN TOOLCHAIN_VERSION="$(grep channel rust-toolchain.toml | awk '{print $3}' | t | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install protoc - protobuf compiler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The one shipped with Alpine does not work | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG PROTOC_VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG PROTOC_VERSION=27.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else export PROTOC_ARCH=x86_64; fi; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -Ls https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -o /tmp/protoc.zip && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -95,14 +94,14 @@ RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Select whether we want dev or release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG CARGO_BUILD_PROFILE=dev | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV CARGO_BUILD_PROFILE ${CARGO_BUILD_PROFILE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV CARGO_BUILD_PROFILE=${CARGO_BUILD_PROFILE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG NODE_ENV=production | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV NODE_ENV ${NODE_ENV} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV NODE_ENV=${NODE_ENV} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM deps-base AS deps-sccache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG SCCHACHE_VERSION=0.7.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG SCCHACHE_VERSION=0.8.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install sccache for caching | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export SCC_ARCH=aarch64; else export SCC_ARCH=x86_64; fi; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -156,22 +155,32 @@ ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/${TARGETARCH}/linux-musl | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WORKDIR /platform | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install wasm-bindgen-cli in the same profile as other components, to sacrifice some performance & disk space to gain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # better build caching | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --mount=type=cache,sharing=shared,id=target_${TARGETARCH},target=/platform/target \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| source $HOME/.cargo/env && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUSTFLAGS="-C target-feature=-crt-static" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CARGO_TARGET_DIR="/platform/target" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # TODO: Build wasm with build.rs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Meanwhile if you want to update wasm-bindgen you also need to update version in: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - packages/wasm-dpp/Cargo.toml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - packages/wasm-dpp/scripts/build-wasm.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo install --profile "$CARGO_BUILD_PROFILE" [email protected] [email protected] --locked | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download and install cargo-binstall | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV BINSTALL_VERSION=1.10.11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN set -ex; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$TARGETARCH" = "amd64" ]; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CARGO_BINSTALL_ARCH="x86_64-unknown-linux-musl"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| elif [ "$TARGETARCH" = "arm64" ]; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CARGO_BINSTALL_ARCH="aarch64-unknown-linux-musl"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Unsupported architecture: $TARGETARCH"; exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Construct download URL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DOWNLOAD_URL="https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-${CARGO_BINSTALL_ARCH}.tgz"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download and extract the cargo-binstall binary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf "$DOWNLOAD_URL" | tar -xvzf -; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ./cargo-binstall -y --force cargo-binstall; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm ./cargo-binstall; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| source $HOME/.cargo/env; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo binstall -V | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+255
to
+273
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve error handling in cargo-binstall installation The installation script should verify the successful installation of cargo-binstall before removing the binary and should handle potential network failures. RUN set -ex; \
if [ "$TARGETARCH" = "amd64" ]; then \
CARGO_BINSTALL_ARCH="x86_64-unknown-linux-musl"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
CARGO_BINSTALL_ARCH="aarch64-unknown-linux-musl"; \
else \
echo "Unsupported architecture: $TARGETARCH"; exit 1; \
fi; \
DOWNLOAD_URL="https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-${CARGO_BINSTALL_ARCH}.tgz"; \
- curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf "$DOWNLOAD_URL" | tar -xvzf -; \
- ./cargo-binstall -y --force cargo-binstall; \
- rm ./cargo-binstall; \
+ curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf "$DOWNLOAD_URL" -o cargo-binstall.tgz || exit 1; \
+ tar -xvzf cargo-binstall.tgz || exit 1; \
+ ./cargo-binstall -y --force cargo-binstall || exit 1; \
+ if ! command -v cargo-binstall >/dev/null 2>&1; then \
+ echo "cargo-binstall installation failed"; \
+ exit 1; \
+ fi; \
+ rm ./cargo-binstall cargo-binstall.tgz; \
source $HOME/.cargo/env; \
cargo binstall -V📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN source $HOME/.cargo/env; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo binstall [email protected] [email protected] \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --locked \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --no-discover-github-token \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --disable-telemetry \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --no-track \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --no-confirm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Rust build planner to speed up builds | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -195,6 +204,7 @@ SHELL ["/bin/bash", "-o", "pipefail","-e", "-x", "-c"] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ARG SCCACHE_S3_KEY_PREFIX | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/${TARGETARCH}/linux-musl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV CARGO_HOME=$HOME/.cargo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WORKDIR /platform | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -232,7 +242,6 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export FEATURES_FLAG="--features=console,grovedbg" ; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export OUT_DIRECTORY=debug ; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi && \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo build \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ this repository may be used on the following networks: | |
| in terminal run `echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc` or `echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile` depending on your default shell. | ||
| You can find your default shell with `echo $SHELL` | ||
| - Reload your shell with `source ~/.zshrc` or `source ~/.bash_profile` | ||
| - `cargo install [email protected].85` | ||
| - `cargo install [email protected].86` | ||
| - *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file* | ||
| - *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)* | ||
| - essential build tools - example for Debian/Ubuntu: `apt install -y build-essential libssl-dev pkg-config clang cmake llvm` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ Library consumers must ignore class names minification for `@dashevo/wasm-dpp` l | |
|
|
||
| - Install [Rust](https://www.rust-lang.org/tools/install) v1.73+ | ||
| - Add wasm32 target: `$ rustup target add wasm32-unknown-unknown` | ||
| - Install wasm-bingen-cli: `cargo install [email protected].85` | ||
| - Install wasm-bingen-cli: `cargo install [email protected].86` | ||
| - *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file* | ||
| - *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)* | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,8 @@ fi | |
| # - packages/wasm-dpp/Cargo.toml | ||
| # - Dockerfile | ||
| if ! [[ -x "$(command -v wasm-bindgen)" ]]; then | ||
| echo "Wasm-bindgen CLI ${WASM_BINDGEN_VERSION} is not installed. Installing" | ||
| cargo install --config net.git-fetch-with-cli=true --profile "${CARGO_BUILD_PROFILE}" -f "[email protected]" | ||
| echo "Wasm-bindgen CLI ${WASM_BINDGEN_VERSION} is not installed." | ||
| exit 1 | ||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fi | ||
|
|
||
| # On a mac, bundled clang won't work - you need to install LLVM manually through brew, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.