Skip to content

Commit 1b09295

Browse files
committed
fix: avoid accidental re-use of incorrect cached versions
Prevents accidental re-use of cached versions that would otherwise be used purely based on the "integrity" value. E.g. someone forgot to update the integrity but the `ts_version` is already different.
1 parent 251ac0e commit 1b09295

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ts/private/npm_repositories.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def _http_archive_version_impl(rctx):
4545
rctx.download_and_extract(
4646
url = [u.format(version) for u in rctx.attr.urls],
4747
integrity = integrity,
48+
# Prevents accidental re-use of cached versions that would otherwise
49+
# be used purely based on the "integrity" value. E.g. someone forgot
50+
# to update the integrity but the `ts_version` is already different.
51+
canonical_id = "%s_%s" % (version, integrity),
4852
)
4953
build_file_substitutions = {
5054
"ts_version": version,

0 commit comments

Comments
 (0)