From 20feacc6129f5fb33f12cfecf4560683c26551ec Mon Sep 17 00:00:00 2001 From: judovana Date: Fri, 4 Oct 2024 15:28:10 +0200 Subject: [PATCH 01/21] Update ReproducibleBuilds.md with cygwin details --- tooling/reproducible/ReproducibleBuilds.md | 44 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index a43b5b551..5b4f9bf61 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -63,6 +63,9 @@ before the comparable_patch.sh can be run. - Ensure VS2022 SDK is installed and on PATH - Compile: - cd tooling/src/c + - run vcvarsall.bat as your arch needs. Eg: vcvars64.bat on x64 windows + - You can set up INCUDES manually but it is not worthy + - vcvarsall.bat creates subshell, if you do not want it, use `call` eg `call vcvars64.bat` instead of direct execution - cl WindowsUpdateVsVersionInfo.c version.lib 3. Compile [src/java/temurin/tools/BinRepl.java](https://github.com/adoptium/temurin-build/blob/master/tooling/src/java/temurin/tools/BinRepl.java) : @@ -79,11 +82,46 @@ before the comparable_patch.sh can be run. - For BinRepl.class : export CLASSPATH=/tooling/src/java:$CLASSPATH - A JDK for running BinRepl java : export PATH=/bin:$PATH +##### Cygwin treacherousness + - it is extremly difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly + - thus it is recomeded to launch this via `cmd -c` or better by executable .bat file: +``` + pushd "$MSVSC/BUILD/TOOLS" + echo " + call vcvars64.bat + cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib + " > bat.bat + chmod 777 bat.bat + ./bat.bat + # copy it to any dir on path or add this dir to path + mv WindowsUpdateVsVersionInfo.exe "$some/location/on/future/path" + popd +``` + - the default paths should work fine, but are quite hidden eg: +``` + MSBASE_PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/" + MSVSC=$(find "$MSBASE_PATH" -type d | grep Hostx64/x64$ | head -n 1 ) + WINKIT=$(dirname "$(find '/cygdrive/c/Program Files (x86)/Windows Kits' | grep x64/signtool.exe$ | head -n 1)") + MSVSCBUILDTOOLS=$(find "$MSBASE_PATH" -type d | grep Auxiliary/Build$ | head -n 1 ) +``` + - note the cygpath usages, sometimes are necessary, sometimes not. Java *bianries* have issues with it, eg for javac it is mandatory: +``` + ftureDir="$(pwd)/classes" + if uname | grep CYGWIN ; then + ftureDir=$(cygpath -m "${ftureDir}") + fi + $AQA_DIR/$jdkName/bin/javac -d "${ftureDir}" "../../tooling/src/java/temurin/tools/BinRepl.java" +``` + #### Running comparable_patch.sh: 1. Unzip your JDK archive into a directory (eg.jdk1) + - Note, that jdk will be modified, so the lcoation must be writiable + - if it is in admin/root location, `cp -rL` it to some temp. + - in cygwin, you may need to fix permissions `chmod -R 777 "${JDK_DIR}"` + - otherwise future calls to java/javap/javac would fail -2. Run comparable_patch.sh +3. Run comparable_patch.sh ```bash bash comparable_patch.sh --jdk-dir "" --version-string "" --vendor-name "" --vendor_url "" --vendor-bug-url "" --vendor-vm-bug-url "" [--patch-vs-version-info] @@ -100,6 +138,10 @@ java -XshowSettings: java.vendor.version = Temurin-21.0.1+12 ... ``` +In cygwin, you must handle the trailing `\r` otherwise it will fail later: +``` + JAVA_VENDOR="$($JDK_DIR/bin/java -XshowSettings 2>&1| grep 'java.vendor = ' | sed 's/.* = //' | sed 's/\r.*//' )" +``` eg. From c2cbbcabde6100c6efda4b07887e666ea64d6fe4 Mon Sep 17 00:00:00 2001 From: judovana Date: Fri, 4 Oct 2024 16:54:20 +0200 Subject: [PATCH 02/21] Mentioned that jdk use don path must not be jdk whichis being patched --- tooling/reproducible/ReproducibleBuilds.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 5b4f9bf61..6eeb956f9 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -71,6 +71,7 @@ before the comparable_patch.sh can be run. 3. Compile [src/java/temurin/tools/BinRepl.java](https://github.com/adoptium/temurin-build/blob/master/tooling/src/java/temurin/tools/BinRepl.java) : - Ensure suitable JDK on PATH + - **do not ** use JDK you are just patching, the JDK is **broken** after (also during) of patching - cd tooling/src/java - javac temurin/tools/BinRepl.java From 12437e5a2134c724d7dd66eb82f270f5b87f2c02 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 4 Oct 2024 17:55:23 +0200 Subject: [PATCH 03/21] Mentioned also classpath --- tooling/reproducible/ReproducibleBuilds.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 6eeb956f9..2009dfc02 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -105,7 +105,8 @@ before the comparable_patch.sh can be run. WINKIT=$(dirname "$(find '/cygdrive/c/Program Files (x86)/Windows Kits' | grep x64/signtool.exe$ | head -n 1)") MSVSCBUILDTOOLS=$(find "$MSBASE_PATH" -type d | grep Auxiliary/Build$ | head -n 1 ) ``` - - note the cygpath usages, sometimes are necessary, sometimes not. Java *bianries* have issues with it, eg for javac it is mandatory: + - note the cygpath usages, sometimes are necessary, sometimes not. Java *bianries* have issues with it: + - eg for javac: ``` ftureDir="$(pwd)/classes" if uname | grep CYGWIN ; then @@ -113,7 +114,7 @@ before the comparable_patch.sh can be run. fi $AQA_DIR/$jdkName/bin/javac -d "${ftureDir}" "../../tooling/src/java/temurin/tools/BinRepl.java" ``` - + - or $CLASSPATH it is mandatory #### Running comparable_patch.sh: 1. Unzip your JDK archive into a directory (eg.jdk1) From 7f9cbf916712df75a16e72b02aa6fe49b06e5856 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 7 Oct 2024 13:23:35 +0200 Subject: [PATCH 04/21] Fixing markup lint --- tooling/reproducible/ReproducibleBuilds.md | 47 +++++++++++++--------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 2009dfc02..caa80c255 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -71,7 +71,7 @@ before the comparable_patch.sh can be run. 3. Compile [src/java/temurin/tools/BinRepl.java](https://github.com/adoptium/temurin-build/blob/master/tooling/src/java/temurin/tools/BinRepl.java) : - Ensure suitable JDK on PATH - - **do not ** use JDK you are just patching, the JDK is **broken** after (also during) of patching + - **do not** use JDK you are just patching, the JDK is **broken** after (also during) of patching - cd tooling/src/java - javac temurin/tools/BinRepl.java @@ -84,52 +84,61 @@ before the comparable_patch.sh can be run. - A JDK for running BinRepl java : export PATH=/bin:$PATH ##### Cygwin treacherousness - - it is extremly difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly - - thus it is recomeded to launch this via `cmd -c` or better by executable .bat file: -``` + +- it is extremely difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly +- thus it is recommended to launch this via `cmd -c` or better by executable .bat file: + +```bash pushd "$MSVSC/BUILD/TOOLS" + rm -f WindowsUpdateVsVersionInfo.obj echo " - call vcvars64.bat - cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib + call vcvars64.bat + cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib " > bat.bat chmod 777 bat.bat ./bat.bat # copy it to any dir on path or add this dir to path - mv WindowsUpdateVsVersionInfo.exe "$some/location/on/future/path" + mv WindowsUpdateVsVersionInfo.exe "$FUTURE_PATH_ADDITIONS" + rm WindowsUpdateVsVersionInfo.obj bat.bat popd ``` - - the default paths should work fine, but are quite hidden eg: -``` + +- the default paths should work fine, but are quite hidden eg: + +```bash MSBASE_PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/" MSVSC=$(find "$MSBASE_PATH" -type d | grep Hostx64/x64$ | head -n 1 ) WINKIT=$(dirname "$(find '/cygdrive/c/Program Files (x86)/Windows Kits' | grep x64/signtool.exe$ | head -n 1)") MSVSCBUILDTOOLS=$(find "$MSBASE_PATH" -type d | grep Auxiliary/Build$ | head -n 1 ) ``` - - note the cygpath usages, sometimes are necessary, sometimes not. Java *bianries* have issues with it: - - eg for javac: -``` + +- note the cygpath usages, sometimes are necessary, sometimes not. Java *binaries* have issues with it: + - eg for $CLASSPATH, + - or javac it is mandatory: + +```bash ftureDir="$(pwd)/classes" if uname | grep CYGWIN ; then ftureDir=$(cygpath -m "${ftureDir}") fi $AQA_DIR/$jdkName/bin/javac -d "${ftureDir}" "../../tooling/src/java/temurin/tools/BinRepl.java" ``` - - or $CLASSPATH it is mandatory + #### Running comparable_patch.sh: 1. Unzip your JDK archive into a directory (eg.jdk1) - - Note, that jdk will be modified, so the lcoation must be writiable + - Note, that jdk will be modified, so the location must be writable - if it is in admin/root location, `cp -rL` it to some temp. - in cygwin, you may need to fix permissions `chmod -R 777 "${JDK_DIR}"` - otherwise future calls to java/javap/javac would fail -3. Run comparable_patch.sh +2. Run comparable_patch.sh ```bash bash comparable_patch.sh --jdk-dir "" --version-string "" --vendor-name "" --vendor_url "" --vendor-bug-url "" --vendor-vm-bug-url "" [--patch-vs-version-info] ``` -The Vendor strings and urls can be found by running your jdk's "java -XshowSettings": +The Vendor strings and URLs can be found by running your jdk's "java -XshowSettings": ```java java -XshowSettings: @@ -140,12 +149,14 @@ java -XshowSettings: java.vendor.version = Temurin-21.0.1+12 ... ``` + In cygwin, you must handle the trailing `\r` otherwise it will fail later: -``` + +```bash JAVA_VENDOR="$($JDK_DIR/bin/java -XshowSettings 2>&1| grep 'java.vendor = ' | sed 's/.* = //' | sed 's/\r.*//' )" ``` -eg. +eg: ```bash bash ./comparable_patch.sh --jdk-dir "jdk1/jdk-21.0.1+12" --version-string "Temurin-21.0.1+12" --vendor-name "Eclipse Adoptium" --vendor_url "https://adoptium.net/" --vendor-bug-url "https://github.com/adoptium/adoptium-support/issues" --vendor-vm-bug-url "https://github.com/adoptium/adoptium-support/issues" From 6eb7990b663ba06827a0a5c80db6341e6eb3a239 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:26:40 +0200 Subject: [PATCH 05/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index caa80c255..7e43f3aa3 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -64,7 +64,7 @@ before the comparable_patch.sh can be run. - Compile: - cd tooling/src/c - run vcvarsall.bat as your arch needs. Eg: vcvars64.bat on x64 windows - - You can set up INCUDES manually but it is not worthy + - You can set up INCLUDES manually but it is not worthy - vcvarsall.bat creates subshell, if you do not want it, use `call` eg `call vcvars64.bat` instead of direct execution - cl WindowsUpdateVsVersionInfo.c version.lib From f8d80740d3db62f97ac439de36aa4d8ec8209d26 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:28:46 +0200 Subject: [PATCH 06/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 7e43f3aa3..5ce2458d4 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -65,7 +65,7 @@ before the comparable_patch.sh can be run. - cd tooling/src/c - run vcvarsall.bat as your arch needs. Eg: vcvars64.bat on x64 windows - You can set up INCLUDES manually but it is not worthy - - vcvarsall.bat creates subshell, if you do not want it, use `call` eg `call vcvars64.bat` instead of direct execution + - vcvarsall.bat creates a subshell, if you do not want it to create a subshell, use `call` eg `call vcvars64.bat` instead of the direct execution. - cl WindowsUpdateVsVersionInfo.c version.lib 3. Compile [src/java/temurin/tools/BinRepl.java](https://github.com/adoptium/temurin-build/blob/master/tooling/src/java/temurin/tools/BinRepl.java) : From b3b893482f62ea2cf346a1f3e261620c86dc6e3e Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:29:02 +0200 Subject: [PATCH 07/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 5ce2458d4..96f0283ef 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -71,7 +71,7 @@ before the comparable_patch.sh can be run. 3. Compile [src/java/temurin/tools/BinRepl.java](https://github.com/adoptium/temurin-build/blob/master/tooling/src/java/temurin/tools/BinRepl.java) : - Ensure suitable JDK on PATH - - **do not** use JDK you are just patching, the JDK is **broken** after (also during) of patching + - **do not** use JDK you are just patching, as that JDK gets **broken** by the process of patching - cd tooling/src/java - javac temurin/tools/BinRepl.java From b6efaac00dc51a55a70c6934dc6e9e77019c13b8 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:29:31 +0200 Subject: [PATCH 08/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 96f0283ef..11b4a48ba 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -85,7 +85,7 @@ before the comparable_patch.sh can be run. ##### Cygwin treacherousness -- it is extremely difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly +- It is extremely difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly - thus it is recommended to launch this via `cmd -c` or better by executable .bat file: ```bash From 164dfc7c833d3fdeb1dd2a7f3a6c51bfb11fc4b1 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:30:20 +0200 Subject: [PATCH 09/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 11b4a48ba..67491e227 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -112,7 +112,7 @@ before the comparable_patch.sh can be run. MSVSCBUILDTOOLS=$(find "$MSBASE_PATH" -type d | grep Auxiliary/Build$ | head -n 1 ) ``` -- note the cygpath usages, sometimes are necessary, sometimes not. Java *binaries* have issues with it: +- NOTE: Using `cygpath` is sometimes necessary. However, Java *binaries* can have issues with it: - eg for $CLASSPATH, - or javac it is mandatory: From 8c58dffdeb1fbdf68c800234512aa707a1c90bfc Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:30:30 +0200 Subject: [PATCH 10/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 67491e227..d909504cf 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -113,7 +113,7 @@ before the comparable_patch.sh can be run. ``` - NOTE: Using `cygpath` is sometimes necessary. However, Java *binaries* can have issues with it: - - eg for $CLASSPATH, + - e.g., Use `cygpath` for `$CLASSPATH`, - or javac it is mandatory: ```bash From 9cbc886f94327e38640775a64298f56167b71e53 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:30:41 +0200 Subject: [PATCH 11/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index d909504cf..64225827a 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -128,7 +128,7 @@ before the comparable_patch.sh can be run. 1. Unzip your JDK archive into a directory (eg.jdk1) - Note, that jdk will be modified, so the location must be writable - - if it is in admin/root location, `cp -rL` it to some temp. + - if it is in admin/root location, `cp -rL` it to some temp directory. - in cygwin, you may need to fix permissions `chmod -R 777 "${JDK_DIR}"` - otherwise future calls to java/javap/javac would fail From 6cd4bc33cda33efffd1a1e8776d61c4f17886722 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:31:04 +0200 Subject: [PATCH 12/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 64225827a..f55f76d52 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -130,7 +130,7 @@ before the comparable_patch.sh can be run. - Note, that jdk will be modified, so the location must be writable - if it is in admin/root location, `cp -rL` it to some temp directory. - in cygwin, you may need to fix permissions `chmod -R 777 "${JDK_DIR}"` - - otherwise future calls to java/javap/javac would fail + - otherwise future calls to `java/javap/javac` would fail 2. Run comparable_patch.sh From 6c6479ccd4c33f546012137684e679ee1d9f21a8 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 8 Oct 2024 14:31:43 +0200 Subject: [PATCH 13/21] Update tooling/reproducible/ReproducibleBuilds.md Co-authored-by: Martijn Verburg --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index f55f76d52..df4d7d5f5 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -156,7 +156,7 @@ In cygwin, you must handle the trailing `\r` otherwise it will fail later: JAVA_VENDOR="$($JDK_DIR/bin/java -XshowSettings 2>&1| grep 'java.vendor = ' | sed 's/.* = //' | sed 's/\r.*//' )" ``` -eg: +e.g.,: ```bash bash ./comparable_patch.sh --jdk-dir "jdk1/jdk-21.0.1+12" --version-string "Temurin-21.0.1+12" --vendor-name "Eclipse Adoptium" --vendor_url "https://adoptium.net/" --vendor-bug-url "https://github.com/adoptium/adoptium-support/issues" --vendor-vm-bug-url "https://github.com/adoptium/adoptium-support/issues" From d1d561483e3bf30a02ae83737ce9cebf7a1b9c17 Mon Sep 17 00:00:00 2001 From: judovana Date: Wed, 9 Oct 2024 19:15:28 +0200 Subject: [PATCH 14/21] removed surpassed 777 from ReproducibleBuilds.md --- tooling/reproducible/ReproducibleBuilds.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index df4d7d5f5..963373efb 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -129,8 +129,6 @@ before the comparable_patch.sh can be run. 1. Unzip your JDK archive into a directory (eg.jdk1) - Note, that jdk will be modified, so the location must be writable - if it is in admin/root location, `cp -rL` it to some temp directory. - - in cygwin, you may need to fix permissions `chmod -R 777 "${JDK_DIR}"` - - otherwise future calls to `java/javap/javac` would fail 2. Run comparable_patch.sh From 7e660c9a133132189df9bf21244f37edda3d4b4a Mon Sep 17 00:00:00 2001 From: Martijn Verburg Date: Thu, 10 Oct 2024 15:19:42 +1300 Subject: [PATCH 15/21] Update tooling/reproducible/ReproducibleBuilds.md --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 963373efb..7f3253ba5 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -86,7 +86,7 @@ before the comparable_patch.sh can be run. ##### Cygwin treacherousness - It is extremely difficult (maybe impossible) to invoke `vcvarsall.bat+cl` in cygwin directly -- thus it is recommended to launch this via `cmd -c` or better by executable .bat file: +- Thus, it is recommended to launch this via `cmd -c` or preferably by an executable `.bat` file such as: ```bash pushd "$MSVSC/BUILD/TOOLS" From b57ac2f8ee550e88ca68e3872dec2d524d5136e0 Mon Sep 17 00:00:00 2001 From: Martijn Verburg Date: Thu, 10 Oct 2024 15:19:54 +1300 Subject: [PATCH 16/21] Update tooling/reproducible/ReproducibleBuilds.md --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 7f3253ba5..e02c33db3 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -103,7 +103,7 @@ before the comparable_patch.sh can be run. popd ``` -- the default paths should work fine, but are quite hidden eg: +- NOTE: The default paths should work fine, e.g.,: ```bash MSBASE_PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/" From 1b2f20e42db6da9c3eac32d490258205f13eeb47 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 14 Oct 2024 10:32:34 +0200 Subject: [PATCH 17/21] Removed full example f extracting the the properties out of vm --- tooling/reproducible/ReproducibleBuilds.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index e02c33db3..15d3eaa0d 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -148,11 +148,7 @@ java -XshowSettings: ... ``` -In cygwin, you must handle the trailing `\r` otherwise it will fail later: - -```bash - JAVA_VENDOR="$($JDK_DIR/bin/java -XshowSettings 2>&1| grep 'java.vendor = ' | sed 's/.* = //' | sed 's/\r.*//' )" -``` +In cygwin, you must handle the trailing `\r` otherwise it will fail later. sed `\r` away as eg: `sed 's/\r.*//'` is usually enough. e.g.,: From 96b53b0f5abd0607a75b06a3f2d69251a0c80762 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 25 Oct 2024 12:45:58 +0200 Subject: [PATCH 18/21] Simplifed cygwin paths from bash example to formated text. --- tooling/reproducible/ReproducibleBuilds.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 15d3eaa0d..c4f1b2043 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -103,14 +103,9 @@ before the comparable_patch.sh can be run. popd ``` -- NOTE: The default paths should work fine, e.g.,: - -```bash - MSBASE_PATH="/cygdrive/c/Program Files/Microsoft Visual Studio/" - MSVSC=$(find "$MSBASE_PATH" -type d | grep Hostx64/x64$ | head -n 1 ) - WINKIT=$(dirname "$(find '/cygdrive/c/Program Files (x86)/Windows Kits' | grep x64/signtool.exe$ | head -n 1)") - MSVSCBUILDTOOLS=$(find "$MSBASE_PATH" -type d | grep Auxiliary/Build$ | head -n 1 ) -``` +- NOTE: The default paths should work fine. In Cygwin, they are usually at: + * MSVSC cl/bat files in `/cygdrive/c/Program Files/Microsoft Visual Studio/` under `Hostx64/x64` (or similar) and `Auxiliary/Build` dirs + * the signtool.exe then in `/cygdrive/c/Program Files (x86)/Windows Kits`. Again in arch-specific dir like `x64` - NOTE: Using `cygpath` is sometimes necessary. However, Java *binaries* can have issues with it: - e.g., Use `cygpath` for `$CLASSPATH`, From 146fb5c5dd277b05bf2bac8c1a4591e3ece3858e Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 25 Oct 2024 12:50:27 +0200 Subject: [PATCH 19/21] Minor comsetic alilgnement --- tooling/reproducible/ReproducibleBuilds.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index c4f1b2043..2cb3d878b 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -104,8 +104,8 @@ before the comparable_patch.sh can be run. ``` - NOTE: The default paths should work fine. In Cygwin, they are usually at: - * MSVSC cl/bat files in `/cygdrive/c/Program Files/Microsoft Visual Studio/` under `Hostx64/x64` (or similar) and `Auxiliary/Build` dirs - * the signtool.exe then in `/cygdrive/c/Program Files (x86)/Windows Kits`. Again in arch-specific dir like `x64` + - MSVSC cl/bat files in `/cygdrive/c/Program Files/Microsoft Visual Studio/` under `Hostx64/x64` (or similar) and `Auxiliary/Build` dirs + - the signtool.exe then in `/cygdrive/c/Program Files (x86)/Windows Kits`. Again in arch-specific dir like `x64` - NOTE: Using `cygpath` is sometimes necessary. However, Java *binaries* can have issues with it: - e.g., Use `cygpath` for `$CLASSPATH`, From c75e3c83c4cffbd9faa2ae601c8eaf55a84bb678 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 8 Nov 2024 11:25:32 +0100 Subject: [PATCH 20/21] Fixed permissions to 755 --- tooling/reproducible/ReproducibleBuilds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 2cb3d878b..18f985270 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -95,7 +95,7 @@ before the comparable_patch.sh can be run. call vcvars64.bat cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib " > bat.bat - chmod 777 bat.bat + chmod 755 bat.bat ./bat.bat # copy it to any dir on path or add this dir to path mv WindowsUpdateVsVersionInfo.exe "$FUTURE_PATH_ADDITIONS" From 4fb650b4fd74aa5a8d8be784e449f24fc029726b Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 8 Nov 2024 11:29:58 +0100 Subject: [PATCH 21/21] USed better name of setupEnvAndCompile.bat instead of bat.bat --- tooling/reproducible/ReproducibleBuilds.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tooling/reproducible/ReproducibleBuilds.md b/tooling/reproducible/ReproducibleBuilds.md index 18f985270..cf5627e40 100755 --- a/tooling/reproducible/ReproducibleBuilds.md +++ b/tooling/reproducible/ReproducibleBuilds.md @@ -94,12 +94,12 @@ before the comparable_patch.sh can be run. echo " call vcvars64.bat cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib - " > bat.bat - chmod 755 bat.bat - ./bat.bat + " > setupEnvAndCompile.bat + chmod 755 setupEnvAndCompile.bat + ./setupEnvAndCompile.bat # copy it to any dir on path or add this dir to path mv WindowsUpdateVsVersionInfo.exe "$FUTURE_PATH_ADDITIONS" - rm WindowsUpdateVsVersionInfo.obj bat.bat + rm WindowsUpdateVsVersionInfo.obj setupEnvAndCompile.bat popd ```