-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rustc env to rust toolchain #822
Conversation
Hi @nlopezgi! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
I was suggested in the buck2 discord that:
https://discord.com/channels/1100487223746510850/1100487225889796118/1318896818955878474 I did further investigation to verify if there is a way to configure the rust toolchain in the container in a way that it is not necessary to set these env vars. These are my findings: This is the error I get when
This is the error that I get when I dont define
Note I have tested this using the AWS provided rust image as well as the docker hub one https://hub.docker.com/_/rust and these errors occur in both cases. I even went further to see if it was possible to create a custom Docker image where the rustup toolchain was configured before hand. I tried to create a custom container with the following Dockerfile:
I then start up the container and when I run
However, if I start the rust vanilla bookworm container and run:
It seems for some reason the state of the default toolchain (set via RUN rustup default local ) is not saved in a way that I can create a docker image with it set and then start a container and find the rustup toolchain is properly defined. I also tried to create a docker image with the env vars set via the following Dockerfile:
And then tried to use that for remote execution, but even in that case I got the error:
My impression is that it is because the default env in the container is not used when the After this follow up investigation I am pretty confident there is no way to run |
Thanks for your help. We found a way to avoid needing these env vars by directly passing the paths to the compiler and other rust toolchain tools. Closing. |
rustc_env
toRustToolchainInfo
RUSTUP_TOOLCHAIN
andRUSTUP_HOME
which otherwise would need to be set on eachrust_*
target - https://rust-lang.github.io/rustup/environment-variables.htmlRUSTUP_TOOLCHAIN
andRUSTUP_HOME
allows for remote execution ofrust_*
rules where the rust toolchain is preinstalled in the remote execution environment (i.e., inside a container defined in a platform configured for remote execution).--target-platforms
via the command line. If these are defined on therust_*
targets they will need select statements on each target.Example
rust_*
target with select statement (not ideal):Example rust toolchain with env vars (once
rustc_env
is added with this PR):Full sample of rust with RE staged in EngFlow/example#361 (currently without use of
rustc_env
attr).