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

Fix Windows rustbuild #32206

Merged
merged 4 commits into from Mar 15, 2016
Merged

Conversation

alexcrichton
Copy link
Member

These commits fix the rustbuild Windows bots, namely:

  • The 32-bit build of LLVM was failing because libraries weren't being linked. This was in turn caused by the build script for rustc_llvm erroneously detecting that it was cross compiling when it actually wasn't.
  • Tools of the build were compiled against the wrong libraries, so running them would fail on Windows as rpath didn't exist and PATH was wrong.
  • Some linkchecker fixes for Windows paths had to be applied as well.

@alexcrichton
Copy link
Member Author

r? @brson

@brson
Copy link
Contributor

brson commented Mar 14, 2016

r=me with nits

Unfortunately on i686-pc-windows-gnu LLVM's answer to `--host-target` is
`x86_64-pc-windows-gnu` even though we're building in a 32-bit shell as well as
compiling 32-bit libraries. For now use Cargo's `HOST` environment variable to
determine whether we're doing a cross compilation or not.
This sets up the dynamic loader path for dylibs required, so should fix the MSVC
build right now.
The facet of a stage is rarely relevant when running a tool or building
something, it's all a question of what stage the *compiler* is built in. We've
already got a nice handy `Compiler` structure to carry this information, so
let's use it!

This refactors the signature of the `Build::cargo` function two ways:

1. The `stage` argument is removed, this was just duplicated with the `compiler`
   argument's stage field.
2. The `target` argument is now required. This was a bug where if the `--target`
   flag isn't passed then the snapshot stage0 compiler is always used, so we
   won't pick up any changes.

Much of the other changes in this commit are just propagating these decisions
outwards. For example many of the `Step` variants no longer have a stage
argument as they're baked into the compiler.
@alexcrichton
Copy link
Member Author

@bors: r=brson 158b854

// This generally just means that we can't trust all the output of
// llvm-config becaues it might be targeted for the host rather than the
// target.
// We *want* detect this cross compiling situation by asking llvm-config
Copy link
Member

Choose a reason for hiding this comment

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

want -> want to

@bors
Copy link
Contributor

bors commented Mar 15, 2016

⌛ Testing commit 158b854 with merge 34b95a3...

bors added a commit that referenced this pull request Mar 15, 2016
Fix Windows rustbuild

These commits fix the rustbuild Windows bots, namely:

* The 32-bit build of LLVM was failing because libraries weren't being linked. This was in turn caused by the build script for `rustc_llvm` erroneously detecting that it was cross compiling when it actually wasn't.
* Tools of the build were compiled against the wrong libraries, so running them would fail on Windows as rpath didn't exist and `PATH` was wrong.
* Some linkchecker fixes for Windows paths had to be applied as well.
@bors bors merged commit 158b854 into rust-lang:master Mar 15, 2016
@alexcrichton alexcrichton deleted the fix-windows-rustbuild branch March 27, 2016 17:49
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.

None yet

4 participants