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

mk: Fix MSVC bootstrapping itself #25848

Merged
merged 1 commit into from Jun 2, 2015

Conversation

Projects
None yet
7 participants
@alexcrichton
Copy link
Member

alexcrichton commented May 28, 2015

Now that MSVC support has landed in the most recent nightlies we can now have
MSVC bootstrap itself without going through a GNU compiler first. Unfortunately,
however, the bootstrap currently fails due to the compiler not being able to
find the llvm-ar.exe tool during the stage0 libcore compile. The compiler cannot
find this tool because it's looking inside a directory that does not exist:

$SYSROOT/rustlib/x86_64-pc-windows-gnu/bin

The gnu on this triple is because the bootstrap compiler's host architecture
is GNU. The build system, however, only arranges for the llvm-ar.exe tool to be
available in this location:

$SYSROOT/rustlib/x86_64-pc-windows-msvc/bin

To resolve this discrepancy, the build system has been modified to understand
triples that are bootstrapped from another triple, and in this case copy the
native tools to the right location.

mk: Fix MSVC bootstrapping itself
Now that MSVC support has landed in the most recent nightlies we can now have
MSVC bootstrap itself without going through a GNU compiler first. Unfortunately,
however, the bootstrap currently fails due to the compiler not being able to
find the llvm-ar.exe tool during the stage0 libcore compile. The compiler cannot
find this tool because it's looking inside a directory that does not exist:

    $SYSROOT/rustlib/x86_64-pc-windows-gnu/bin

The `gnu` on this triple is because the bootstrap compiler's host architecture
is GNU. The build system, however, only arranges for the llvm-ar.exe tool to be
available in this location:

    $SYSROOT/rustlib/x86_64-pc-windows-msvc/bin

To resolve this discrepancy, the build system has been modified to understand
triples that are bootstrapped from another triple, and in this case copy the
native tools to the right location.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented May 28, 2015

r? @pcwalton

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

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented May 28, 2015

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned pcwalton May 28, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented May 28, 2015

I have confirmed in dev that this is able to bootstrap itself!

@retep998

This comment has been minimized.

Copy link
Member

retep998 commented May 31, 2015

Confirmed on my system as well.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 1, 2015

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 1, 2015

📌 Commit b8c5921 has been approved by brson

bors added a commit that referenced this pull request Jun 2, 2015

Auto merge of #25848 - alexcrichton:fix-msvc, r=brson
Now that MSVC support has landed in the most recent nightlies we can now have
MSVC bootstrap itself without going through a GNU compiler first. Unfortunately,
however, the bootstrap currently fails due to the compiler not being able to
find the llvm-ar.exe tool during the stage0 libcore compile. The compiler cannot
find this tool because it's looking inside a directory that does not exist:

    $SYSROOT/rustlib/x86_64-pc-windows-gnu/bin

The `gnu` on this triple is because the bootstrap compiler's host architecture
is GNU. The build system, however, only arranges for the llvm-ar.exe tool to be
available in this location:

    $SYSROOT/rustlib/x86_64-pc-windows-msvc/bin

To resolve this discrepancy, the build system has been modified to understand
triples that are bootstrapped from another triple, and in this case copy the
native tools to the right location.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jun 2, 2015

⌛️ Testing commit b8c5921 with merge f141901...

@bors bors merged commit b8c5921 into rust-lang:master Jun 2, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@vadimcn

This comment has been minimized.

Copy link
Contributor

vadimcn commented Jun 3, 2015

I am wondering if the right solution for this problem wouldn't be replacing host_filesearch with target_filesearch on this line.
IIRC, rustlib/<target>/bin was supposed to contain host platform's tools that can output target platform's binaries.

@alexcrichton alexcrichton deleted the alexcrichton:fix-msvc branch Jun 3, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jun 3, 2015

That was actually my original thought as well, but after some discussion with @brson we concluded that it would probably make the most sense to not assume that the host can run the target binaries (because it's not true in most situations).

I think in the long term we want the tools we provide (in <target>/bin) to be as maximally "cross compilable" as possible. For example the llvm-ar.exe we're shipping now with MSVC is able to manage archives for all our targets (as far as I know at least), so it means that if you want to cross to an arbitrary target you can also use the tools that we ship.

@vadimcn

This comment has been minimized.

Copy link
Contributor

vadimcn commented Jun 3, 2015

I think in the long term we want the tools we provide (in <target>/bin) to be as maximally "cross compilable" as possible. For example the llvm-ar.exe we're shipping now with MSVC is able to manage archives for all our targets (as far as I know at least),

Shouldn't they live in bin then (next to rustc)?

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jun 3, 2015

That has the unfortunate side effect of being installed-by-default for the entire system, which isn't perhaps always desired. For example I would be somewhat uncomfortable distributing llvm-ar to all systems' normal /bin folder.

We could perhaps but rustc in multiple locations! (it's quite small after all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.