aspect-build / aspect-build/rules_js

Help users with duplicate copy_to_bin actions

Open
#409 3 comments 2 reactions 0 assignees View on GitHub
enhancement need: investigation
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 11h
Merged PRs (30d)
29

Description

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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the conflicting CopyFile actions from the js_test and copy_to_bin_action scenario described in the issue, using the linked GitHub Actions run for context. Trace how differing execution requirements produce the duplicate-action error and determine what user-facing behavior should improve. Done means the duplicate case is handled or explained more clearly, with coverage for this scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.