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 starts failing in RBE after v0.5.1 #38

Closed
danigar opened this issue Jun 2, 2022 · 5 comments
Closed

swc starts failing in RBE after v0.5.1 #38

danigar opened this issue Jun 2, 2022 · 5 comments
Assignees

Comments

@danigar
Copy link

danigar commented Jun 2, 2022

Building typescript srcs using ts_project rule with swc transpiler fails in RBE mode since swc version 0.5.1 (also tested with the latest release v0.7.0). Local sandbox execution is successfull.

Prior to v0.5.0, swc RBE transpilation worked just fine with the same config.

The output stack trace of the error is:

Error: Cannot find module 'slash'
Require stack:
- /var/lib/../exec/bazel-out/exec/bin/external/aspect_rules_swc/swc/node_modules/@swc/cli/lib/swc/dir.js

It looks like in RBE mode executors cannot resolve npm dependencies required by swc cli.
I've checked that slash package can be found in /var/lib/../exec/bazel-out/exec-EAxs2/bin/external/aspect_rules_swc/swc/node_modules/.aspect_rules_js.

Repro

I've created a test case repository to show all the config that makes it fail.

https://github.com/danigar/bazel-swc-lab

@danigar danigar changed the title swc start failing with rbe after v0.5.1 swc starts failing with rbe after v0.5.1 Jun 2, 2022
@danigar danigar changed the title swc starts failing with rbe after v0.5.1 swc starts failing in RBE after v0.5.1 Jun 2, 2022
@alexeagle
Copy link
Member

I think this is another case of bazelbuild/bazel#10298
rules_js switched to pnpm under the hood, and it relies on symlinks into an npm package virtual store.

@alexeagle
Copy link
Member

For SWC specifically the best fix is to simply stop depending on the node.js @swc/cli package, and thus rules_js. We only need the pure-rust CLI.

So #57 could fix this.

@alexeagle
Copy link
Member

#57 still seems hard, there are some missing things in the rust CLI.

Separately, the fix for RBE in rules_js is making progress today :)

@alexeagle
Copy link
Member

update: latest rules_js release has RBE support. I'm still working on #57

@alexeagle
Copy link
Member

With the latest rules_js and USE_BAZEL_VERSION of last_green, this should be fixed since rules_js works with RBE now.

#57 would still be nice, but no longer a blocker.

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

3 participants