Skip to content

Commit

Permalink
build: Ensure pinned versions when installing wasm-pack (#37568)
Browse files Browse the repository at this point in the history
* build: Ensure pinned versions when installing wasm-pack

When installing `wasm-pack` with `cargo`, use the `--locked` flag to
ensure the versions referenced in the Cargo.lock file are used and not
any newer versions. This creates a repeatable build and insulates us
from upstream breakage in new versions.

In particular an upstream version change included the hoot-0.1.2
dependency on a new build which fails to build with rust 1.71.1, which
is the version we are using.

Link: rustwasm/wasm-pack#1365

* Update e ref for version pinned cargo build of wasm-pack
  • Loading branch information
camscale committed Jan 30, 2024
1 parent 14b95e2 commit d43e07c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install wasm-pack
run: |
cargo install wasm-pack --version ${WASM_PACK_VERSION}
cargo install wasm-pack --locked --version ${WASM_PACK_VERSION}
- name: Build
run: make binaries
2 changes: 1 addition & 1 deletion build.assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ RUN curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --p

ARG WASM_PACK_VERSION
# Install wasm-pack for targeting WebAssembly from Rust.
RUN cargo install wasm-pack --version ${WASM_PACK_VERSION}
RUN cargo install wasm-pack --locked --version ${WASM_PACK_VERSION}

# Switch back to root for the remaining instructions and keep it as the default
# user.
Expand Down
2 changes: 1 addition & 1 deletion build.assets/Dockerfile-centos7
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ RUN curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --p
# Install wasm-pack for targeting WebAssembly from Rust.
ARG WASM_PACK_VERSION
# scl enable is required to use the newer C compiler installed above. Without it, the build fails.
RUN scl enable ${DEVTOOLSET} "cargo install wasm-pack --version ${WASM_PACK_VERSION}"
RUN scl enable ${DEVTOOLSET} "cargo install wasm-pack --locked --version ${WASM_PACK_VERSION}"

# Do a quick switch back to root and copy/setup libfido2 and libpcsclite binaries.
# Do this last to take better advantage of the multi-stage build.
Expand Down
2 changes: 1 addition & 1 deletion build.assets/Dockerfile-node
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ RUN curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --p

# Install wasm-pack for targeting WebAssembly from Rust.
ARG WASM_PACK_VERSION
RUN cargo install wasm-pack --version ${WASM_PACK_VERSION}
RUN cargo install wasm-pack --locked --version ${WASM_PACK_VERSION}
2 changes: 1 addition & 1 deletion e
Submodule e updated from c2f035 to c7391c

0 comments on commit d43e07c

Please sign in to comment.