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

swc() rule breaks copying files after first build #32

Closed
mdittmer opened this issue May 4, 2022 · 2 comments
Closed

swc() rule breaks copying files after first build #32

mdittmer opened this issue May 4, 2022 · 2 comments

Comments

@mdittmer
Copy link
Contributor

mdittmer commented May 4, 2022

Issue description in commit message here: mdittmer/bazel-sandbox@03b685b (commit contains code to reproduce issue).

This issue was observed running bazel on mac with rules_swc-0.5.1.

Description copied here for convenience:

swc() rule that compiles transitive dependencies succeeds on first build, but fails on second build while copying files.

$ cd js && npm install && bazel clean --expunge && bazel build //:swc && bazel build //:swc
npm WARN bazel-swc-test@0.0.1 No description
npm WARN bazel-swc-test@0.0.1 No repository field.

added 14 packages from 66 contributors and audited 14 packages in 1.092s
found 0 vulnerabilities

INFO: Starting clean.
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:swc (68 packages loaded, 403 targets configured).
INFO: Found 1 target...
Target //:swc up-to-date:
  bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.js
INFO: Elapsed time: 10.869s, Critical Path: 0.83s
INFO: 60 processes: 33 internal, 1 darwin-sandbox, 26 local.
INFO: Build completed successfully, 60 total actions
INFO: Analyzed target //:swc (1 packages loaded, 25 targets configured).
INFO: Found 1 target...
ERROR: /path/to/bazel-sandbox/js/BUILD.bazel:3:4: Copying file bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.ts failed: (Exit 1): bash failed: error executing command /bin/bash -c 'cp -f "$1" "$2"' '' bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.ts bazel-out/darwin-fastbuild/bin/bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.ts
cp: bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.ts: No such file or directory
Target //:swc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.758s, Critical Path: 0.27s
INFO: 8 processes: 6 internal, 2 local.
FAILED: Build did NOT complete successfully
@alexeagle
Copy link
Member

Copying file bazel-bin/node_modules/aws-sdk/scripts/services-table-generator.ts is the clue here. Your glob to gather .ts inputs is descending into the bazel output folder. You should probably add bazel-bin/node_modules/ to .bazelignore.

@alexeagle
Copy link
Member

Please reply if there's still a bug here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants