tools: do not use short hashes for deps versioning to avoid collision

PR-URL: https://github.com/nodejs/node/pull/60407
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Antoine du Hamel 2025-10-27 15:20:25 +01:00 committed by GitHub
parent d9cf867a9d
commit 617622211f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -86,4 +86,4 @@ echo "$NEW_GYP" >"$DEPS_DIR/googletest/googletest.gyp"
# Update the version number on maintaining-dependencies.md
# and print the new version as the last line of the script as we need
# to add it to $GITHUB_ENV variable
finalize_version_update "googletest" "$NEW_VERSION"
finalize_version_update "googletest" "$NEW_UPSTREAM_SHA1"

View File

@ -8,16 +8,15 @@ NIXPKGS_PIN_FILE="$BASE_DIR/tools/nix/pkgs.nix"
NIXPKGS_REPO=$(grep 'repo =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
CURRENT_VERSION_SHA1=$(grep 'rev =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
CURRENT_VERSION=$(echo "$CURRENT_VERSION_SHA1" | head -c 7)
NEW_UPSTREAM_SHA1=$(git ls-remote "$NIXPKGS_REPO.git" nixpkgs-unstable | awk '{print $1}')
NEW_VERSION=$(echo "$NEW_UPSTREAM_SHA1" | head -c 7)
NEW_VERSION=$(echo "$NEW_UPSTREAM_SHA1" | head -c 35)
# shellcheck disable=SC1091
. "$BASE_DIR/tools/dep_updaters/utils.sh"
compare_dependency_version "nixpkgs-unstable" "$NEW_VERSION" "$CURRENT_VERSION"
compare_dependency_version "nixpkgs-unstable" "$CURRENT_VERSION_SHA1" "$NEW_UPSTREAM_SHA1"
CURRENT_TARBALL_HASH=$(grep 'sha256 =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
NEW_TARBALL_HASH=$(nix-prefetch-url --unpack "$NIXPKGS_REPO/archive/$NEW_UPSTREAM_SHA1.tar.gz")