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

feat: Respect .cargo/config.toml #8774

Merged
merged 2 commits into from
May 9, 2021
Merged

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented May 8, 2021

f1Gup1aiAn

Implements cargo/.config build target and cfg access by using unstable cargo options:

  • cargo config get to read the target triple out of the config to pass to cargo metadata --filter-platform
  • cargo rustc --print to read out the rustc_cfgs, this causes us to honor rustflags and the like.

If those commands fail, due to not having a nightly toolchain present for example, they will fall back to invoking rustc directly as we currently do.

I personally think it should be fine to use these unstable options as they are unlikely to change(even if they did it shouldn't be a problem due to the fallback) and don't burden the user if they do not have a nightly toolchain at hand since we fall back to the previous behaviour.

cc #8741
Closes #6604, Closes #5904, Closes #8430, Closes #8480

@Veykril Veykril changed the title Discover rustc_cfg through unstable cargo options feat: Discover rustc_cfg through unstable cargo options May 8, 2021
@Veykril Veykril changed the title feat: Discover rustc_cfg through unstable cargo options feat: Discover rustc cfgs through cargo May 8, 2021
@Veykril Veykril changed the title feat: Discover rustc cfgs through cargo feat: Honor .cargo/config.toml May 8, 2021
@matklad
Copy link
Member

matklad commented May 9, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented May 9, 2021

@bors bors bot merged commit 6c0cdc5 into rust-lang:master May 9, 2021
@Veykril Veykril deleted the cargo-config branch May 9, 2021 10:52
@Veykril Veykril changed the title feat: Honor .cargo/config.toml feat: Respect .cargo/config.toml May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants