-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix: fix kokoro windows java8 ci #2573
Merged
harshachinta
merged 4 commits into
googleapis:main
from
harshachinta:windows-java11-fix
Aug 31, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olavloite, @arpan14, @rajatbhatta
We generally update these jdk versions to latest manually, whenever a windows build fail. But do we need these explicitly getting installed and set JAVA11_HOME?
The build.sh file already sets these
JAVA8_HOME
andJAVA11_HOME
java-spanner/.kokoro/build.sh
Lines 53 to 54 in 08af671
java-spanner/.kokoro/build.sh
Lines 28 to 29 in 08af671
I compared the windows build by removing and having this and it seems it is able to capture the latest JDK by default.
With out above lines
https://screenshot.googleplex.com/8k9CiGKsgEknz8a
With above lines after updating to latest version
https://screenshot.googleplex.com/xBRpe9UXnmXjAPw
Can you please give your views here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC: @mpeddada1 for their inputs on this..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why that is explicitly being installed here. But the outcome of the build seems to indicate that we don't need it.
Also; Our JDBC driver build setup also does not include it: https://github.com/googleapis/java-spanner-jdbc/blob/main/.kokoro/build.bat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can provide a bit of context here. The graal-sdk dependency, which is used to provide native image configurations requires a minimum version of JDK 11 otherwise it results in a compilation error:
Since we still need to verify against JDK 8 for some jobs, this change was made to compile tests against JDK 11 but run them against JDK 8. This logic requires both JAVA11_HOME and JAVA8_HOME env variables to be provided so when they initially weren't included in the Windows java 8 job, we started seeing the compilation error mentioned above (#2205). IIRC, the
setJava
method only assigns thePATH
to theJAVA8_HOME
value but doesn't contain any logic to compute it.@harshachinta in the screenshot, I see that the windows tests are running in JDK 11. Are we no longer validating with JDK 8? If we're only testing with JDK 11 then we should no longer need these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshachinta Any thoughts on the last question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpeddada1
I see that we are running tests on JDK 8 and JDK 11.
java-spanner/.kokoro/build.sh
Line 26 in fbf1df9
Running on JDK 11 - https://screenshot.googleplex.com/87wspyzBrPNqRJE
Running on JDK 8 - https://screenshot.googleplex.com/uFos4MuHKEBYXNg
Note:
However, I observed that the JDK 8 and JDK 11 is already set but we are overwriting them by setting them again in the build.bat file.
java-spanner/.kokoro/build.bat
Line 20 in fbf1df9
From the below screenshot the environment variables
JAVA8_HOME
andJAVA11_HOME
are already set.https://screenshot.googleplex.com/7AUaPVjtWkS3ups
We are doing redundant work of downloading them again and in most cases leads to version mismatch due to the old version being hardcoded in the build.bat file
I think we no longer need these and can remove it.
@olavloite @mpeddada1 Can you please let me know your views on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation @harshachinta! re
I see that we are running tests on JDK 8 and JDK 11.
andthe environment variables JAVA8_HOME and JAVA11_HOME are already set
: given this observation, it looks like we no longer need these environment variables.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both @harshachinta and @mpeddada1! SGTM