|
3 | 3 | load("//nodejs/private:node_versions.bzl", "NODE_VERSIONS") |
4 | 4 | load("//nodejs/private:nodejs_repo_host_os_alias.bzl", "nodejs_repo_host_os_alias") |
5 | 5 | load("//nodejs/private:nodejs_toolchains_repo.bzl", "PLATFORMS", "nodejs_toolchains_repo") |
6 | | -load("//nodejs/private:os_name.bzl", "assert_node_exists_for_host", "node_exists_for_os") |
7 | 6 |
|
8 | 7 | # Default base name for node toolchain repositories |
9 | 8 | # created by the module extension |
@@ -85,19 +84,17 @@ def _download_node(repository_ctx): |
85 | 84 | if not node_repositories.items(): |
86 | 85 | node_repositories = NODE_VERSIONS |
87 | 86 |
|
88 | | - # Skip the download if we know it will fail |
89 | | - if not node_exists_for_os(node_version, host_os, node_repositories): |
90 | | - return |
91 | | - |
92 | 87 | node_urls = repository_ctx.attr.node_urls[:] |
93 | 88 | if not node_urls: |
94 | 89 | # Go back the default if the user explicitly specifies [] |
95 | 90 | node_urls = [DEFAULT_NODE_URL] |
96 | 91 |
|
97 | | - # Download node & npm |
98 | 92 | version_host_os = "%s-%s" % (node_version, host_os) |
99 | | - if not version_host_os in node_repositories: |
100 | | - fail("Unknown Node.js version-host %s" % version_host_os) |
| 93 | + if version_host_os not in node_repositories.keys(): |
| 94 | + fail("No nodejs is available for {} at version {}".format(host_os, node_version) + |
| 95 | + "\n Consider upgrading by setting node_version in a call to node_repositories in WORKSPACE." + |
| 96 | + "\n Note that Node 16.x is the minimum published for Apple Silicon (M1 Macs), and 20.x is the minimum for Windows ARM64.") |
| 97 | + |
101 | 98 | filename, strip_prefix, sha256 = node_repositories[version_host_os] |
102 | 99 |
|
103 | 100 | urls = [url.format(version = node_version, filename = filename) for url in node_urls] |
@@ -311,7 +308,6 @@ def _verify_version_is_valid(version): |
311 | 308 | fail("Invalid node version: %s" % version) |
312 | 309 |
|
313 | 310 | def _nodejs_repositories_impl(repository_ctx): |
314 | | - assert_node_exists_for_host(repository_ctx) |
315 | 311 | _download_node(repository_ctx) |
316 | 312 | _prepare_node(repository_ctx) |
317 | 313 |
|
|
0 commit comments