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

fix: remove trailing forward slash when resolving workspace root link in runfiles MANIFEST #3093

Conversation

gregmagolan
Copy link
Collaborator

This regressed at some point between 3.3 and 4.4 releases.

The problem appears specific to binary targets (not build targets) that resolve from the MANIFEST.

Repro here: https://github.com/ssilve1989/bazel-playground on bug/link_workspace_root branch

❯ bazelisk run //packages/examples/node/helloworld
INFO: Invocation ID: a0fce2a3-518b-438c-a490-7614f1680c76
INFO: Analyzed target //packages/examples/node/helloworld:helloworld (1 packages loaded, 4 targets configured).
INFO: Found 1 target...
Target //packages/examples/node/helloworld:helloworld up-to-date:
  dist/bin/packages/examples/node/helloworld/helloworld.sh
  dist/bin/packages/examples/node/helloworld/helloworld_loader.js
  dist/bin/packages/examples/node/helloworld/helloworld_require_patch.js
INFO: Elapsed time: 3.259s, Critical Path: 2.96s
INFO: 5 processes: 1 internal, 4 darwin-sandbox.
INFO: Build completed successfully, 5 total actions
INFO: Build completed successfully, 5 total actions
Error: Cannot find module 'playground/packages/common/math/math'
Require stack:
- /private/var/tmp/_bazel_SSilvestri/0b924cd44f9ad5151fc11486fa79c02d/execroot/playground/bazel-out/darwin-fastbuild/bin/packages/examples/node/helloworld/helloworld.sh.runfiles/playground/packages/examples/node/helloworld/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (packages/examples/node/helloworld/main.js:3:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

@google-cla google-cla bot added the cla: yes label Nov 22, 2021
@gregmagolan gregmagolan changed the title fix: remove trailing forward slash when resolving workspace path in runfiles MANIFEST fix: remove trailing forward slash when resolving workspace root link in runfiles MANIFEST Nov 22, 2021
@gregmagolan gregmagolan force-pushed the fix_workspace_root_link_in_runfiles branch from 65b3da3 to f743551 Compare November 22, 2021 17:21
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