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

Fix tests for empty strings in _setup #669

Merged
merged 1 commit into from
Feb 1, 2025
Merged

Conversation

keithc-ca
Copy link
Contributor

If a macro like OLD_JAVA_HOME expands to nothing, the resulting command (if [ ]; then ...) is considered syntactically invalid by some versions of bash. This avoids that problem by letting make evaluate the test by using $(if).

See sample failure in https://openj9-jenkins.osuosl.org/job/Test_openjdk8_j9_sanity.functional_x86-32_windows_Personal_testList_0/236/console

13:19:07  Running make 4.3
13:19:07  set TEST_ROOT to C:/Users/jenkins/workspace/Test_openjdk8_j9_sanity.functional_x86-32_windows_Personal_testList_0/aqa-tests/
13:19:07  set JDK_VERSION to 8
13:19:07  set JDK_IMPL to openj9
13:19:07  set JVM_VERSION to openjdk8-openj9
13:19:07  set JCL_VERSION to latest
13:19:07  /bin/sh: -c: line 3: syntax error: unexpected end of file
13:19:07  make[2]: *** [settings.mk:383: setup_testList] Error 1
13:19:07  make[2]: Leaving directory '/cygdrive/c/Users/jenkins/workspace/Test_openjdk8_j9_sanity.functional_x86-32_windows_Personal_testList_0/aqa-tests/TKG'
13:19:07  make[1]: *** [makefile:74: _testList] Error 2
13:19:07  make[1]: Leaving directory '/cygdrive/c/Users/jenkins/workspace/Test_openjdk8_j9_sanity.functional_x86-32_windows_Personal_testList_0/aqa-tests/TKG'
13:19:07  make: *** [parallelList.mk:8: testList_0] Error 2

If a macro like OLD_JAVA_HOME expands to nothing, the resulting
command (if [ ]; then ...) is considered syntactically invalid by
some versions of bash. This avoids that problem by letting make
evaluate the test by using $(if).

Signed-off-by: Keith W. Campbell <[email protected]>
@smlambert smlambert merged commit ec65590 into adoptium:master Feb 1, 2025
3 checks passed
@keithc-ca keithc-ca deleted the empty branch February 3, 2025 13:32
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.

3 participants