-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add cc toolchain files to rustc dependencies (for linker) #217
Conversation
Looks fine to me, but I'd like another thumbs up since I know the least
about bazel :)
…On Tue, Apr 23, 2019, 18:19 Lee Mracek ***@***.***> wrote:
@m3rcuriel <https://github.com/m3rcuriel> requested your review on: #217
<#217> Add cc toolchain
files to rustc dependencies (for linker) as a code owner.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#217 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAROG6DNYHTKMSTWUDXUWBDPR6DOZANCNFSM4HH6254A>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine to me, please add a TODO about finding a canonical way to include C++ toolchains files (indeed that should comes with cc_toolchain, @hlopko any idea?).
The only downside of doing that I can see is that we may have way to much files in the input of the action.
Hi all, to make sure I understand the issue correctly, you want to do this so the linker is present for the linking action, not the linker script (one is tool that does linking, another one is a script that ld can consume to tweak the linking process, used e.g. to specify symbol visibility etc), correct? The best way to access C++ toolchain files is to use The best way to access the C++ toolchain is to use |
@hlopko correct, this is in order to ensure that the linker itself (and its dependencies!) are available in the sandbox during linking. I was going to use Currently we get the toolchain out of |
a7c506a
to
dd8eb35
Compare
rust/private/rustc.bzl
Outdated
@@ -198,7 +198,8 @@ def rustc_compile_action( | |||
transitive = [ | |||
toolchain.rustc_lib.files, | |||
toolchain.rust_lib.files, | |||
], | |||
# TODO wait for CcToolchainInfo.all_files to be available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO wait for CcToolchainInfo.all_files to be available | |
# C++ library linked in rust libraries need the linker to be available at compile-time. | |
# TODO: Switch to CcToolchainInfo.all_files once available. |
@mfarrugi I have no idea why this failed CI on one OS, and I don't have OS X to test on. |
You can get CI to run again by rebasing or making some cosmetic changes.
At a glance the osx error looks like it's not flakey.. but would have
failed on all platforms if that were the case.
…On Sat, May 4, 2019 at 3:00 PM Lee Mracek ***@***.***> wrote:
@mfarrugi <https://github.com/mfarrugi> I have no idea why this failed CI
on one OS, and I don't have OS X to test on.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAROG6ACANDNQO56CR3MSZTPTXMLVANCNFSM4HH6254A>
.
|
dd8eb35
to
f617724
Compare
So we should probably add an artifacted compiler/linker set up to test now that I've gotten it working. The reason it was failing is because |
Now featuring the required fixes to get this to work with
I'm fairly sure that flipping |
Currently if you're using an artifacted compiler the Rust rules will complain that they can't find the linker script. This is because it is not a dependency.
I'm pretty sure there's a correct way to do this with the new toolchain system but I was looking around and saw that people mostly stuck with this with some TODOs to find a better way.
I tried to get it using
ctx.toolchains
but that doesn't actually have files, it seems.