From 581e8d1d2a5696db648cd5daa82bf560fc32e6bf Mon Sep 17 00:00:00 2001 From: Jordan Mele Date: Wed, 6 Dec 2023 17:50:28 +1100 Subject: [PATCH] Cleanup --- lib/private/extensions/nodejs.bzl | 2 -- .../repositories/nodejs_download/impl.bzl | 20 ++++++++++--------- .../repositories/nodejs_toolchains.bzl | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/private/extensions/nodejs.bzl b/lib/private/extensions/nodejs.bzl index 4b5cee1f..2b864a14 100644 --- a/lib/private/extensions/nodejs.bzl +++ b/lib/private/extensions/nodejs.bzl @@ -35,10 +35,8 @@ def _nodejs_impl(mctx): target_tool = "@%s_%s//:node_bin" % (attrs.name, platform["id"]), ) # Toolchain registrations without triggering eager downloading - # TODO Rename this to something more appropriate nodejs_toolchains( name = attrs.name, - node_version = attrs.node_version, ) nodejs_download( name = "%s_host" % attrs.name, diff --git a/lib/private/repositories/nodejs_download/impl.bzl b/lib/private/repositories/nodejs_download/impl.bzl index b7e7f781..746fc9dc 100644 --- a/lib/private/repositories/nodejs_download/impl.bzl +++ b/lib/private/repositories/nodejs_download/impl.bzl @@ -432,7 +432,11 @@ def _prepare_node(repository_ctx): package(default_visibility = ["//visibility:public"]) exports_files([ "run_npm.sh.template", - "run_npm.bat.template",{node_bin_export}{npm_bin_export}{npx_bin_export}{yarn_bin_export} + "run_npm.bat.template", + "{node_bin_export}", + "{npm_bin_export}", + "{npx_bin_export}", + "{yarn_bin_export}", "{node_entry}", "{npm_entry}", "{yarn_entry}", @@ -450,19 +454,17 @@ def _prepare_node(repository_ctx): ) filegroup( name = "yarn_files", - srcs = {yarn_files_glob}[":node_files"], + srcs = glob(["bin/yarnpkg/**"]) + [":node_files"], ) filegroup( name = "npm_files", - srcs = {npm_files_glob}[":node_files"], + srcs = glob(["bin/nodejs/**"]) + [":node_files"], ) """).format( - node_bin_export = ("\n \"%s\"," % node_bin), - npm_bin_export = ("\n \"%s\"," % npm_bin), - npx_bin_export = ("\n \"%s\"," % npx_bin), - npm_files_glob = "glob([\"bin/nodejs/**\"]) + ", - yarn_bin_export = ("\n \"%s\"," % yarn_bin), - yarn_files_glob = "glob([\"bin/yarnpkg/**\"]) + ", + node_bin_export = node_bin, + npm_bin_export = npm_bin, + npx_bin_export = npx_bin, + yarn_bin_export = yarn_bin, node_bin_label = node_bin_label, npm_bin_label = npm_bin_label, npx_bin_label = npx_bin_label, diff --git a/lib/private/repositories/nodejs_toolchains.bzl b/lib/private/repositories/nodejs_toolchains.bzl index 1a5af786..7b73951c 100644 --- a/lib/private/repositories/nodejs_toolchains.bzl +++ b/lib/private/repositories/nodejs_toolchains.bzl @@ -1,5 +1,5 @@ """ -Public API NodeJS repositories, plus some legacy cruft that `yarn_install` needs. +Public API NodeJS repositories. """ load("//lib/private:utils/platform.bzl", "PLATFORMS") @@ -43,5 +43,5 @@ def _nodejs_toolchains_impl(repository_ctx): nodejs_toolchains = repository_rule( _nodejs_toolchains_impl, - attrs = {"node_version": attr.string()}, + attrs = {}, )