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

incompatible_enable_cc_toolchain_resolution: Turn on toolchain resolution for cc rules #7260

Open
katre opened this Issue Jan 25, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@katre
Copy link
Member

katre commented Jan 25, 2019

Flag: --incompatible_enable_cc_toolchain_resolution
Available since: 0.23
Will be flipped in: unknown
Tracking issue: #6516

Currently, cc rules access the cc_toolchain by a combination of the --crosstool_top, --cpu, and --compiler flags. This system is complex, lacks flexibility, and will be removed in favor of using the toolchain resolution system added to Bazel.

When this flag is enabled, the legacy system for accessing the cc toolchain will be disabled, and the cc rules will instead use the toolchain resolution system. Eventually, the legacy code will be removed.

Migration notes:
For the typical use case, where a user is not using any of --crosstool_top, --cpu, or --compiler, no changes should be needed.

For users who are using --crosstool_top to define custom cc_toolchain targets, it will be necessary to add the corresponding toolchain targets, and to register those toolchains.

For users who are cross-compiling by using --cpu, it will be necessary to add appropriate platform targets and to use the --platforms flag to ensure targets are built correctly. Until the --cpuflag can be fully deprecated or a migration path can be in place, it will be necessary to set both --cpu and --platforms.

@katre katre changed the title incompatible_enable_cc_toolchain_resolution incompatible_enable_cc_toolchain_resolution: Turn on toolchain resolution for cc rules Jan 25, 2019

@katre katre self-assigned this Jan 25, 2019

@katre

This comment has been minimized.

Copy link
Member Author

katre commented Jan 25, 2019

Note that this flag will supercede and replace the previous --enabled_toolchain_types flag, which was introduced before the incompatible change policy was formulated, and which was only ever used for the cc rules, anyway.

@katre

This comment has been minimized.

Copy link
Member Author

katre commented Jan 25, 2019

People who are interested: @hlopko, @lberki, @nlopezgi.

@hlopko hlopko added the bazel 1.0 label Jan 25, 2019

bazel-io pushed a commit that referenced this issue Jan 28, 2019

Add incompatible flag to enable cc rules to use toolchain resolution.
New flag: --incompatible_enable_cc_toolchain_resolution

This deprecates and replaces the previous flag, --enabled_toolchain_types.

Part of #7260.

RELNOTES[INC]: Toolchain resolution for cc rules is now enabled via an
incompatible flag, --incompatible_enable_cc_toolchain_resolution. The previous
flag, --enabled_toolchain_types, is deprecated and will be removed.

PiperOrigin-RevId: 231277726

bazel-io pushed a commit that referenced this issue Jan 29, 2019

Expose the --incompatible_enable_cc_toolchain_resolution flag to Star…
…lark and

update find_cpp_toolchain to use it.

Part of #7260.

PiperOrigin-RevId: 231400764
@gregestren

This comment has been minimized.

Copy link
Contributor

gregestren commented Jan 29, 2019

Will native transitions like

splitOptions.get(BuildConfiguration.Options.class).cpu = androidOptions.cpu;
also need attention?

@katre

This comment has been minimized.

Copy link
Member Author

katre commented Jan 29, 2019

Yes, @aragos and I have been discussing a plan. We will probably not be able to flip this flag until we have a solution, so I am removing the "Will be flipped in" tag.

@katre katre removed the migration-0.23 label Jan 30, 2019

weixiao-huang added a commit to weixiao-huang/bazel that referenced this issue Jan 31, 2019

Add incompatible flag to enable cc rules to use toolchain resolution.
New flag: --incompatible_enable_cc_toolchain_resolution

This deprecates and replaces the previous flag, --enabled_toolchain_types.

Part of bazelbuild#7260.

RELNOTES[INC]: Toolchain resolution for cc rules is now enabled via an
incompatible flag, --incompatible_enable_cc_toolchain_resolution. The previous
flag, --enabled_toolchain_types, is deprecated and will be removed.

PiperOrigin-RevId: 231277726

weixiao-huang added a commit to weixiao-huang/bazel that referenced this issue Jan 31, 2019

Expose the --incompatible_enable_cc_toolchain_resolution flag to Star…
…lark and

update find_cpp_toolchain to use it.

Part of bazelbuild#7260.

PiperOrigin-RevId: 231400764
@dslomov

This comment has been minimized.

Copy link
Contributor

dslomov commented Feb 15, 2019

Please do not assign issues to more than one team

@dslomov dslomov removed the team-Rules-CPP label Feb 15, 2019

bazel-io pushed a commit that referenced this issue Mar 13, 2019

Add toolchains attribute to compiler_flag
This is needed to build Bazel when --incompatible_enable_cc_toolchain_resolution is set.

#6516
#7260

RELNOTES: None.
PiperOrigin-RevId: 238209238

bazel-io pushed a commit that referenced this issue Mar 14, 2019

Add Bazel bootstrap test for C++ rules using platforms
#6516
#7260.

RELNOTES: None.
PiperOrigin-RevId: 238409948
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.