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

cargo install will ignore the target triple specified in a project directory #5606

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

vramana
Copy link
Contributor

@vramana vramana commented Jun 4, 2018

Fixes #5441

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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.

let mut compile_opts = args.compile_options(config, CompileMode::Build)?;
compile_opts.build_config.release = !args.is_present("debug");
// We override target architecture to host architecture since it may be
// set to some other architecture in .cargo/config.
compile_opts.build_config.requested_target = host;
Copy link
Member

Choose a reason for hiding this comment

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

This could be just .requesetd_target = None I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me change that and see if that works.

@matklad
Copy link
Member

matklad commented Jun 5, 2018

The test should go into https://github.com/rust-lang/cargo/blob/d33c65cbd9d6f7ba1e18b2cdb85fea5a09973d3b/tests/testsuite/install.rs directory.

I think the test should write a .cargo/config file inside the project root with

[build]
target = "non-existing-target"

and check that cargo install works.

@vramana
Copy link
Contributor Author

vramana commented Jun 17, 2018

@matklad Sorry for the delay. I have added the test. Can you check now?

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 27, 2018

📌 Commit 1bad991 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jun 27, 2018

⌛ Testing commit 1bad991 with merge 561beb2...

bors added a commit that referenced this pull request Jun 27, 2018
`cargo install` will ignore the target triple specified in a project directory

Fixes #5441
@matklad
Copy link
Member

matklad commented Jun 27, 2018

@alexcrichton it's interesting that we have #5614 as well, which is sort-of the opposite of this pull request.

@bors
Copy link
Contributor

bors commented Jun 27, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 561beb2 to master...

@bors bors merged commit 1bad991 into rust-lang:master Jun 27, 2018
@alexcrichton
Copy link
Member

Er oops, should have taken more time to catch up! I'll continue discussion on #5606

@alexcrichton
Copy link
Member

er, on #5614

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.

cargo install uses my project's .cargo/config target triple and it shouldn't?
6 participants