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: Fetch target info from Cargo even if Build::target is manually set #1299

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Nov 22, 2024

In the first commit, I've documented more closely what Build::target does, which should avoid confusion like in #1297.

And then it occurs to me that some users might be doing build.target(&std::env::var("TARGET").unwrap()) (even though Build::target has been available since cc v1.0.0), which would give different behaviour than if they didn't do that (since we no longer source from Cargo). So I've added a hacky fix for this case.

We might want to take it even further, and warn if both TARGET and Build::target are set?

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM!

We might want to take it even further, and warn if both TARGET and Build::target are set?

Hmm maybe some users do have a valid use case for this, so let's skip it for now.

@NobodyXu NobodyXu merged commit 6a1def4 into rust-lang:main Nov 22, 2024
27 checks passed
@madsmtm madsmtm deleted the target-allow-set branch November 22, 2024 09:13
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.

2 participants