Skip to content

Commit

Permalink
rustc_wrapper mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AndWeHaveAPlan committed Oct 21, 2023
1 parent c44c327 commit 66650a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 75 deletions.
46 changes: 8 additions & 38 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,20 @@ build-linux-stable:
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
script:
# forklift: Download modified cargo and forklift
- echo "CARGO_MOD_VERSION ${FL_CARGO_MOD_VERSION}"
- echo "FORKLIFT_VERSION ${FL_FORKLIFT_VERSION}"
- 'curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o cargo-mod -L "${CI_API_V4_URL}/projects/677/packages/generic/cargo-mod/${FL_CARGO_MOD_VERSION}/cargo-mod_${FL_CARGO_MOD_VERSION}_linux_amd64"'
# forklift: download binary
- 'curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o forklift -L "${CI_API_V4_URL}/projects/676/packages/generic/forklift/${FL_FORKLIFT_VERSION}/forklift_${FL_FORKLIFT_VERSION}_linux_amd64"'
- chmod +x cargo-mod
- chmod +x forklift
#
# forklift: precalculate hashed (keep the same flags with real cargo run)
- ./cargo-mod build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker > items.cache
# forklift: fix timestamp (git restore-mtime, included in ci-unified)
- find /usr/local/cargo/registry/src/ -exec touch -t 202005260100 {} +
- find . -exec touch -t 202005260100 {} +
- chmod +x forklift
- mkdir .forklift
- cp $FL_FORKLIFT_CONFIG .forklift/config.toml
- git restore-mtime
- tail items.cache
#
# forklift: download cache
- ./forklift pull
--verbose debug
--mode testnet
--storage s3
-p S3_ACCESS_KEY_ID=$FL_GCS_S3_ACCESS_KEY_ID
-p S3_SECRET_ACCESS_KEY=$FL_GCS_S3_SECRET_ACCESS_KEY
-p S3_ENDPOINT_URL=https://storage.googleapis.com
-p S3_BUCKET_NAME=forklift-cache-parity-build-stg
-c zstd
-p COMPRESSION_LEVEL=1
--extra-dir wbuild
.
# forklift: env
- export RUSTC_WRAPPER="$(pwd)/forklift"
- export FORKLIFT_WORK_DIR="$(pwd)"
#
- time cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker
# forklift: upload new artifacts
# forklift: upload new artifacts
- ./forklift push
--verbose debug
--mode testnet
--storage s3
-p S3_ACCESS_KEY_ID=$FL_GCS_S3_ACCESS_KEY_ID
-p S3_SECRET_ACCESS_KEY=$FL_GCS_S3_SECRET_ACCESS_KEY
-p S3_ENDPOINT_URL=https://storage.googleapis.com
-p S3_BUCKET_NAME=forklift-cache-parity-build-stg
-c zstd
-p COMPRESSION_LEVEL=1
--extra-dir wbuild
.
#
- time ROCOCO_EPOCH_DURATION=10 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-10/
- time ROCOCO_EPOCH_DURATION=100 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-100/
Expand Down
45 changes: 8 additions & 37 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,16 @@ test-linux-stable:
# add experimental to features after https://github.com/paritytech/substrate/pull/14502 is merged
# "upgrade_version_checks_should_work" is currently failing
#
# forklift: Download modified cargo and forklift
- echo "CARGO_MOD_VERSION ${FL_CARGO_MOD_VERSION}"
- echo "FORKLIFT_VERSION ${FL_FORKLIFT_VERSION}"
- 'curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o cargo-mod -L "${CI_API_V4_URL}/projects/677/packages/generic/cargo-mod/${FL_CARGO_MOD_VERSION}/cargo-mod_${FL_CARGO_MOD_VERSION}_linux_amd64"'
# forklift: download binary
- 'curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o forklift -L "${CI_API_V4_URL}/projects/676/packages/generic/forklift/${FL_FORKLIFT_VERSION}/forklift_${FL_FORKLIFT_VERSION}_linux_amd64"'
- chmod +x cargo-mod
- chmod +x forklift
#
# forklift: precalculate hashed (keep the same flags with real cargo run)
- ./cargo-mod test --workspace --locked --release --no-fail-fast --features try-runtime,experimental > items.cache
# forklift: fix timestamp (git restore-mtime, included in ci-unified)
- find /usr/local/cargo/registry/src/ -exec touch -t 202005260100 {} +
- find . -exec touch -t 202005260100 {} +
- chmod +x forklift
- mkdir .forklift
- cp $FL_FORKLIFT_CONFIG .forklift/config.toml
- git restore-mtime
- tail items.cache
#
# forklift: download cache
- ./forklift pull
--verbose debug
--mode release
--storage s3
-p S3_ACCESS_KEY_ID=$FL_GCS_S3_ACCESS_KEY_ID
-p S3_SECRET_ACCESS_KEY=$FL_GCS_S3_SECRET_ACCESS_KEY
-p S3_ENDPOINT_URL=https://storage.googleapis.com
-p S3_BUCKET_NAME=forklift-cache-parity-build-stg
-c zstd
-p COMPRESSION_LEVEL=1
--extra-dir wbuild
.
# forklift: env
- export RUSTC_WRAPPER="$(pwd)/forklift"
- export FORKLIFT_WORK_DIR="$(pwd)"
#
- |
time cargo nextest run \
Expand All @@ -75,17 +56,7 @@ test-linux-stable:
#
# forklift: upload new artifacts
- ./forklift push
--verbose debug
--mode release
--storage s3
-p S3_ACCESS_KEY_ID=$FL_GCS_S3_ACCESS_KEY_ID
-p S3_SECRET_ACCESS_KEY=$FL_GCS_S3_SECRET_ACCESS_KEY
-p S3_ENDPOINT_URL=https://storage.googleapis.com
-p S3_BUCKET_NAME=forklift-cache-parity-build-stg
-c zstd
-p COMPRESSION_LEVEL=1
--extra-dir wbuild
.
#
# run runtime-api tests with `enable-staging-api` feature on the 1st node
- if [ ${CI_NODE_INDEX} == 1 ]; then time cargo nextest run -p sp-api-test --features enable-staging-api; fi
artifacts:
Expand Down

0 comments on commit 66650a4

Please sign in to comment.