From 8d61b2e0a76c64393fc5c43428c653f1f4fa5e5b Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Fri, 21 Jun 2024 13:33:39 +0100 Subject: [PATCH] fix(export): mark extension as reproducible Prevents adding repositories into the lockfile. --- MODULE.bazel | 1 + MODULE.bazel.lock | 3 ++- toolchain/export/extension.bzl | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 0a3eec6..ddfaaaa 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,6 +7,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.4.2") +bazel_dep(name = "bazel_features", version = "1.13.0") bazel_dep(name = "platforms", version = "0.0.7") triplet = use_repo_rule("//toolchain/local/triplet:defs.bzl", "toolchain_local_triplet") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 469dcb1..20d6baa 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -8,7 +8,8 @@ "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_features/1.13.0/MODULE.bazel": "c14c33c7c3c730612bdbe14ebbb5e61936b6f11322ea95a6e91cd1ba962f94df", + "https://bcr.bazel.build/modules/bazel_features/1.13.0/source.json": "b01f6aaaf93527ff4267421ef416debbd89b3166b70af5c89400c6a95a89c133", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", diff --git a/toolchain/export/extension.bzl b/toolchain/export/extension.bzl index 252c280..cb77d4e 100644 --- a/toolchain/export/extension.bzl +++ b/toolchain/export/extension.bzl @@ -1,3 +1,4 @@ +load("@bazel_features//:features.bzl", "bazel_features") load("//toolchain/export/symlink:repository.bzl", _ATTRS = "ATTRS", _DOC = "DOC", _symlink = "symlink") visibility("//toolchain/export/...") @@ -89,6 +90,11 @@ def implementation(mctx): for name, (_, attrs) in symlinks.items(): _symlink(name = name, **attrs) + if bazel_features.external_deps.extension_metadata_has_reproducible: + return mctx.extension_metadata(reproducible = True) + else: + return None + export = module_extension( doc = DOC, implementation = implementation, -- GitLab