Skip to content

Commit 7a8e980

Browse files
authored
refactor: update canonical label name when ASPECT_RULES_JS_FROZEN_PNPM_LOCK=true (#2266)
1 parent 91f7530 commit 7a8e980

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

npm/private/npm_translate_lock.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,20 @@ INFO: {} file has changed""".format(pnpm_lock_relative_path))
844844

845845
################################################################################
846846
def _fail_if_frozen_pnpm_lock(rctx, state):
847+
repo_reference_symbol = "@"
848+
if rctx.attr.bzlmod:
849+
repo_reference_symbol = "@@"
850+
847851
if RULES_JS_FROZEN_PNPM_LOCK_ENV in rctx.os.environ.keys() and rctx.os.environ[RULES_JS_FROZEN_PNPM_LOCK_ENV]:
848852
fail("""
849853
850854
ERROR: `{action_cache}` is out of date. `{pnpm_lock}` may require an update. To update run,
851855
852-
bazel run @{rctx_name}//:sync
856+
bazel run {repo_reference_symbol}{rctx_name}//:sync
853857
854858
""".format(
855859
action_cache = state.label_store.relative_path("action_cache"),
856860
pnpm_lock = state.label_store.relative_path("pnpm_lock"),
861+
repo_reference_symbol = repo_reference_symbol,
857862
rctx_name = rctx.name,
858863
))

0 commit comments

Comments
 (0)