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

Implement the toolchain transition #10523

Closed
katre opened this issue Jan 6, 2020 · 7 comments
Closed

Implement the toolchain transition #10523

katre opened this issue Jan 6, 2020 · 7 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability Issues for Configurability team type: feature request

Comments

@katre
Copy link
Member

katre commented Jan 6, 2020

Tracking issue for the implementation of toolchain transitions.

@eagleonhill
Copy link

What's the target release for toolchain transition and exec transition?

While I agree it's better to use exec transition than host, the fact that currently entire toolchain has applied host transition makes it impossible to include runtime libraries today. If exec transition would take more effort, would it be possible to decouple them, so there's some proper way to link runtime?

Just a little more background: https://docs.bazel.build/versions/master/skylark/lib/CcToolchainInfo.html#dynamic_runtime_lib is currently broken because the symlink is located at bazel-out/host.

@katre
Copy link
Member Author

katre commented Feb 3, 2020

Are you using the --incompatible_enable_cc_toolchain_resolution flag? We haven't flipped that behavior and this is part of the reason it's not the default yet. I'd recommend flipping that back and continuing to use the legacy cc_toolchainsuite` approach if this is causing you problems.

I am working on a migration plan for the toolchain transition and hope to send it around shortly. Once that's been agreed on I'll begin implementation and start working with rule owners to migrate, since doing this as a single world-breaking migration isn't feasible. Because CC rules don't use toolchain resolution by default, getting that working may be far down the list.

katre added a commit to katre/bazel that referenced this issue Feb 4, 2020
DependencyResolver.

Work towards toolchain transition, bazelbuild#10523.
GOOGLE:
RELNOTES: None.
bazel-io pushed a commit that referenced this issue Feb 4, 2020
DependencyResolver.

Work towards toolchain transition, #10523.

PiperOrigin-RevId: 293187791
@timblakely
Copy link

timblakely commented Feb 10, 2020

Just ran into what I thought was #6889. Glad to see I wasn't going crazy when querying ctx.target_platform_has_constraint and not seeing the right constraints.

My use case is that I need to configure features and flag_sets that are passed to the cc_common.create_cc_toolchain_config_info based on the target cpu. My workaround is to have a separate cc_toolchain for each target, but that's not scalable in the long run.

Once toolchain transitions are in, would this use case be supported?

@katre
Copy link
Member Author

katre commented Feb 10, 2020

That is internal to the cc_toolchain machinery, and so it's part of toolchain resolution (toolchain resolution will select a single cc_toolchain instance for a target, and then that toolchain's dependencies are up to the rule implementation).

You'll need to follow up with the CC rule maintainers to find out if that's a use case they want to support. if so, I can work with them on ways to implement it in their toolchain implementation.

katre added a commit to katre/bazel that referenced this issue May 8, 2020
katre added a commit to katre/bazel that referenced this issue May 8, 2020
katre added a commit to katre/bazel that referenced this issue May 8, 2020
Cleanup leading to toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue May 8, 2020
katre added a commit to katre/bazel that referenced this issue May 8, 2020
Cleanup leading to toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue May 8, 2020
Cleanup leading to toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue May 11, 2020
Cleanup leading to toolchain transitions, #10523.

Closes #11338.

PiperOrigin-RevId: 310897592
katre added a commit to katre/bazel that referenced this issue May 11, 2020
it behaves entirely different, this allows removing a lot of unneeded
code.

Part of cleanup leading to toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue May 11, 2020
Cleanup leading to toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue May 12, 2020
Cleanup leading to toolchain transitions, #10523.

Closes #11336.

PiperOrigin-RevId: 311112930
katre added a commit to katre/bazel that referenced this issue May 12, 2020
Cleanup leading to toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue May 12, 2020
Cleanup leading to toolchain transitions, #10523.

Closes #11337.

PiperOrigin-RevId: 311148682
bazel-io pushed a commit that referenced this issue Jun 5, 2020
Part of work on toolchain transitions, #10523.

PiperOrigin-RevId: 314925260
bazel-io pushed a commit that referenced this issue Jun 5, 2020
everything else.

Part of work on toolchain transitions, #10523.

Closes #11546.

PiperOrigin-RevId: 314925331
katre added a commit to katre/bazel that referenced this issue Jun 8, 2020
This version runs both the new and legacy configuration resolution, and
crashes the build if they diverge.

DO NOT SUBMIT.

Part of work on toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue Jun 8, 2020
katre added a commit to katre/bazel that referenced this issue Jun 8, 2020
TODOs mark where this will be set and used.

Part of work on toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue Jun 8, 2020
toolchains to prevent dependency loops.

Part of work on toolchain transitions, bazelbuild#10523.
katre added a commit to katre/bazel that referenced this issue Jun 8, 2020
toolchains to prevent dependency loops.

Part of work on toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue Jun 9, 2020
This removes a large number of obsolete optimizations and reduces the code size and complexity drastically.

Part of work on toolchain transitions, #10523.

Closes #11441.

PiperOrigin-RevId: 315482263
katre added a commit to katre/bazel that referenced this issue Jun 10, 2020
bazel-io pushed a commit that referenced this issue Jun 10, 2020
toolchains to prevent dependency loops.

Part of work on toolchain transitions, #10523.

Closes #11566.

PiperOrigin-RevId: 315714344
katre added a commit to katre/bazel that referenced this issue Jun 10, 2020
katre added a commit to katre/bazel that referenced this issue Jun 10, 2020
TODOs mark where this will be set and used.

Part of work on toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue Jun 10, 2020
Part of work on toolchain transitions, #10523.

Closes #11574.

PiperOrigin-RevId: 315756199
katre added a commit to katre/bazel that referenced this issue Jun 10, 2020
TODOs mark where this will be set and used.

Part of work on toolchain transitions, bazelbuild#10523.
bazel-io pushed a commit that referenced this issue Jun 10, 2020
TODOs mark where this will be set and used.

Part of work on toolchain transitions, #10523.

Closes #11575.

PiperOrigin-RevId: 315766282
katre added a commit to katre/bazel that referenced this issue Jun 11, 2020
transition if appropriate.

Adds a test for the new toolchain transition functionality.

Adds the --incompatible_use_toolchain_transition flag to force all rules to depend on toolchains via the toolchain transition.
Adds the incompatible_use_toolchain_transition rule attribute to force a
specific rule to depend on toolchains via the toolchain transition.

RELNOTES: Rule authors should use the
incompatible_use_toolchain_transition rule attribute to migrate to using
the toolchain transition. jcater to udpate notes further.

Closes bazelbuild#10523.
@hlopko
Copy link
Member

hlopko commented Jun 12, 2020

Wohooo \o/ Congrats! :)

@katre
Copy link
Member Author

katre commented Jun 16, 2020

Re-opening, we also need to support aspects that use toolchains.

@katre katre reopened this Jun 16, 2020
bazel-io pushed a commit that referenced this issue Jun 16, 2020
This will allow Aspects to use the toolchain transition.

Part of work on toolchain transition, #10523.

PiperOrigin-RevId: 316751670
bazel-io pushed a commit that referenced this issue Jun 16, 2020
…ition migration.

Part of work on toolchain transitions, #10523.

PiperOrigin-RevId: 316752326
@katre
Copy link
Member Author

katre commented Jun 16, 2020

Now I can close again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability Issues for Configurability team type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants