Skip to content

Commit

Permalink
Enable Ubuntu reproducibility checks (#684)
Browse files Browse the repository at this point in the history
* Enable Ubuntu reproducibility checks

* Standardize source references

This ensures that source references (as in error messages) do not refer
to local checkouts (like e.g. `/home/someone/.cargo`).

* Clean up
  • Loading branch information
nmattia authored Jun 14, 2022
1 parent 6398718 commit 94b9049
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/canister-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,25 @@ jobs:
clean-build:
runs-on: ${{ matrix.os }}
if: ${{ github.ref == 'refs/heads/main' }}
needs: docker-build
strategy:
matrix:
os: [ ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, macos-10.15, macos-11, macos-12 ]
steps:
- uses: actions/checkout@v2
- name: 'Download wasm'
uses: actions/download-artifact@v2
with:
name: internet_identity_production.wasm
path: .
- run: |
sha256=$(shasum -a 256 ./internet_identity_production.wasm | cut -d ' ' -f1)
echo "::set-output name=sha256::$sha256"
id: sha256
- uses: ./.github/actions/check-build
with:
sha256: '' # tell the build check to _not_ check the hash until we have reproducibility
# we check that ubuntu builds match the docker build
sha256: ${{ startsWith(matrix.os, 'ubuntu') && steps.sha256.outputs.sha256 || '' }}
rust-version: 1.58.1
ic-cdk-optimizer-version: 0.3.1
7 changes: 6 additions & 1 deletion src/internet_identity/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ npm run build
II_DIR="$(dirname "$0")"
TARGET="wasm32-unknown-unknown"

# standardize source references
CARGO_HOME="${CARGO_HOME:-"$HOME/.cargo"}"
RUSTFLAGS="--remap-path-prefix $CARGO_HOME=/cargo"

cargo_build_args=(
--manifest-path "$II_DIR/Cargo.toml"
--target "$TARGET"
Expand All @@ -38,8 +42,9 @@ then
fi

echo Running cargo build "${cargo_build_args[@]}"
echo RUSTFLAGS: "$RUSTFLAGS"

cargo build "${cargo_build_args[@]}"
RUSTFLAGS="$RUSTFLAGS" cargo build "${cargo_build_args[@]}"

CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$II_DIR/../../target/}"

Expand Down

0 comments on commit 94b9049

Please sign in to comment.