https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-breakfast-49010

01/05/2021, 10:00 PM
I'm suddenly getting a bunch of Rust errors from the pre-commit hook
cargo clippy
invocation, when making changes on a clean master that don't touch rust at all
w

witty-crayon-22786

01/05/2021, 10:02 PM
which commit
h

hundreds-breakfast-49010

01/05/2021, 10:17 PM
dee363930f4d4f37438695128e082a1266253d26
Fix
--opt
options in constraints.txt files erroring (#11407)
w

witty-crayon-22786

01/05/2021, 10:19 PM
i don’t repro for
./cargo clippy
… my system
rust
install is 1.48, but i’m updating to confirm that that isn’t leaking
yea, no leakage. it’s still using
1.48
for pantsbuild/pants.
what kind of errors are you seeing…?
h

hundreds-breakfast-49010

01/05/2021, 10:21 PM
output
this is just me running
./cargo clippy --all
on master
./cargo --version
reports 1.47 for me
w

witty-crayon-22786

01/05/2021, 10:25 PM
weird! … the
rust-toolchain
file in the root of the repository is there?
and you’re running from the root of the repo?
h

hundreds-breakfast-49010

01/05/2021, 10:26 PM
huh just realized
rust-toolchain
says 1.48
but yes it's there
and yes running from the root of the repo
my system rust is 1.49
w

witty-crayon-22786

01/05/2021, 10:26 PM
anything interesting in
env
?
h

hundreds-breakfast-49010

01/05/2021, 10:26 PM
don't think so
w

witty-crayon-22786

01/05/2021, 10:26 PM
the
1.47
bit is definitely the issue. inside the repo i see
1.48
, and outside i see
1.49
(as expected)
h

hundreds-breakfast-49010

01/05/2021, 10:26 PM
no
CARGO_
env vars
w

witty-crayon-22786

01/05/2021, 10:27 PM
RUSTUP_
…?
h

hundreds-breakfast-49010

01/05/2021, 10:27 PM
nope
Copy code
at 14:28:09 ➤ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/gregs/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
1.37.0-x86_64-unknown-linux-gnu
1.38.0-x86_64-unknown-linux-gnu
1.39.0-x86_64-unknown-linux-gnu
1.42.0-x86_64-unknown-linux-gnu
1.43.1-x86_64-unknown-linux-gnu
1.44.0-x86_64-unknown-linux-gnu
1.44.1-x86_64-unknown-linux-gnu
1.45.0-x86_64-unknown-linux-gnu
1.45.2-x86_64-unknown-linux-gnu
1.46.0-x86_64-unknown-linux-gnu
1.47.0-x86_64-unknown-linux-gnu

active toolchain
----------------

1.47.0-x86_64-unknown-linux-gnu (directory override for '/home/gregs/code/pants')
rustc 1.47.0 (18bf6b4f0 2020-10-07)
w

witty-crayon-22786

01/05/2021, 10:28 PM
wat…
h

hundreds-breakfast-49010

01/05/2021, 10:29 PM
Copy code
at 14:28:50 ➤ cat rust-toolchain 
1.48.0
w

witty-crayon-22786

01/05/2021, 10:29 PM
is your rustup old maybe?
h

hundreds-breakfast-49010

01/05/2021, 10:29 PM
yeah no idea what's going on
Copy code
at 14:28:51 ➤ rustup --version
rustup 1.23.0 (2020-11-27)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.47.0 (18bf6b4f0 2020-10-07)`
w

witty-crayon-22786

01/05/2021, 10:29 PM
there was a
rustup --self update
…?
…but that’s fairly new.
oh, hey
h

hundreds-breakfast-49010

01/05/2021, 10:30 PM
yeah rustup updates from the arch linux package manger, 1.23 is the latest version
w

witty-crayon-22786

01/05/2021, 10:30 PM
Copy code
active toolchain
----------------

1.48.0-x86_64-apple-darwin (overridden by '/Users/stuhood/src/pants/rust-toolchain')
rustc 1.48.0 (7eac88abb 2020-11-16)
note:
Copy code
/Users/stuhood/src/pants/rust-toolchain
so… do you have a separate override configured?
h

hundreds-breakfast-49010

01/05/2021, 10:30 PM
huh, maybe I overrode it once and forgot?
w

witty-crayon-22786

01/05/2021, 10:30 PM
Copy code
To remove the override and use the default toolchain again, `rustup override unset`.
👍 1
h

hundreds-breakfast-49010

01/05/2021, 10:31 PM
yeah that was the problem
apparently I set it to 1.47 at some point
w

witty-crayon-22786

01/05/2021, 10:31 PM
👍
h

hundreds-breakfast-49010

01/05/2021, 10:31 PM
removing the override forces rustup to download the 1.48 toolchain
👍 1