-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Introduce a TargetTriple enum to support absolute target paths #49019
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (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. |
Travis failure is legit |
Thanks for the hint, I pushed a new version. |
@bors r+ |
📌 Commit 4b16597 has been approved by |
@pnkfelix I added a commit that appends a hash of the target path when a
|
Rebased and fixed some target triple uses introduced by other PRs. |
☔ The latest upstream changes (presumably #49308) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased |
Add support for absolute target.json paths Builds upon rust-lang/rust#49019 with the goal to provide a solution to #4905. This PR does two things: ~~1. It appends a hash of the target path to the target folder name if a `*.json` path is passed as `--target`, like it's done in rust-lang/rust#49019. This helps differentiating targets with the same JSON file name and avoids sysroot clashes in `xargo`.~~ See #5228 (comment) 2. It canonicalizes the passed target path (if it's a `*.json` path), so that the path stays valid when building dependencies and setting the `RUST_TARGET_PATH` environment variable is no longer necessary.
@bors r+ |
📌 Commit b889f98 has been approved by |
Introduce a TargetTriple enum to support absolute target paths This PR replaces target triple strings with a `TargetTriple` enum, which represents either a target triple or a path to a JSON target file. The path variant is used if the `--target` argument has a `.json` extension, else the target triple variant is used. The motivation of this PR is support for absolute target paths to avoid the need for setting the `RUST_TARGET_PATH` environment variable (see rust-lang/cargo#4905 for more information). For places where some kind of triple is needed (e.g. in the sysroot folder), we use the file name (without extension). For compatibility, we keep the old behavior of searching for a file named `$(target_triple).json` in `RUST_TARGET_PATH` for non-official target triples.
☀️ Test successful - status-appveyor, status-travis |
This PR replaces target triple strings with a
TargetTriple
enum, which represents either a target triple or a path to a JSON target file. The path variant is used if the--target
argument has a.json
extension, else the target triple variant is used.The motivation of this PR is support for absolute target paths to avoid the need for setting the
RUST_TARGET_PATH
environment variable (see rust-lang/cargo#4905 for more information). For places where some kind of triple is needed (e.g. in the sysroot folder), we use the file name (without extension).For compatibility, we keep the old behavior of searching for a file named
$(target_triple).json
inRUST_TARGET_PATH
for non-official target triples.