Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
feat: import toolchains to use for copy actions
Browse files Browse the repository at this point in the history
upport bazel-lib 1.x and 2.x.

This is analogous to aspect-build/rules_js#1355 for rules_js.
  • Loading branch information
ralimi committed Nov 20, 2023
1 parent a4ffe24 commit c09be94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ http_archive(
EOF
awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel
echo "\`\`\`"

cat << EOF
To use rules_esbuild with bazel-lib 2.0, you must additionally register the coreutils toolchain.
\`\`\`starlark
load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")
register_coreutils_toolchains()
\`\`\`
EOF
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.29.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "buildifier_prebuilt", version = "6.0.0.1", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "1.29.2")
bazel_dep(name = "aspect_bazel_lib", version = "1.38.1")
bazel_dep(name = "aspect_rules_js", version = "1.29.2")
bazel_dep(name = "rules_nodejs", version = "5.8.2")
bazel_dep(name = "platforms", version = "0.0.5")
Expand Down
4 changes: 2 additions & 2 deletions esbuild/private/esbuild.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"# esbuild rule"

load("@aspect_bazel_lib//lib:expand_make_vars.bzl", "expand_variables")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_file_to_bin_action", "copy_files_to_bin_actions")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_file_to_bin_action", "copy_files_to_bin_actions", "COPY_FILE_TO_BIN_TOOLCHAINS")
load("@aspect_rules_js//js:libs.bzl", "js_lib_helpers")
load("@aspect_rules_js//js:providers.bzl", "JsInfo", "js_info")
load(":helpers.bzl", "desugar_entry_point_names", "write_args_file")
Expand Down Expand Up @@ -422,7 +422,7 @@ lib = struct(
toolchains = [
"@rules_nodejs//nodejs:toolchain_type",
"@aspect_rules_esbuild//esbuild:toolchain_type",
],
] + COPY_FILE_TO_BIN_TOOLCHAINS,
)

esbuild_bundle = rule(
Expand Down

0 comments on commit c09be94

Please sign in to comment.