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 cla@meta.com. 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_envtoRustToolchainInfoRUSTUP_TOOLCHAINandRUSTUP_HOMEwhich otherwise would need to be set on eachrust_*target - https://rust-lang.github.io/rustup/environment-variables.htmlRUSTUP_TOOLCHAINandRUSTUP_HOMEallows 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-platformsvia 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_envis added with this PR):Full sample of rust with RE staged in EngFlow/example#361 (currently without use of
rustc_envattr).