Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ReproducibleBuilds.md with cygwin details #3973

Merged
merged 26 commits into from
Nov 11, 2024
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
20feacc
Update ReproducibleBuilds.md with cygwin details
judovana Oct 4, 2024
c2cbbca
Mentioned that jdk use don path must not be jdk whichis being patched
judovana Oct 4, 2024
12437e5
Mentioned also classpath
judovana Oct 4, 2024
7f9cbf9
Fixing markup lint
judovana Oct 7, 2024
6eb7990
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
f8d8074
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
b3b8934
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
b6efaac
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
164dfc7
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
8c58dff
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
9cbc886
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
6cd4bc3
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
6c6479c
Update tooling/reproducible/ReproducibleBuilds.md
judovana Oct 8, 2024
b5e7e17
Merge branch 'master' into comparableReadmeUpdate
judovana Oct 8, 2024
8f8492b
Merge branch 'adoptium:master' into comparableReadmeUpdate
judovana Oct 9, 2024
d1d5614
removed surpassed 777 from ReproducibleBuilds.md
judovana Oct 9, 2024
7e660c9
Update tooling/reproducible/ReproducibleBuilds.md
karianna Oct 10, 2024
b57ac2f
Update tooling/reproducible/ReproducibleBuilds.md
karianna Oct 10, 2024
9597d5d
Merge branch 'master' into comparableReadmeUpdate
judovana Oct 10, 2024
1b2f20e
Removed full example f extracting the the properties out of vm
judovana Oct 14, 2024
ed9b935
Merge branch 'master' into comparableReadmeUpdate
judovana Oct 25, 2024
96b53b0
Simplifed cygwin paths from bash example to formated text.
judovana Oct 25, 2024
146fb5c
Minor comsetic alilgnement
judovana Oct 25, 2024
c75e3c8
Fixed permissions to 755
judovana Nov 8, 2024
4fb650b
USed better name of setupEnvAndCompile.bat instead of bat.bat
judovana Nov 8, 2024
85c4ad9
Merge branch 'master' into comparableReadmeUpdate
judovana Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions tooling/reproducible/ReproducibleBuilds.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ 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 INCLUDES manually but it is not worthy
- 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) :

- Ensure suitable JDK on PATH
- **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

Expand All @@ -79,17 +83,55 @@ before the comparable_patch.sh can be run.
- For BinRepl.class : export CLASSPATH=<temurin-build>/tooling/src/java:$CLASSPATH
- A JDK for running BinRepl java : export PATH=<jdk>/bin:$PATH

##### 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 preferably by an executable `.bat` file such as:

```bash
pushd "$MSVSC/BUILD/TOOLS"
judovana marked this conversation as resolved.
Show resolved Hide resolved
rm -f WindowsUpdateVsVersionInfo.obj
echo "
call vcvars64.bat
cl $(cygpath -m $YOUR_WORKDIR/temurin-build/tooling/src/c/WindowsUpdateVsVersionInfo.c) version.lib
" > bat.bat
karianna marked this conversation as resolved.
Show resolved Hide resolved
judovana marked this conversation as resolved.
Show resolved Hide resolved
chmod 777 bat.bat
judovana marked this conversation as resolved.
Show resolved Hide resolved
./bat.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
popd
```

- 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`,
- 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"
```

#### Running comparable_patch.sh:

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.

2. Run comparable_patch.sh

```bash
bash comparable_patch.sh --jdk-dir "<jdk_home_dir>" --version-string "<version_str>" --vendor-name "<vendor_name>" --vendor_url "<vendor_url>" --vendor-bug-url "<vendor_bug_url>" --vendor-vm-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:
Expand All @@ -101,7 +143,9 @@ java -XshowSettings:
...
```

eg.
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.,:

```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"
Expand Down
Loading