Skip to content

Commit 22b0ac1

Browse files
committed
Ensure test-image-openj9 target fails when java -version fails
Previously, the exit status could come from tee, which succeeds. There is logic in make/autoconf/basics.m4 that checks for support and then opportunistically adds -o pipefail to SHELL in the makefiles, which already accomplishes the same thing, but only when pipefail support is detected. That should be most of the time, but it's not obvious that we should expect pipefail support in all cases. With this change, the target will fail whenever java -version fails, regardless of the pipefail setting.
1 parent dcef2ef commit 22b0ac1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

closed/custom/Main.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2017, 2021 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -76,7 +76,7 @@ ALL_TARGETS += debug-image
7676
test-image-openj9 : exploded-image
7777
@+$(OPENJ9_MAKE) openj9_test_image
7878
ifneq ($(COMPILE_TYPE), cross)
79-
$(JDK_OUTPUTDIR)/bin/java -version 2>&1 | $(TEE) $(TEST_IMAGE_DIR)/openj9/java-version.txt
79+
rc=0; $(JDK_OUTPUTDIR)/bin/java -version >$(TEST_IMAGE_DIR)/openj9/java-version.txt 2>&1 || rc="$$?"; $(CAT) $(TEST_IMAGE_DIR)/openj9/java-version.txt; exit "$$rc"
8080
endif
8181

8282
ALL_TARGETS += test-image-openj9

0 commit comments

Comments
 (0)