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

Enable windows reproducible build comparisons to Jenkins Pipelines #743

Closed
sophia-guo opened this issue Jun 30, 2023 · 11 comments · Fixed by #757
Closed

Enable windows reproducible build comparisons to Jenkins Pipelines #743

sophia-guo opened this issue Jun 30, 2023 · 11 comments · Fixed by #757
Assignees
Labels

Comments

@sophia-guo
Copy link
Contributor

Part of adoptium/temurin-build#3245, which needs to

  • Test and update reproducible compare scripts under temurin-build/tooling/
  • Update tools/reproduce_comparison/Jenkinsfile
  • Turn on enableReproducibleCompare
@sophia-guo
Copy link
Contributor Author

Signing and removing signature require signtool on windows seems adoptium windows agents do not have signtool installed. Should it be installed or we can use specific agent with signtool installed?

Also on jenkins windows agent I got the following two types errors. One is complaining modules is not a jimage file and other is not a jmod file. Both I have double check the files exist. @andrew-m-leonard any idea?

Error: not a jimage file: \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\lib\modules
Error: no jmod file found: \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\jmods\java.base.jmod

One is using jimage to expand the modules image
The other one is using jmod to expand jmods


@andrew-m-leonard
Copy link
Contributor

Signing and removing signature require signtool on windows seems adoptium windows agents do not have signtool installed. Should it be installed or we can use specific agent with signtool installed?

Also on jenkins windows agent I got the following two types errors. One is complaining modules is not a jimage file and other is not a jmod file. Both I have double check the files exist. @andrew-m-leonard any idea?

Error: not a jimage file: \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\lib\modules
Error: no jmod file found: \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\jmods\java.base.jmod

One is using jimage to expand the modules image The other one is using jmod to expand jmods


@sophia-guo that looks odd, i've only seen that error when the path was wrong

@sophia-guo
Copy link
Contributor Author

Yes, that's what I suspect. I did some echo and the files are there.
https://ci.adoptium.net/view/work-in-progress/job/Sophia_pipeline/448/console

+ ls -l /cygdrive/f/workspace/workspace/Sophia_pipeline/temurin-build/tooling/../../original/jdk-17.0.8+6/lib
total 184089
-rwxrwxr-x+ 1 jenkins None     73019 Jun 30 00:07 classlist
-rwxrwxr-x+ 1 jenkins None   8301490 Jun 30 00:07 ct.sym
-rwxrwxr-x+ 1 jenkins None      4630 Jun 30 00:07 fontconfig.bfc
-rwxrwxr-x+ 1 jenkins None     12345 Jun 30 00:07 fontconfig.properties.src
-rwxrwxr-x+ 1 jenkins None      1682 Jun 30 00:07 jawt.lib
drwxrwxr-x+ 1 jenkins None         0 Jun 30 00:07 jfr
-rwxrwxr-x+ 1 jenkins None    110513 Jun 30 00:07 jrt-fs.jar
-rwxrwxr-x+ 1 jenkins None        29 Jun 30 00:07 jvm.cfg
-rwxrwxr-x+ 1 jenkins None   1042840 Jun 30 00:07 jvm.lib
-rwxrwxr-x+ 1 jenkins None 128098045 Jun 30 00:07 modules
-rwxrwxr-x+ 1 jenkins None      3793 Jun 30 00:07 psfont.properties.ja
-rwxrwxr-x+ 1 jenkins None     11390 Jun 30 00:07 psfontj2d.properties
drwxrwxr-x+ 1 jenkins None         0 Jun 30 00:07 security
-rwxrwxr-x+ 1 jenkins None  50698817 Jun 30 00:07 src.zip
-rwxrwxr-x+ 1 jenkins None    103785 Jun 30 00:07 tzdb.dat
-rwxrwxr-x+ 1 jenkins None     22143 Jun 30 00:07 tzmappings
+ ls -l /cygdrive/f/workspace/workspace/Sophia_pipeline/temurin-build/tooling/../../original/jdk-17.0.8+6/jmods
total 74984
-rwxrwxr-x+ 1 jenkins None 19655369 Jun 30 00:06 java.base.jmod
-rwxrwxr-x+ 1 jenkins None   130570 Jun 30 00:04 java.compiler.jmod
...

The only difference between the path is one is using backslash and the other one is using foreward slash.

@sophia-guo
Copy link
Contributor Author

Do the jimage and jmod command in the base directory of the modules and jmod will not get this issue, e.g

cd \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\lib\
jimage extract --dir "modules_extracted" "modules"

cd \cygdrive\f\workspace\workspace\Sophia_pipeline\temurin-build\tooling\..\..\original\jdk-17.0.8+6\jmods\
jmod  extract --dir "${expand_dir}" "java.base.jmod"

@sophia-guo
Copy link
Contributor Author

signtool installed with window 10 sdk https://github.com/adoptium/infrastructure/blob/9c7b1e1d26395098459dbcc7e5e54cc6e1d5f9a4/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/WiX/tasks/main.yml

Explicitly set signtool path signToolPath="/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x64/signtool.exe"

Remove signature "$signToolPath" remove /s /v $f got

Removing signature from /cygdrive/e/jenkins/workspace/Sophia_pipeline/temurin-build/tooling/../../original/jdk-17.0.8+6/bin/jabswitch.exe
SignTool Error: Missing filename.
  ==> /cygdrive/e/jenkins/workspace/Sophia_pipeline/temurin-build/tooling/../../original/jdk-17.0.8+6/bin/jabswitch.exe contains no signature

Sign signature with generated openssl certificate alway failed.

@andrew-m-leonard
Copy link
Contributor

@sophia-guo I remember having to update my PATH to find signtool on my test Windows server, so above looks correct.

For: SignTool Error: Missing filename.
Try putting the $f in quotes? eg:

"$signToolPath" remove /s /v "$f"

@sophia-guo
Copy link
Contributor Author

Quotes doesn't work either. Same issue with jmod and jimage. If cd the folder of the file and do the command works.

@sophia-guo
Copy link
Contributor Author

From cygwin any paths pass to windows program jmod, jimage, signtool need to be in Windows (not cygwin) format. Need use cygpath to convert the path.

@sophia-guo
Copy link
Contributor Author

Tried openssl to create self-signed certificates and works.

  openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout $selfCert.key -out $selfCert.crt -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:*.example.com,IP:10.0.0.1"
  openssl pkcs12 -export -passout pass:test -out $selfCert.pfx -inkey $selfCert.key -in $selfCert.crt

@sophia-guo
Copy link
Contributor Author

Interesting in jenkins windows using jmod and jimage to extract and nothing get extracted and return code is zero. In local windows cygwin no similar issue.
@andrew-m-leonard any suggestion?

@sophia-guo
Copy link
Contributor Author

Turns out the option --dir also need window path, otherwise the command succeeds with unexpected directory(slash removed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants