aspect-build / aspect-build/rules_js

[Bug]: Js_run_binary copy srcs to bin fails on 'hidden' files on Windows

Open
#1,055 9 comments 0 reactions 1 assignee Claimed by @jbedard View on GitHub
bug need: funding windows
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

Porting some `rules_nodejs` builds to `rules_js`, have a source file starting with a dot (`.eleventy.js`) featuring as input to the `srcs` attribute of a `js_run_binary` rule with `copy_srcs_to_bin = True`.

Falls over with **The system cannot find the file specified.**

I see the rule generates cmd files wrapping calls to dos `copy`, which apparently does not copy hidden files (need to use xcopy for that, it seems).

Luckily the file name was not significant for us and renaming it to e.g. `coco.eleventy.js` fixed the issue.

### Version

Development (host) and target OS/architectures:
Windows 10 Pro 21H2
Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz 2.30 GHz (2 processors)

Output of `bazel --version`:

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
https://github.com/aspect-build/rules_js/archive/002397780d51735f1a98b362fca7018df31e85ac.tar.gz
(Need the commit because fix for newer pnpm-lock.yaml syntax not yet in a release)

Language(s) and/or frameworks involved:
bazel 7.0.0-pre.20230316.2

### How to reproduce

```shell
Create a trivial `js_run_binary` target with a source file starting with a period and copy_srcs_to_bin = True, and try to build the target on windows.
```

### Any other information?

_No response_

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.