Skip to content

Reproduce file system issue with prototype of symlinking user node_modules - #708

Closed
gregmagolan wants to merge 4 commits into
bazel-contrib:masterfrom
gregmagolan:user-node-modules-proto-repro
Closed

gregmagolan wants to merge 4 commits into
bazel-contrib:masterfrom
gregmagolan:user-node-modules-proto-repro

Conversation

@gregmagolan

Copy link
Copy Markdown
Collaborator

No description provided.

@gregmagolan

gregmagolan commented Apr 20, 2019 •

Copy link
Copy Markdown
Collaborator Author

Ok. I finally figured out what changed on master to fix the original issue that was causing the filesystem errors!

ERROR: /home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/external/fine_grained_deps_npm/node_modules/ajv/BUILD.bazel:213:9: unterminated string literal at eof
ERROR: /home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/external/fine_grained_deps_npm/node_modules/ajv/BUILD.bazel:213:22: syntax error at 'newline': expected ]
ERROR: /home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/external/fine_grained_deps_npm/node_modules/ajv/BUILD.bazel:174:12: Traceback (most recent call last):
	File "/home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/external/fine_grained_deps_npm/node_modules/ajv/BUILD.bazel", line 172
		filegroup(name = "ajv__files", srcs = $error...)
	File "/home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/external/fine_grained_deps_npm/node_modules/ajv/BUILD.bazel", line 174, in filegroup
		$error$

The problem was that there were two separate yarn_install rules targeting the same node_modules folder so one was reading the BUILD files while the other was writing to them. The fixing commit was here 61e35d3

I guess the fix for this is to put read the BUILD that is already there and see if it is a generated one. If it is then error out!

@gregmagolan

Copy link
Copy Markdown
Collaborator Author

Transitive npm deps #675 also fixed this issue which popped up after using user node_modules:

ERROR: /home/circleci/rules_nodejs/internal/e2e/rollup_fine_grained_deps/BUILD.bazel:25:1: SkylarkAction internal/e2e/rollup_fine_grained_deps/bundle_legacy.es2015.js failed (Exit 1) rollup failed: error executing command bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup --config bazel-out/k8-fastbuild/bin/internal/e2e/rollup_fine_grained_deps/_bundle_legacy.rollup.conf.js --output.file ... (remaining 5 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
[!] (commonjs plugin) Error: Could not resolve import '@gregmagolan/test-a' from '/home/circleci/rules_nodejs/internal/e2e/fine_grained_deps/yarn/node_modules/@gregmagolan/test-b/main.js'
Error: Could not resolve import '@gregmagolan/test-a' from '/home/circleci/rules_nodejs/internal/e2e/fine_grained_deps/yarn/node_modules/@gregmagolan/test-b/main.js'
    at Object.notResolved (/home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/execroot/build_bazel_rules_nodejs/bazel-out/k8-fastbuild/bin/internal/e2e/rollup_fine_grained_deps/_bundle_legacy.rollup.conf.js:157:11)
    at /home/circleci/.cache/bazel/_bazel_circleci/02fc451c9ce3986cffaddce25971cb5b/sandbox/processwrapper-sandbox/14/execroot/build_bazel_rules_nodejs/bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup.runfiles/build_bazel_rules_nodejs_rollup_deps/node_modules/rollup-plugin-commonjs/src/utils.js:20:68

@gregmagolan

Copy link
Copy Markdown
Collaborator Author

Case closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants