Skip to content
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

fix: use toolchain file while building dependencies #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LtdSauce
Copy link

This commit make the cargo build command that builds the dependencies actually adhere to the toolchain file if it was present in the recipe.

Before this it was ignored and thus the next call to cargo build would rebuild all dependencies again, but then with what is actually contained in the toolchain file. This was because the environment variable 'RUSTUP_TOOLCHAIN' was already set and so the toolchain file was not considered, see here for details:
https://rust-lang.github.io/rustup/overrides.html

This should fix #271 (and also solve the missing piece for #231)

This commit make the cargo build command that builds the dependencies
actually adhere to the toolchain file if it was present in the recipe.

Before this it was ignored and thus the next call to cargo build would
rebuild all dependencies again, but then with what is actually contained
in the toolchain file. This was because the environment variable
'RUSTUP_TOOLCHAIN' was already set and so the toolchain file was not
considered, see here for details:
https://rust-lang.github.io/rustup/overrides.html
@LtdSauce
Copy link
Author

Hi! I have not found tests, that actually check the cargo invokation and thus did not add any tests for this.
I have tested it locally though by executing it with this fix and saw that the toolchain file was not recognized before it, but after the patch it was.

This could be reproduced using any recipe that contains a toolchain, that uses a different channel/version than what is installed by default. I used the following for example:
recipe.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toolchain in recipe.json is ignored in cargo chef cook
1 participant