Skip to content

Mark cargo internal extension as reproducible #3237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions cargo/private/internal_extensions.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Bzlmod module extensions that are only used internally"""

load("@bazel_features//:features.bzl", "bazel_features")
load("//cargo:deps.bzl", "cargo_dependencies")

def _internal_deps_impl(module_ctx):
Expand All @@ -12,10 +13,15 @@ def _internal_deps_impl(module_ctx):
# is_dev_dep is ignored here. It's not relevant for internal_deps, as dev
# dependencies are only relevant for module extensions that can be used
# by other MODULES.
return module_ctx.extension_metadata(
root_module_direct_deps = [repo.repo for repo in direct_deps],
root_module_direct_dev_deps = [],
)
metadata_kwargs = {
"root_module_direct_deps": [repo.repo for repo in direct_deps],
"root_module_direct_dev_deps": [],
}

if bazel_features.external_deps.extension_metadata_has_reproducible:
metadata_kwargs["reproducible"] = True

return module_ctx.extension_metadata(**metadata_kwargs)

# This is named a single character to reduce the size of path names when running build scripts, to reduce the chance
# of hitting the 260 character windows path name limit.
Expand Down