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

vendored_yarn not defining dependency properly causing Bazel to not include the linked yarn in the external folder #2019

Closed
ceraetes opened this issue Jul 9, 2020 · 2 comments · Fixed by #2614
Labels

Comments

@ceraetes
Copy link

ceraetes commented Jul 9, 2020

🐞 bug report

Affected Rule

vendored_yarn inside node_repositories


node_repositories(
    node_version = "10.12.0",
    vendored_node = "@vendored_node_10_12_0//:node-v10.12.0-linux-x64",
    vendored_yarn = "@vendored_yarn_1_10_0//:yarn-v1.10.0",
)

Description

When trying to use a vendored version of yarn via vendored_yarn bazel doesn't include the specified folder inside the external folder of the output user root. We have tested both using a local_repository and the http_archive like the vendored_node_and_yarn example and both fail to include yarn which causes yarn commands to not work (eg: bazel run @nodejs//:yarn_node_repositories). Doing a bazel sync seems to force bazel to detect the dependency and fixes the issue, but it is not a great fix to ask every one using our repo to do it locally.

🔬 Minimal Reproduction

Using the basic workspace setup at https://github.com/ceraetes/rules_nodejs_vendored_yarn (modified version of the example to use self-managed dependencies) and trying to run bazel run @nodejs//:yarn_node_repositories will trigger the issue.

🔥 Exception or Error



Running yarn  in rules_nodejs_vendored_yarn
internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module 'bazel_output\wk6kt6hu\external\vendored_yarn_1_10_0\yarn-v1.10.0\bin\yarn.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

🌍 Your Environment

Operating System:

  
    Windows 10
  

Output of bazel version:

  
    Build label: 3.3.1
    Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
    Build time: Tue Jun 30 15:13:25 2020 (1593530005)
    Build timestamp: 1593530005
    Build timestamp as int: 1593530005
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
     2.0.0-rc.1
  

Anything else relevant?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

@github-actions github-actions bot added the Can Close? We will close this in 30 days if there is no further activity label Sep 22, 2020
@github-actions
Copy link

github-actions bot commented Oct 6, 2020

This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

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 a pull request may close this issue.

3 participants