Skip to content

Commit 39bea22

Browse files
nodejs-github-botaduh95
authored andcommitted
tools: update gyp-next to 0.21.1
PR-URL: #61528 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 796ff46 commit 39bea22

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

tools/gyp/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.21.1](https://github.com/nodejs/gyp-next/compare/v0.21.0...v0.21.1) (2026-01-24)
4+
5+
6+
### Bug Fixes
7+
8+
* replace weak hash functions with SHA-256 ([#329](https://github.com/nodejs/gyp-next/issues/329)) ([958029e](https://github.com/nodejs/gyp-next/commit/958029e6e4969a871d15e78cd083bb102bebb381))
9+
310
## [0.21.0](https://github.com/nodejs/gyp-next/compare/v0.20.5...v0.21.0) (2025-11-04)
411

512

tools/gyp/pylib/gyp/MSVSNew.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def MakeGuid(name, seed="msvs_new"):
3434
3535
Args:
3636
name: Target name.
37-
seed: Seed for MD5 hash.
37+
seed: Seed for SHA-256 hash.
3838
Returns:
3939
A GUID-line string calculated from the name and seed.
4040
@@ -44,8 +44,8 @@ def MakeGuid(name, seed="msvs_new"):
4444
determine the GUID to refer to explicitly. It also means that the GUID will
4545
not change when the project for a target is rebuilt.
4646
"""
47-
# Calculate a MD5 signature for the seed and name.
48-
d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper()
47+
# Calculate a SHA-256 signature for the seed and name.
48+
d = hashlib.sha256((str(seed) + str(name)).encode("utf-8")).hexdigest().upper()
4949
# Convert most of the signature to GUID form (discard the rest)
5050
guid = (
5151
"{"

tools/gyp/pylib/gyp/generator/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ def WriteMakeRule(
21692169
# - The multi-output rule will have an do-nothing recipe.
21702170

21712171
# Hash the target name to avoid generating overlong filenames.
2172-
cmddigest = hashlib.sha1(
2172+
cmddigest = hashlib.sha256(
21732173
(command or self.target).encode("utf-8")
21742174
).hexdigest()
21752175
intermediate = "%s.intermediate" % cmddigest

tools/gyp/pylib/gyp/generator/ninja.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,8 @@ def cygwin_munge(path):
809809
outputs = [self.GypPathToNinja(o, env) for o in outputs]
810810
if self.flavor == "win":
811811
# WriteNewNinjaRule uses unique_name to create a rsp file on win.
812-
extra_bindings.append(
813-
("unique_name", hashlib.md5(outputs[0]).hexdigest())
814-
)
812+
unique_name = hashlib.sha256(outputs[0].encode("utf-8")).hexdigest()
813+
extra_bindings.append(("unique_name", unique_name))
815814

816815
self.ninja.build(
817816
outputs,
@@ -2803,7 +2802,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
28032802
build_file, name, toolset
28042803
)
28052804
qualified_target_for_hash = qualified_target_for_hash.encode("utf-8")
2806-
hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest()
2805+
hash_for_rules = hashlib.sha256(qualified_target_for_hash).hexdigest()
28072806

28082807
base_path = os.path.dirname(build_file)
28092808
obj = "obj"

tools/gyp/pylib/gyp/xcodeproj_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def _HashUpdate(hash, data):
429429
hash.update(data)
430430

431431
if seed_hash is None:
432-
seed_hash = hashlib.sha1()
432+
seed_hash = hashlib.sha256()
433433

434434
hash = seed_hash.copy()
435435

tools/gyp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "gyp-next"
7-
version = "0.21.0"
7+
version = "0.21.1"
88
authors = [
99
{ name="Node.js contributors", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)