Skip to content

Commit

Permalink
[bzlmod] Mark npm extension as reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Mar 23, 2024
1 parent 783dbee commit 9c3c7c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module(
# Do not bump these unless rules_js requires a newer version to function.
bazel_dep(name = "aspect_bazel_lib", version = "1.40.3")
bazel_dep(name = "aspect_rules_lint", version = "0.12.0")
bazel_dep(name = "bazel_features", version = "0.1.0")
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")

# Keep v5 in to avoid breaking changes.
Expand All @@ -23,7 +23,7 @@ single_version_override(
version = "6.0.5",
)

bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "platforms", version = "0.0.7")

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_darwin_amd64")
Expand Down Expand Up @@ -57,7 +57,7 @@ use_repo(bazel_lib_toolchains, "yq_windows_amd64")
bazel_dep(name = "gazelle", version = "0.35.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.44.0", dev_dependency = True)

host = use_extension(
"@aspect_bazel_lib//lib:extensions.bzl",
Expand Down
6 changes: 6 additions & 0 deletions npm/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
See https://bazel.build/docs/bzlmod#extension-definition
"""

load("@bazel_features//:features.bzl", "bazel_features")
load("@aspect_bazel_lib//lib:repo_utils.bzl", "repo_utils")
load("//npm:repositories.bzl", "npm_import", "pnpm_repository", _LATEST_PNPM_VERSION = "LATEST_PNPM_VERSION")
load("//npm/private:npm_translate_lock.bzl", "npm_translate_lock", "npm_translate_lock_lib")
Expand Down Expand Up @@ -213,6 +214,11 @@ WARNING: Cannot determine home directory in order to load home `.npmrc` file in
register_copy_to_directory_toolchains = False, # this registration is handled elsewhere with bzlmod
)

if bazel_features.external_deps.extension_metadata_has_reproducible:
return module_ctx.extension_metadata(
reproducible = True,
)

def _npm_translate_lock_attrs():
attrs = dict(**npm_translate_lock_lib.attrs)

Expand Down

0 comments on commit 9c3c7c7

Please sign in to comment.