rules_js
rules_js copied to clipboard
Help users with duplicate copy_to_bin actions
I put a tags=["requires-network"]
on a js_test. Turns out the entry_point
is a source file, so it gets copy_to_bin_action, but another test in that package had the same entry_point, and that had different execution requirements on the copy_to_bin_action and so it wasn't a duplicate action.
ERROR: file 'examples/assert_lockfile_up_to_date/assert_lockfile_frozen.js' is generated by these conflicting actions:
Label: //examples/assert_lockfile_up_to_date:assert_lockfile_up_to_date, //examples/assert_lockfile_up_to_date:test_assert_lockfile_frozen
RuleClass: js_test rule
JavaActionClass: class com.google.devtools.build.lib.analysis.actions.StarlarkAction
Configuration: 9b98c2a2ed7d895125af734cac738ce6fd8c719695b5566e18e52ac6ceac7305
Mnemonic: CopyFile
Action key: f13f5d40da652d1e43b2a5ce04bd29dbd86f8c12fb0b06a2a68a8eae5e6582ad, 2c4a5724e11485369c8673b5958a59e3c6b57185f6d8683f85c4ec336f2ea5eb
Progress message: Copying file examples/assert_lockfile_up_to_date/assert_lockfile_frozen.js
Action describeKey: Copying file examples/assert_lockfile_up_to_date/assert_lockfile_frozen.js
Environment variable: PATH=/bin:/usr/bin:/usr/local/bin
Argument: /bin/bash
Argument: -c
Argument: 'cp -f "$1" "$2"'
Argument: ''
Argument: examples/assert_lockfile_up_to_date/assert_lockfile_frozen.js
Argument: bazel-out/k8-fastbuild/bin/examples/assert_lockfile_up_to_date/assert_lockfile_frozen.js
seems pretty subtle and I don't know immediately what we could do to make it better.
Context: https://github.com/aspect-build/rules_js/runs/7985083768
Is there any current guidance for getting around this issue? I'm currently running into this as well.
I am also rubbing up against this. Unfortunately rules_js
essentially demands that the source tree be structured a certain way, so you cannot solve this by trying to move one of the conflicting targets to a separate directory.