Skip to content

Conflicting actions when using --host_action_env #12403

@martinxsliu

Description

@martinxsliu

Description of the problem / feature request:

When using the newly added --host_action_env flag, the analysis phase fails with lots of file X is generated by these conflicting actions type errors.

Example error log:

ERROR: file 'external/local_config_cc/watchos_i386.runfiles/MANIFEST' is generated by these conflicting actions:
Label: @local_config_cc//:watchos_i386
RuleClass: cc_toolchain_config rule
Configuration: cafef9f8b89de695d623b93423eb2b4d32ac34d4f9b36496f8139f880d1f4901, 9177372694e283f2d9a7ff337e520a3c2f33deeddac5d93aa911522a084518e2
Mnemonic: SymlinkTree
Action key: b5ecb575df0ad57da108b32678bdc98502e8f791db66d410fbe929282f7722a7, e1b483e3ef545df17ef13fe03742f0be50941c7e2835dc3560ae5b4c8878fe15
Progress message: Creating runfiles tree bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/local_config_cc/watchos_i386.runfiles
PrimaryInput: File:[[<execution_root>]bazel-out/darwin-opt-exec-2B5CBBC6/bin]external/local_config_cc/watchos_i386.runfiles_manifest
PrimaryOutput: File:[[<execution_root>]bazel-out/darwin-opt-exec-2B5CBBC6/bin]external/local_config_cc/watchos_i386.runfiles/MANIFEST
Owner information: ConfiguredTargetKey{label=@local_config_cc//:watchos_i386, config=BuildConfigurationValue.Key[cafef9f8b89de695d623b93423eb2b4d32ac34d4f9b36496f8139f880d1f4901]}, ConfiguredTargetKey{label=@local_config_cc//:watchos_i386, config=BuildConfigurationValue.Key[9177372694e283f2d9a7ff337e520a3c2f33deeddac5d93aa911522a084518e2]}
MandatoryInputs: are equal
Outputs: are equal
WARNING: errors encountered while analyzing target '@local_config_cc//:watchos_i386': it will not be built

Most failures are for local_config_cc, but there are also 2 for the protobuf library. They are not directly related to the targets I'm trying to build.

ERROR: file 'external/local_config_cc/watchos_armv7k.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/com_google_protobuf/compiler_plugin_proto-descriptor-set.proto.bin' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/ios_arm64e.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/watchos_i386.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/ios_i386.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/ios_arm64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/tvos_arm64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/tvos_x86_64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/stub_armeabi-v7a.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/darwin_arm64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/ios_x86_64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/watchos_arm64_32.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/darwin_x86_64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/darwin_arm64e.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/ios_armv7.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/local_config_cc/watchos_x86_64.runfiles/MANIFEST' is generated by these conflicting actions:
ERROR: file 'external/com_google_protobuf/descriptor_proto-descriptor-set.proto.bin' is generated by these conflicting actions:

When I run bazel config on these 2 configurations (cafef9f and 9177372), the only difference between the 2 configs is for com.google.devtools.build.lib.analysis.config.CoreOptions.action_env where one config includes the env var and the other doesn't.

I also tried to run bazel cquery --host_action_env=FOO 'somepath(@com_google_protobuf//:descriptor_proto, //path/to/pkg)' but this fails for the same reason.

I'm not sure if I've missed something when upgrading Bazel to 3.7.0, if I'm misusing / misconfiguring something, or if there's an actual issue. Any help would be greatly appreciated!

Feature requests: what underlying problem are you trying to solve with this feature?

Build successfully without errors.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I've created a workspace that reproduces this error: https://github.com/martinxsliu/testgo.

Run make to see build errors.

What operating system are you running Bazel on?

macOS Catalina 10.15.7

What's the output of bazel info release?

release 3.7.0

Have you found anything relevant by searching the web?

Issue: #4008
PR to add the --host_action_env flag: #12122

Any other information, logs, or outputs that you want to share?

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionstype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions