aspect-build / aspect-build/rules_js

[Bug]: Cannot specify files from external repositories in `srcs` attribute of `js_run_binary`

Open
#2,583 1 comment 0 reactions 1 assignee Claimed by @jbedard View on GitHub
bug
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

When trying to specify files from external repositories in the `srcs` attribute of `js_run_binary`, e.g.

```starlark
js_run_binary(
name = "target",
srcs = ["@file//file"],
outs = ["out.txt"],
tool = ":bin",
)
```
the build will error out with the following message:
```
Cannot use copy_to_bin to copy downloaded from the external repository .
Files can only be copied from the source tree to their short path equivalent in the output tree.
```

It looks like both `js_binary` and `js_library` support passing files from external repositories through the `no_copy_to_bin` attribute, but `js_run_binary` doesn't have `no_copy_to_bin` as a parameter. `js_run_binary` does have the `copy_srcs_to_bin` parameter available, but this isn't compatible with our use case.

Patching `rules_js` with [this diff](https://github.com/withered-magic/rules_js/commit/3de6815ff3ceae6f1ae500cb175cfd8488116e71) seems to function as a workaround for now, but was unsure if this was the ideal implementation for this feature ...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.