-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add RUSTC_XCRUN_PATH var #62551
Add RUSTC_XCRUN_PATH var #62551
Conversation
Allows rustc to know about custom xcrun wrappers instead of always assuming xcrun is on PATH.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR! Poking around in clang, I wonder if we could follow their lead here and perhaps support an |
I think that Here is the flow for
Unfortunately,
The flow we're trying to enable is a change in step (2). We have a custom Just to be concrete, here's what the stock
As you can see, the path to |
My worry is that we're just inventing environment variables and configuration for rustc here, adding new stable surface area to the compiler. This env var has no precedent and doesn't really follow any existing convention in rustc itself. Arguably there's already conventions for things like For those reasons I wouldn't be super comfortable without adding this in. We would need to consult more teams and go through a longer stabilization process. If, however, there's existing precedent (like it looks like |
I don't particularly care either way on environment variable vs. command-line flag. I went with environment variable to start because 1) there aren't any platform-specific command-line flags yet (IIUC linker is the only one and the concept of a linker is not platform-specific) and 2) there are several rustc-specific environment variables floating around, like I think there are two ways forward here:
Can you confirm that adding |
Oh sure yeah we've got a number of env vars here and there, but they're all intended for development of rustc and aren't intended to be user facing and configured by normal users of the compiler (e.g. we don't document most of them afaik). This, however, is a user-facing annotation which is one that we would want to advertise and recommend for users to use. I would personally be ok r+'ing a patch using |
Would you like SDKROOT in a separate PR or should I repurpose this one? |
I'm personally ok with either strategy, up to you as to which! |
Replaced by #62903. |
Support SDKROOT env var on iOS Following what clang does (https://github.com/llvm/llvm-project/blob/296a80102a9b72c3eda80558fb78a3ed8849b341/clang/lib/Driver/ToolChains/Darwin.cpp#L1661-L1678), allow allow SDKROOT to tell us where the Apple SDK lives so we don't have to invoke xcrun. Replaces rust-lang#62551.
Allows rustc to know about custom xcrun wrappers instead of always
assuming xcrun is on PATH.
We need this because we have a custom xcrun wrapper that gets installed in a different location.