Closed Bug 1705064 Opened 5 years ago Closed 4 years ago

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)

defect

Tracking

(Not tracked)

RESOLVED INVALID

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.

It's still happening for me.

I now get:

0:05.48 error: no matching package named compiler_builtins found
0:05.48 location searched: registry crates-io
0:05.48 required by package std 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.

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.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.