TSAN build got a error "the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel"
Categories
(Firefox Build System :: Toolchains, defect)
Tracking
(Not tracked)
People
(Reporter: allstars.chh, Unassigned)
Details
Try to build Gecko with TSAN enabled
https://firefox-source-docs.mozilla.org/tools/sanitizer/tsan.html
then 'mach build'
0:01.24 toolkit/library/rust/force-cargo-library-build
0:01.24 error: the -Z flag is only accepted on the nightly channel of Cargo, but this is the stable channel
0:01.24 See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
0:01.24 make[4]: *** [/home/allstars/src/Bug1561322_0818_tsan/config/makefiles/rust.mk:356: force-cargo-library-build] Error 101
Then set the rust toolchain to nightly according to https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
$rustup override set nightly
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: override toolchain for '/home/allstars/src/gecko_tsan' set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.53.0-nightly (132b4e5d1 2021-04-13)
allstars@allstars-XPS:~/src/gecko_tsan$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu (override)
run mach build again, still gets the same error.
Comment 1•4 years ago
|
||
It's still happening for me.
Comment 2•4 years ago
|
||
I now get:
0:05.48 error: no matching package named
compiler_builtinsfound
0:05.48 location searched: registrycrates-io
0:05.48 required by packagestd v0.0.0 (/home/alexandre/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
After:
- switching to rust nightly
- removing the objdir completely.
Comment 3•4 years ago
|
||
Seems like CI uses a specific version of rust? https://searchfox.org/mozilla-central/rev/980b50947e2a855c92f2df74209dadad3ee4d119/taskcluster/ci/toolchain/rust.yml#66-87
Comment 4•4 years ago
|
||
Looks like it is indeed correctly covered in docs: https://firefox-source-docs.mozilla.org/tools/sanitizer/tsan.html?highlight=tsan#llvm-clang-rust
./mach artifact toolchain --from-build linux64-rust-dev
rm -rf ~/.mozbuild/rustc-sanitizers
mv rustc ~/.mozbuild/rustc-sanitizers
rustup toolchain link gecko-sanitizers ~/.mozbuild/rustc-sanitizers
rustup override set gecko-sanitizers
After following those, tsan builds well.
Description
•