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

[0.2] Add RUSTC_WRAPPER support to build script #3845

Merged

Conversation

nathaniel-bennett
Copy link
Contributor

@nathaniel-bennett nathaniel-bennett commented Aug 16, 2024

(backport #3842)
(cherry picked from commit 8dba4a0)

@rustbot
Copy link
Collaborator

rustbot commented Aug 16, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35
Copy link
Contributor

tgross35 commented Aug 17, 2024

This looks fine, but any reason it doesn't use the exact same pattern as #3842? if let rather than match

@nathaniel-bennett
Copy link
Contributor Author

While backporting to 0.2, the Windows with rust 1.19 checks failed due to the filter() API not being stable yet for that version of rust. Using match rather than let... else with filter() fixed that.

@tgross35
Copy link
Contributor

Makes sense, thanks for the clarification.

@tgross35 tgross35 added this pull request to the merge queue Aug 17, 2024
Merged via the queue into rust-lang:libc-0.2 with commit 3f102f3 Aug 17, 2024
51 checks passed
@nlflint
Copy link

nlflint commented Aug 30, 2024

This MR broke compilation of libc when using clippy-driver as my RUSTC_WRAPPER. I think the root cause is clippy-driver not this MR though. The clippy-driver doesn't "wrap" rustc properly, in that its output from --version isn't the same as rustc, so it can't be parsed.

For anyone else having this problem, I am currently able to workaround it by setting RUSTC_WORKSPACE_WRAPPER with my clippy-driver path, instead of RUSTC_WRAPPER. However, this brings the question to mind, by bypassing this, am I missing out on something?

@dtolnay
Copy link
Member

dtolnay commented Aug 30, 2024

Libc will need to use $RUSTC_WRAPPER $RUSTC --rustc --version when $RUSTC_WRAPPER $RUSTC --version produces output that begins with "clippy". I've need logic to handle the same thing in rustversion for a long time:
https://github.com/dtolnay/rustversion/blob/1.0.17/build/build.rs
https://github.com/dtolnay/rustversion/blob/1.0.17/build/rustc.rs

@tgross35
Copy link
Contributor

Good point, it feels like we had this same discussion somewhere else very recently. @nathaniel-bennett would you be able to put up a fix?

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

Successfully merging this pull request may close these issues.

5 participants