mirror of https://github.com/bazelbuild/platforms
Mark extension as reproducible (#92)
* Mark extension as reproducible * Fix workspace setup
This commit is contained in:
parent
05ec3a3df2
commit
1b0d452dcf
|
@ -56,9 +56,18 @@ list of strings, each of which is a label to a <code>constraint_value</code>
|
|||
for the host platform.""",
|
||||
)
|
||||
|
||||
def _host_platform_impl(_mctx):
|
||||
def _host_platform_impl(module_ctx):
|
||||
host_platform_repo(name = "host_platform")
|
||||
|
||||
# module_ctx.extension_metadata has the paramater `reproducible` as of Bazel 7.1.0. We can't
|
||||
# test for it directly and would ideally use bazel_features to check for it, but adding a
|
||||
# dependency on it would require complicating the WORKSPACE setup. Thus, test for it by
|
||||
# checking the availability of another feature introduced in 7.1.0.
|
||||
if hasattr(module_ctx, "extension_metadata") and hasattr(module_ctx, "watch"):
|
||||
return module_ctx.extension_metadata(reproducible = True)
|
||||
else:
|
||||
return None
|
||||
|
||||
host_platform = module_extension(
|
||||
implementation = _host_platform_impl,
|
||||
doc = """Generates a <code>host_platform_repo</code> repo named
|
||||
|
|
Loading…
Reference in New Issue