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

Remove IBM-1047 export option and generate makefiles in IBM-1047 encoding for JDK21 on z/OS #608

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

psoujany
Copy link
Contributor

@psoujany psoujany commented Sep 10, 2024

This PR reverts below commit which exports IBM_JAVA_OPTIONS to IBM-1047, as this option isn't required anymore. JDK21 z/OS latest builds works fine without any options.
psoujany@28c7f76

defaultCharset of Java21 is UTF-8, TKG scripts which are generating makefiles like utils.mk, rerun.mk are getting created in UTF for 21 on z/OS causing encoding issues. Hence, changing scripts to forcefully create these makefiles in Charset.forName("IBM-1047") only for 21 on z/OS.

@psoujany psoujany marked this pull request as draft September 10, 2024 14:31
@psoujany psoujany force-pushed the revert-options branch 3 times, most recently from 52df309 to 3ed7f0a Compare December 4, 2024 13:58
@psoujany psoujany changed the title Remove -Dfile.encoding=IBM-1047 for JDK21 zOS Remove IBM-1047 export option and generate makefiles in IBM-1047 encoding for JDK21 on z/OS Dec 4, 2024
@psoujany
Copy link
Contributor Author

psoujany commented Dec 4, 2024

Verification runs on sanity.functional
z/OS
21 - Grinder_CR/27631/ - 1 known failure
17 - Grinder_CR/27632 - all passed
11 - Grinder_CR/27633 - all passed

JDK21
zLinux - Grinder_CR/27634 - 1 failure not related to the changes
LinuxAMD - Grinder_CR/27673/

JDK17 LinuxPPCLe - Grinder_CR/27674/

JDK11
AIX - Grinder_CR/27675/
Win - Grinder_CR/27676
LinuxAMD - Grinder_CR/27677

@psoujany psoujany marked this pull request as ready for review December 6, 2024 05:55
@psoujany
Copy link
Contributor Author

psoujany commented Dec 6, 2024

@llxia Could you please review this PR. Thank you.

Copy link
Contributor

@llxia llxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PP does not only revert IBM_JAVA_OPTIONS="-Dfile.encoding=IBM-1047", it sets JVM_OPTIONS=-Dfile.encoding=IBM-1047 in makefile. If this option isn't required anymore. JDK21 z/OS latest builds works fine without any options., then we do not need to set JVM_OPTIONS=-Dfile.encoding=IBM-1047

@psoujany
Copy link
Contributor Author

psoujany commented Dec 8, 2024

This PP does not only revert IBM_JAVA_OPTIONS="-Dfile.encoding=IBM-1047", it sets JVM_OPTIONS=-Dfile.encoding=IBM-1047 in makefile. If this option isn't required anymore. JDK21 z/OS latest builds works fine without any options., then we do not need to set JVM_OPTIONS=-Dfile.encoding=IBM-1047

The reason we're setting JVM_OPTIONS here, EnvDetector creates autoGenEnv.mk file for 21 it's in UTF-8. Hence added this JVM_OPTIONS. I'll remove this settings in makefile and will add check for 21 in EnvDetector.java itself.

@llxia
Copy link
Contributor

llxia commented Dec 9, 2024

This PR seems to be actively being updated. Is it ready for review? If not, please move it to draft.

@psoujany
Copy link
Contributor Author

psoujany commented Dec 9, 2024

Removed JVM_OPTIONS from makefile and added Charset.forName("IBM-1047") to create autoGenEnv.mk in ebcdic for JDK21+ on z/OS.

Verification
z/OS
21 - Grinder_CR/27875
17 - Grinder_CR/27877
11 - Grinder_CR/27878

zLinux 21 - Grinder_CR/27876

@llxia Could please review the changes. Thank you.


public Writer getWriterObject(String filetype) {
try {
if (arg.getSpec().toLowerCase().contains("zos") && (arg.getJdkVersion().matches("2\\d"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex does not work if we have a Java version 30+.

private String utilsMk;
private String rerunMk;
private List<String> ignoreOnRerunList;

public UtilsGen(Arguments arg, ModesDictionary md, List<String> ignoreOnRerunList) {
this.arg = arg;
this.md = md;
this.mg = new MkGen(arg, null, null, rerunMk, ignoreOnRerunList, ignoreOnRerunList);
Copy link
Contributor

@llxia llxia Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It doesn't seem right to initialize MkGen solely to use getWriterObject() in MkGen.java, especially when it involves setting fake parameters in MkGen.

  • getWriterObject() should be a utility function that can be utilized by all files, including EnvDetector.java.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.mg = new MkGen(arg, null, null, rerunMk, ignoreOnRerunList, ignoreOnRerunList);. It is not used.

@@ -98,7 +98,7 @@ private void parseInvalidSpec(Element modes) throws IOException {
ArrayList<String> specs = new ArrayList<String>();
int lineNum = 0;
BufferedReader reader = null;
if (arg.getSpec().toLowerCase().contains("zos")) {
if (arg.getSpec().toLowerCase().contains("zos") && !(arg.getJdkVersion().matches("2\\d"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. This regex does not work if we have a Java version 30+.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been addressed

@llxia llxia requested a review from LongyuZhang December 9, 2024 19:19
@psoujany psoujany marked this pull request as draft December 10, 2024 07:17
@psoujany
Copy link
Contributor Author

Modified scripts as suggested.

Verification jobs
JDK21 zLinux Grinder_CR/27914/ - All Passed

JDK21 z/OS - Grinder_CR/27949/
JDK17 z/OS - Grinder_CR/27950
JDK11 z/OS - Grinder_CR/27951


public static Writer writer;

public static Writer getWriterObject(String jdkVersion, String SpecInfo, String filetype) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • jdkVersion should be int, not String.
  • filetype -> fileName

import java.util.List;

import org.openj9.envInfo.Utility;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra ;

@@ -98,7 +98,7 @@ private void parseInvalidSpec(Element modes) throws IOException {
ArrayList<String> specs = new ArrayList<String>();
int lineNum = 0;
BufferedReader reader = null;
if (arg.getSpec().toLowerCase().contains("zos")) {
if (arg.getSpec().toLowerCase().contains("zos") && !(arg.getJdkVersion().matches("2\\d"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been addressed

private String utilsMk;
private String rerunMk;
private List<String> ignoreOnRerunList;

public UtilsGen(Arguments arg, ModesDictionary md, List<String> ignoreOnRerunList) {
this.arg = arg;
this.md = md;
this.mg = new MkGen(arg, null, null, rerunMk, ignoreOnRerunList, ignoreOnRerunList);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.mg = new MkGen(arg, null, null, rerunMk, ignoreOnRerunList, ignoreOnRerunList);. It is not used.

@@ -40,7 +44,7 @@ public void generateFiles() {
}

private void generateUtil() {
try (FileWriter f = new FileWriter(utilsMk)) {
try (Writer f = Utility.getWriterObject(arg.getJdkVersion(), arg.getSpec(), utilsMk)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JDK_VERSION is an optional parameter. Please ensure this works if the user does not set JDK_VERSION.

@psoujany psoujany force-pushed the revert-options branch 2 times, most recently from 0cf4b62 to 0ae6dd7 Compare December 12, 2024 10:21
@psoujany psoujany marked this pull request as ready for review December 12, 2024 10:59
@karianna karianna requested a review from llxia December 12, 2024 19:42
@psoujany
Copy link
Contributor Author

@llxia Could you please review the changes. Thank you.

@@ -98,7 +98,7 @@ private void parseInvalidSpec(Element modes) throws IOException {
ArrayList<String> specs = new ArrayList<String>();
int lineNum = 0;
BufferedReader reader = null;
if (arg.getSpec().toLowerCase().contains("zos")) {
if (arg.getSpec().toLowerCase().contains("zos") && !(arg.getJdkVersion().matches("[2-9][0-9]"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg.getJdkVersion() is still used. Please ensure #608 (comment) is addressed.

@llxia
Copy link
Contributor

llxia commented Dec 16, 2024

@psoujany Could you please clarify the purpose of this PR? Based on my observation, the zos JDK21 sanity.functional test build appears to be fine without this PR.

@psoujany
Copy link
Contributor Author

psoujany commented Dec 17, 2024

@psoujany Could you please clarify the purpose of this PR? Based on my observation, the zos JDK21 sanity.functional test build appears to be fine without this PR.

The main intention of this PR is to run JDK21 tests without using -Dfile.encoding options. Once we revert 28c7f76, TKG scripts that generates makefiles like utils.mk, rerun.mk, autoGenEnv.mk will be in ascii for JDK21 due to JEP400(default.Charset() is UTF-8). Hence, the changes proposed in this PR will force test specific makefiles to be in IBM-1047 for JDK21 and above on z/OS.

@llxia
Copy link
Contributor

llxia commented Dec 18, 2024

Thanks @psoujany. Some of the Grinder link expired. Could you rerun a non-zos Grinder? Thanks

@psoujany
Copy link
Contributor Author

Submitted 11/17/21 jobs on non-z/OS.
11 ppcle - Grinder_CR/28522/
17 zLinux - Grinder_CR/28519/
21 linuxAMD - Grinder_CR/28517/

@karianna karianna requested a review from llxia December 19, 2024 19:51
@llxia
Copy link
Contributor

llxia commented Dec 19, 2024

Grinder zos using AQA master branch failed. Is there a related change in AQA repo?

@psoujany
Copy link
Contributor Author

psoujany commented Dec 20, 2024

@llxia yes, we need to address this issue in AQA. For time being can we fix encoding of jars using .gitattributes? For verification I've used my fork with the change for z/OS. Please let me know if we can fix .gitattributes so that I can raise PR for that as well. Thank you.
adoptium/aqa-tests#5534

@llxia
Copy link
Contributor

llxia commented Dec 20, 2024

We need to ensure that the .gitattributes zOS update does not impact testing on other platforms.

@psoujany
Copy link
Contributor Author

We need to ensure that the .gitattributes zOS update does not impact testing on other platforms.

Raised a PR with the .gitattributes change adoptium/aqa-tests#5833.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants