Skip to content

Commit

Permalink
feat(crate_universe): use REPIN or RULES_RUST_REPIN to enable pinning (
Browse files Browse the repository at this point in the history
  • Loading branch information
gibfahn committed Apr 7, 2021
1 parent 8c56633 commit bbe24cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crate_universe/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def _crate_universe_resolve_impl(repository_ctx):
- The user then calls defs.bzl%pinned_rust_install().
Environment Variables:
RULES_RUST_UPDATE_CRATE_UNIVERSE_LOCKFILE: Re-pin the lockfile if `true`.
REPIN: Re-pin the lockfile if set (useful for repinning deps from multiple rulesets).
RULES_RUST_REPIN: Re-pin the lockfile if set (useful for only repinning Rust deps).
RULES_RUST_CRATE_UNIVERSE_RESOLVER_URL_OVERRIDE: Override URL to use to download resolver binary - for local paths use a file:// URL.
"""

Expand Down Expand Up @@ -184,7 +185,8 @@ def _crate_universe_resolve_impl(repository_ctx):
if lockfile_path != None:
args.append("--lockfile")
str(args.append(lockfile_path))
if repository_ctx.os.environ.get("RULES_RUST_UPDATE_CRATE_UNIVERSE_LOCKFILE", "false") == "true":
env_var_names = repository_ctx.os.environ.keys()
if "RULES_RUST_REPIN" in env_var_names or "REPIN" in env_var_names:
args.append("--update-lockfile")

path_binaries = [
Expand Down

0 comments on commit bbe24cd

Please sign in to comment.