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

rustbuild: Fix MSBuild location of llvm-config.exe #48757

Merged
merged 1 commit into from
Mar 9, 2018

Conversation

alexcrichton
Copy link
Member

For LLD integration the path to llvm-config needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on ninja for MSVC builds, so the path to
llvm-config.exe was actually wrong and not working!

This commit removes the Build::llvm_config function in favor of the source of
truth, the Llvm build step itself. The build step was then updated to find the
right build directory for MSBuild as well as ninja for where llvm-config.exe
is located.

Closes #48749

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 5, 2018
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

I think with the comment I'll consider this good to go.

@@ -162,7 +162,11 @@ pub fn std_cargo(build: &Build,
// missing
// We also only build the runtimes when --enable-sanitizers (or its
// config.toml equivalent) is used
cargo.env("LLVM_CONFIG", build.llvm_config(target));
let llvm_config = build.ensure(native::Llvm {
target: build.config.build,
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be the target we're passing to std_cargo? Or is this some other llvm-config? Either way, it'd be good to comment on the build.config.build with why we're passing it, and not target.

It also looks like it's maybe worth making this build.ensure(...) call the body of the old llvm_config function and then just calling it so we avoid duplicating it. But that's probably a minor detail, up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good point! I was hoping to keep the ensure here though to canonicalize the definition of where llvm-config comes from in one place (previously it was calculated in two places)

@alexcrichton
Copy link
Member Author

re-r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 7, 2018

📌 Commit d04a029 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 7, 2018
@Zoxc
Copy link
Contributor

Zoxc commented Mar 9, 2018

@bors p=1

Giving this a little boost so I can actually build rustc locally

@bors
Copy link
Contributor

bors commented Mar 9, 2018

⌛ Testing commit d04a029ed36479840f33449230927533dfd1b4c3 with merge 4616ea633aa27d1361a573290501e70f1fda9203...

@bors
Copy link
Contributor

bors commented Mar 9, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 9, 2018
@kennytm
Copy link
Member

kennytm commented Mar 9, 2018

dist x86_64-apple-darwin failed, seems legit.

[01:08:50] Building stage2 std artifacts (x86_64-apple-darwin -> aarch64-apple-ios)
[01:08:50] Building LLVM for aarch64-apple-ios
[01:08:50] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "target `aarch64-apple-ios` is not configured as a host, only as a target"', libcore/result.rs:945:5

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2018
For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes rust-lang#48749
@alexcrichton
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Mar 9, 2018

📌 Commit be902e7 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2018
@bors
Copy link
Contributor

bors commented Mar 9, 2018

⌛ Testing commit be902e7 with merge da31cb5...

bors added a commit that referenced this pull request Mar 9, 2018
rustbuild: Fix MSBuild location of `llvm-config.exe`

For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749
@bors
Copy link
Contributor

bors commented Mar 9, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 9, 2018
@pietroalbini
Copy link
Member

macOS crashed with a sigsegv while building stage2 cargo.

@bors retry #48866

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2018
@bors
Copy link
Contributor

bors commented Mar 9, 2018

⌛ Testing commit be902e7 with merge 257ec08...

bors added a commit that referenced this pull request Mar 9, 2018
rustbuild: Fix MSBuild location of `llvm-config.exe`

For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749
@bors
Copy link
Contributor

bors commented Mar 9, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing 257ec08 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants