Skip to content

Commit bbe24cd

Browse files
authored
feat(crate_universe): use REPIN or RULES_RUST_REPIN to enable pinning (#682)
1 parent 8c56633 commit bbe24cd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crate_universe/defs.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def _crate_universe_resolve_impl(repository_ctx):
122122
- The user then calls defs.bzl%pinned_rust_install().
123123
124124
Environment Variables:
125-
RULES_RUST_UPDATE_CRATE_UNIVERSE_LOCKFILE: Re-pin the lockfile if `true`.
125+
REPIN: Re-pin the lockfile if set (useful for repinning deps from multiple rulesets).
126+
RULES_RUST_REPIN: Re-pin the lockfile if set (useful for only repinning Rust deps).
126127
RULES_RUST_CRATE_UNIVERSE_RESOLVER_URL_OVERRIDE: Override URL to use to download resolver binary - for local paths use a file:// URL.
127128
"""
128129

@@ -184,7 +185,8 @@ def _crate_universe_resolve_impl(repository_ctx):
184185
if lockfile_path != None:
185186
args.append("--lockfile")
186187
str(args.append(lockfile_path))
187-
if repository_ctx.os.environ.get("RULES_RUST_UPDATE_CRATE_UNIVERSE_LOCKFILE", "false") == "true":
188+
env_var_names = repository_ctx.os.environ.keys()
189+
if "RULES_RUST_REPIN" in env_var_names or "REPIN" in env_var_names:
188190
args.append("--update-lockfile")
189191

190192
path_binaries = [

0 commit comments

Comments
 (0)