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_use_specific_tool_files: Use appropriate artifacts from cc_toolchain as inputs to C++ actions. #8531

Closed
scentini opened this issue May 31, 2019 · 4 comments

Comments

@scentini
Copy link
Contributor

@scentini scentini commented May 31, 2019

cc_toolchain has attributes corresponding to various toolchain components like ar_files, compiler_files, and as_files. Previously, Bazel used broad file groups like all_files as inputs for several classes of actions and ignored the more specific toolchain attributes. --incompatible_use_specific_tool_files brings these attributes into use.

Namely, under this flag:

  • C and C++ compilation actions use compiler_files rather than all_files.
  • Static library-generating actions use ar_files rather than linker_files.
  • Non-processed assembler actions use as_files rather than all_files. Preprocessed assembly actions use compiler_files because preprocessing is usually done by the C compiler.

Relevant issues: #6927, #6928.

Migration

For every cc_toolchain rule, ensure

  • compiler_files contains the compiler binary and standard library header files if necessary
  • as_files includes the assembler (e.g., gas)
  • ar_files includes the static archive tool (e.g., ar)

Expected timeline

Disabled by default in 0.27.
Enabled in the September 2019 release.

@scentini

This comment has been minimized.

Copy link
Contributor Author

@scentini scentini commented May 31, 2019

@benjaminp Can you please update this issue with migration details?

bazel-io pushed a commit that referenced this issue May 31, 2019
This option makes
1. C++ compilation actions include only the toolchain's compiler_files artifacts as inputs not all_files.
2. Non-preprocessed assembler actions include only the toolchain's as_files artifacts as inputs not all_files.
3. Archiver link actions include the toolchain's ar_files artifacts as inputs rather than linker_files.

See #8531.

Closes #7725.

PiperOrigin-RevId: 250880419
@benjaminp

This comment has been minimized.

Copy link
Collaborator

@benjaminp benjaminp commented May 31, 2019

(I lack permissions to edit the actual issue, but here we go.)

cc_toolchain has attributes corresponding to various toolchain components like ar_files, compiler_files, and as_files. Previously, Bazel used broad file groups like all_files as inputs for several classes of actions and ignored the more specific toolchain attributes. --incompatible_use_specific_tool_files brings these attributes into use.

Namely, under this flag:

  • C and C++ compilation actions use compiler_files rather than all_files.
  • Static library-generating actions use ar_files rather than linker_files.
  • Non-processed assembler actions use as_files rather than all_files. Preprocessed assembly actions use compiler_files because preprocessing is usually done by the C compiler.

Migration

For every cc_toolchain rule, ensure

  • compiler_files contains the compiler binary and standard library header files if necessary
  • as_files includes the assembler (e.g., gas)
  • ar_files includes the static archive tool (e.g., ar)

Expected timeline

Disabled by default in 0.27.
Enabled in the September 2019 release.

@kkiningh

This comment has been minimized.

Copy link

@kkiningh kkiningh commented Jun 2, 2019

With this flag enabled I get the following error on OSX 10.14.2 when I try to compile a cc_library.

src/main/tools/process-wrapper-legacy.cc:58: "execvp(external/local_config_cc/wrapped_ar, ...)": No such file or directory

Simple example here.

benjaminp added a commit to benjaminp/bazel that referenced this issue Jun 3, 2019
bazel-io pushed a commit that referenced this issue Jun 4, 2019
Work on #8531.

Closes #8544.

PiperOrigin-RevId: 251428636
bazel-io pushed a commit that referenced this issue Jun 6, 2019
…ains where needed.

#8531

RELNOTES: None.
PiperOrigin-RevId: 251796866
irengrig added a commit to irengrig/bazel that referenced this issue Jun 18, 2019
This option makes
1. C++ compilation actions include only the toolchain's compiler_files artifacts as inputs not all_files.
2. Non-preprocessed assembler actions include only the toolchain's as_files artifacts as inputs not all_files.
3. Archiver link actions include the toolchain's ar_files artifacts as inputs rather than linker_files.

See bazelbuild#8531.

Closes bazelbuild#7725.

PiperOrigin-RevId: 250880419
irengrig added a commit to irengrig/bazel that referenced this issue Jun 18, 2019
irengrig added a commit to irengrig/bazel that referenced this issue Jun 18, 2019
…ains where needed.

bazelbuild#8531

RELNOTES: None.
PiperOrigin-RevId: 251796866
irengrig added a commit to irengrig/bazel that referenced this issue Jul 15, 2019
This option makes
1. C++ compilation actions include only the toolchain's compiler_files artifacts as inputs not all_files.
2. Non-preprocessed assembler actions include only the toolchain's as_files artifacts as inputs not all_files.
3. Archiver link actions include the toolchain's ar_files artifacts as inputs rather than linker_files.

See bazelbuild#8531.

Closes bazelbuild#7725.

PiperOrigin-RevId: 250880419
irengrig added a commit to irengrig/bazel that referenced this issue Jul 15, 2019
irengrig added a commit to irengrig/bazel that referenced this issue Jul 15, 2019
…ains where needed.

bazelbuild#8531

RELNOTES: None.
PiperOrigin-RevId: 251796866
@katre katre added the migration-0.29 label Aug 2, 2019
benjaminp added a commit to benjaminp/bazel that referenced this issue Aug 8, 2019
benjaminp added a commit to benjaminp/bazel that referenced this issue Aug 8, 2019
benjaminp added a commit to benjaminp/bazel that referenced this issue Aug 8, 2019
bazel-io pushed a commit that referenced this issue Aug 13, 2019
See #8531.

Closes #9126.

RELNOTES: The --incompatible_use_specific_tool_files flag has been flipped. See #9126 for more information.
PiperOrigin-RevId: 263120622
@scentini scentini closed this Aug 16, 2019
@luxe

This comment has been minimized.

Copy link

@luxe luxe commented Oct 13, 2019

I'm confused why this is enabled now, but the master docs still say ar_files is currently unused (#6928).
https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library

philsc added a commit to philsc/ttyrex that referenced this issue Oct 16, 2019
Looks like bazelbuild/bazel#8531 was the
only thing that affected me this time around.
rohansingh added a commit to tidbyt/toolchains that referenced this issue Oct 31, 2019
Bazel 1.0 flips [`--incompatible_use_specific_tool_files`][1]. We now need to
specify all compilation dependencies in `compiler_files`.

[1]: bazelbuild/bazel#8531
oopsmonk added a commit to iotaledger/toolchains that referenced this issue Nov 1, 2019
Bazel 1.0 flips [`--incompatible_use_specific_tool_files`][1]. We now need to
specify all compilation dependencies in `compiler_files`.

[1]: bazelbuild/bazel#8531
tensorflow-copybara pushed a commit to tensorflow/tensorflow that referenced this issue Nov 12, 2019
This will fix Cuda and ROCm RBE build with Bazel 1.0

Related bazelbuild/bazel#8531

Preconfigured toolchains are updated by:

tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0

tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3-gcc7_manylinux2010-cuda10.0-cudnn7-tensorrt5.1

tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3_opt-gcc5-rocm

PiperOrigin-RevId: 279942421
Change-Id: Ic8538d49b970b074e35acebc1345482170d98847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.