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

cc_library with subpackage fails with duplicate action error #14237

Closed
thhous-msft opened this issue Nov 5, 2021 · 4 comments
Closed

cc_library with subpackage fails with duplicate action error #14237

thhous-msft opened this issue Nov 5, 2021 · 4 comments
Labels
area-Windows Windows-specific issues and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-CPP Issues for C++ rules type: bug

Comments

@thhous-msft
Copy link

thhous-msft commented Nov 5, 2021

Description of the problem :

When creating a cc_library target with a subpackage (I think thats the right name for it, I'm not sure), a conflicting actions error occurs.

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

Use the following BUILD.bazel contents (lib.cc is just void func() {} and main.cc is just int main() {}

cc_library(
    name = "sub/mylib",
    srcs = [ "lib.cc" ]
)

cc_binary(
    name = "sub/myexe",
    srcs = [ "main.cc" ]
)

And build the target :sub/mylib. This will result in the following output.

C:\Users\Thad\Documents\bztest>bazel build :sub/mylib
ERROR: file 'sub/libmylib.a' is generated by these conflicting actions:
Label: //:sub/mylib
RuleClass: cc_library rule
Configuration: 3760312c3f985e91b4e995aa2f6d771a8963101f8157a8d259773188e8ab6b59
Mnemonic: Fail
Action key: ca06770c0ba6cbf0a626f7fd9363cd7fe8afc743bf2396949210a2707d52b4b5, 8f7e22df52c69ee015d4103f114da3459e32d366db52add76768eeb4d9f2e4d1
Progress message: Reporting failed target //:sub/mylib located at C:/users/thad/documents/bztest/BUILD.bazel:1:11
PrimaryInput: (null)
PrimaryOutput: File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]sub/libmylib.a
Owner information: ConfiguredTargetKey{label=//:sub/mylib, config=BuildConfigurationValue.Key[3760312c3f985e91b4e995aa2f6d771a8963101f8157a8d259773188e8ab6b59]}
MandatoryInputs: are equal
Outputs: are equal
ERROR: Analysis of target '//:sub/mylib' failed; build aborted: for sub/libmylib.a, previous action: action 'Reporting failed target //:sub/mylib located at C:/users/thad/documents/bztest/BUILD.bazel:1:11', attempted action: action 'Reporting failed target //:sub/mylib located at C:/users/thad/documents/bztest/BUILD.bazel:1:11'
INFO: Elapsed time: 0.097s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 1 target configured)

However, if you attempt to build :sub/myexe that builds fine. So its a bug specific to cc_library.

What operating system are you running Bazel on?

Windows 11

What's the output of bazel info release?

> bazel info release
release 4.2.1

Have you found anything relevant by searching the web?

The error looks similar to this, but its not the exact same.
#13464

@thhous-msft
Copy link
Author

Doing some testing on Linux, this bug does not occur there. It looks to be a windows exclusive bug.

@gregestren gregestren added area-Windows Windows-specific issues and feature requests team-Rules-CPP Issues for C++ rules type: bug untriaged labels Nov 18, 2021
@wrowe
Copy link
Contributor

wrowe commented Dec 18, 2021

Ping, this appears to be a blocker to porting wasm support on Windows

@oquenchil oquenchil added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Feb 14, 2022
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 13, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

4 participants