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

### What happened? #254

Open
jakkal6 opened this issue Nov 24, 2024 · 1 comment
Open

### What happened? #254

jakkal6 opened this issue Nov 24, 2024 · 1 comment

Comments

@jakkal6
Copy link

jakkal6 commented Nov 24, 2024

What happened?

Suppose you want to use bazel fetch to prefetch repositories for the node toolchain.

With this WORKSPACE (verbatim from https://github.com/aspect-build/rules_js/releases/tag/v1.6.9):

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_rules_js",
    sha256 = "dda5fee3926e62c483660b35b25d1577d23f88f11a2775e3555b57289f4edb12",
    strip_prefix = "rules_js-1.6.9",
    url = "https://github.com/aspect-build/rules_js/archive/refs/tags/v1.6.9.tar.gz",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

nodejs_register_toolchains(
    name = "nodejs",
    node_version = DEFAULT_NODE_VERSION,
)

Run bazel fetch @nodejs_host//....

Expected result: the command succeeds.
Actual result: the command fails with this error:

➜  rules_nodejs_bug bazel fetch @nodejs_host//...
ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:4:6: no such target '@nodejs_darwin_arm64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.sh.template'
ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:5:6: no such target '@nodejs_darwin_arm64//:run_npm.bat.template': target 'run_npm.bat.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.bat.template'
ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:4:6: no such target '@nodejs_darwin_arm64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.sh.template'
ERROR: Evaluation of query "deps(@nodejs_host//...)" failed: errors were encountered while computing transitive closure
Loading: 2 packages loaded

Version

Development (host) and target OS/architectures:

Output of bazel --version:

Version of rules_nodejs, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:

How to reproduce

No response

Any other information?

No response

Originally posted by @jfirebaugh in bazel-contrib/rules_nodejs#3599

@jakkal6
Copy link
Author

jakkal6 commented Nov 24, 2024

What happened?

Suppose you want to use bazel fetch to prefetch repositories for the node toolchain.

With this WORKSPACE (verbatim from https://github.com/aspect-build/rules_js/releases/tag/v1.6.9):


load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")



http_archive(

    name = "aspect_rules_js",

    sha256 = "dda5fee3926e62c483660b35b25d1577d23f88f11a2775e3555b57289f4edb12",

    strip_prefix = "rules_js-1.6.9",

    url = "https://github.com/aspect-build/rules_js/archive/refs/tags/v1.6.9.tar.gz",

)



load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")



rules_js_dependencies()



load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")



nodejs_register_toolchains(

    name = "nodejs",

    node_version = DEFAULT_NODE_VERSION,

)

Run bazel fetch @nodejs_host//....

Expected result: the command succeeds.

Actual result: the command fails with this error:


➜  rules_nodejs_bug bazel fetch @nodejs_host//...

ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:4:6: no such target '@nodejs_darwin_arm64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.sh.template'

ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:5:6: no such target '@nodejs_darwin_arm64//:run_npm.bat.template': target 'run_npm.bat.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.bat.template'

ERROR: /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_host/BUILD.bazel:4:6: no such target '@nodejs_darwin_arm64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' (did you mean 'run_npm.template'?) defined by /private/var/tmp/_bazel_john/442663b197eb6942a605345c9a9c84f6/external/nodejs_darwin_arm64/BUILD.bazel and referenced by '@nodejs_host//:run_npm.sh.template'

ERROR: Evaluation of query "deps(@nodejs_host//...)" failed: errors were encountered while computing transitive closure

Loading: 2 packages loaded

Version

Development (host) and target OS/architectures:

Output of bazel --version:

Version of rules_nodejs, or other relevant rules from your

WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:

How to reproduce

No response

Any other information?

No response

Originally posted by @jfirebaugh in bazel-contrib/rules_nodejs#3599

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

1 participant