Skip to content

Commit c882a22

Browse files
Repro-compare fixes for jdk-25+ (#4308)
* Update repro_compare for jdk25 Signed-off-by: Andrew Leonard <[email protected]> * Update repro_compare for jdk25 Signed-off-by: Andrew Leonard <[email protected]> * jdk25u repro compare fixes Signed-off-by: Andrew Leonard <[email protected]> * jdk25u repro compare fixes Signed-off-by: Andrew Leonard <[email protected]> * jdk25u repro compare fixes Signed-off-by: Andrew Leonard <[email protected]> * jdk25u repro compare fixes Signed-off-by: Andrew Leonard <[email protected]> * jdk25u repro compare fixes Signed-off-by: Andrew Leonard <[email protected]> --------- Signed-off-by: Andrew Leonard <[email protected]>
1 parent 2bda476 commit c882a22

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

tooling/reproducible/repro_common.sh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,40 @@ function expandJDK() {
7979
rm -rf "${JDK_ROOT}_CP"
8080
}
8181

82+
# Windows & Mac: jdk-25+ Jlink runtimelink files contain signed binary "hash" lines in fs_* runtimelink files
83+
# - remove hashes of binaries and of lib/security/cacerts
84+
# - sort files as they are not sorted
85+
function removeJlinkRuntimelinkHashes() {
86+
local JDK_DIR="$1"
87+
local OS="$2"
88+
89+
if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then
90+
extractedDir="${JDK_DIR}/lib/modules_extracted/jdk.jlink/jdk/tools/jlink/internal/runtimelink"
91+
if [[ "$OS" =~ CYGWIN* ]]; then
92+
extractedDir=$(cygpath -w $extractedDir)
93+
fi
94+
95+
FILES=$(find "${extractedDir}" -type f -name "fs_*files")
96+
for f in $FILES
97+
do
98+
# Remove the binary hashes
99+
if [[ "$OS" =~ Darwin* ]]; then
100+
sed -i "" -E 's/^([^|]+)\|([^|]+)\|[^|]+\|([^\.]+\.dylib$)/\1|\2||\3/g' "$f"
101+
sed -i "" -E 's/^([^|]+)\|([^|]+)\|[^|]+\|(bin\/.*$)/\1|\2||\3/g' "$f"
102+
sed -i "" -E 's/^([^|]+)\|([^|]+)\|[^|]+\|(lib\/security\/cacerts$)/\1|\2||\3/g' "$f"
103+
else
104+
sed -i -E 's/^([^|]+)\|([^|]+)\|[^|]+\|([^\.]+\.dll$)/\1|\2||\3/g' "$f"
105+
sed -i -E 's/^([^|]+)\|([^|]+)\|[^|]+\|([^\.]+\.exe$)/\1|\2||\3/g' "$f"
106+
sed -i -E 's/^([^|]+)\|([^|]+)\|[^|]+\|(lib\/security\/cacerts$)/\1|\2||\3/g' "$f"
107+
fi
108+
109+
# Sort file content
110+
sort "$f" > "$f.sorted"
111+
rm "$f"
112+
done
113+
fi
114+
}
115+
82116
# Process SystemModules classes to remove ModuleHashes$Builder differences due to Signatures
83117
# 1. javap
84118
# 2. search for line: // Method jdk/internal/module/ModuleHashes$Builder.hashForModule:(Ljava/lang/String;[B)Ljdk/internal/module/ModuleHashes$Builder;
@@ -90,7 +124,7 @@ function removeSystemModulesHashBuilderParams() {
90124
moduleHashesFunction="// Method jdk/internal/module/ModuleHashes\$Builder.hashForModule:(Ljava/lang/String;[B)Ljdk/internal/module/ModuleHashes\$Builder;"
91125
moduleString="// String "
92126
virtualFunction="invokevirtual"
93-
systemModules="SystemModules\$0.class SystemModules\$all.class SystemModules\$default.class"
127+
systemModules="SystemModules\$0.class SystemModules\$all.class SystemModules\$default.class SystemModules\$1.class SystemModules\$2.class SystemModules\$3.class SystemModules\$4.class SystemModules\$5.class"
94128
local JDK_DIR="$1"
95129
local OS="$2"
96130
local work_JDK="$3"
@@ -333,6 +367,8 @@ function removeGeneratedClasses() {
333367
if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then
334368
rm -rf "$JDK_DIR/bin/server/classes.jsa"
335369
rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa"
370+
rm -rf "$JDK_DIR/bin/server/classes_coh.jsa"
371+
rm -rf "$JDK_DIR/bin/server/classes_nocoops_coh.jsa"
336372
fi
337373
}
338374

tooling/reproducible/repro_compare.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ do
6464
# release file build machine OS level and builds-scripts SHA can/will be different
6565
cleanTemurinBuildInfo "${JDK_DIR}"
6666

67-
if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then
67+
if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then
68+
removeJlinkRuntimelinkHashes "${JDK_DIR}" "${OS}"
6869
removeSystemModulesHashBuilderParams "${JDK_DIR}" "${OS}" "${BK_JDK_DIR}"
6970
processModuleInfo "${JDK_DIR}" "${OS}" "${BK_JDK_DIR}"
7071
fi

0 commit comments

Comments
 (0)