diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a687921f61c9300f1a64aa50b1ccbcb0af721ad..0129a27b144a80e7acb215e306fe72bf7da26ec4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,11 +45,6 @@ workflow: # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' > ${CARGO_HOME}/config - sccache -s - - # needed until https://github.com/mozilla/sccache/issues/1000 is fixed. - # this is unfortunate, since it disables `sccache` for this entire file. - - unset RUSTC_WRAPPER - - git show rules: - if: $CI_PIPELINE_SOURCE == "web" @@ -105,6 +100,9 @@ test-dylint: - cargo fmt --verbose --all -- --check - cargo clippy --verbose -- -D warnings; + # Needed until https://github.com/mozilla/sccache/issues/1000 is fixed. + - unset RUSTC_WRAPPER + - cargo test --verbose --all-features test: diff --git a/build.rs b/build.rs index be64662498f30c587b59ca4246e1e352d5c7d918..513df6cca96419087a907611a31e7dc73284bd9a 100644 --- a/build.rs +++ b/build.rs @@ -139,6 +139,12 @@ fn build_and_zip_dylint_driver( &manifest_arg, ]); + // There are generally problems with having a custom `rustc` wrapper, while + // executing `dylint` (which has a custom linker). Especially for `sccache` + // there is this bug: https://github.com/mozilla/sccache/issues/1000. + // Until we have a justification for leaving the wrapper we should unset it. + cmd.env_remove("RUSTC_WRAPPER"); + // We need to remove those environment variables because `dylint` uses a // fixed Rust toolchain via the `ink_linting/rust-toolchain` file. By removing // these env variables we avoid issues with different Rust toolchains diff --git a/src/cmd/build.rs b/src/cmd/build.rs index f0136753bee9662623215f17def054339f0ada89..99faf9566fd6b10e710942881a6ea15079ce65ed 100644 --- a/src/cmd/build.rs +++ b/src/cmd/build.rs @@ -332,6 +332,11 @@ fn exec_cargo_dylint(crate_metadata: &CrateMetadata, verbosity: Verbosity) -> Re // removing this env variable we avoid issues with different Rust toolchains // interfering with each other. ("CARGO_TARGET_DIR", None), + // There are generally problems with having a custom `rustc` wrapper, while + // executing `dylint` (which has a custom linker). Especially for `sccache` + // there is this bug: https://github.com/mozilla/sccache/issues/1000. + // Until we have a justification for leaving the wrapper we should unset it. + ("RUSTC_WRAPPER", None), ]; let working_dir = crate_metadata .manifest_path