Skip to content

Commit 0c0ff7d

Browse files
committed
make module extension reproducible and os- and arch-independent
1 parent 95a3773 commit 0c0ff7d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mylang/extensions.bzl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,24 @@ def _toolchain_extension(module_ctx):
4949
mylang_version = selected,
5050
register = False,
5151
)
52+
return module_ctx.extension_metadata(
53+
# Return True if the behavior of the module extension is fully
54+
# determined by its inputs. Return False if the module depends on
55+
# outside state, for example, if it needs to fetch an external list
56+
# of versions, URLs, or hashes that could change.
57+
#
58+
# If True, Bazel omits information from the lock file, expecting that
59+
# it can be reproduced.
60+
reproducible = True,
61+
)
5262

5363
mylang = module_extension(
5464
implementation = _toolchain_extension,
5565
tag_classes = {"toolchain": mylang_toolchain},
66+
# Mark the extension as OS and architecture independent to simplify the
67+
# lock file. An independent module extension may still download OS- and
68+
# arch-dependent files, but it should download the same set of files
69+
# regardless of the host platform.
70+
os_dependent = False,
71+
arch_dependent = False,
5672
)

0 commit comments

Comments
 (0)