This is a modified patch that takes into account hotspot tests:
diff -r 355349babaf4 test/TestCommon.gmk
--- a/test/TestCommon.gmk Wed Sep 27 16:47:07 2017 -0700
+++ b/test/TestCommon.gmk Thu Sep 28 10:47:00 2017 +0100
@@ -273,7 +273,7 @@
prep:
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
@$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
- @if [ ! -d $(TEST_ROOT)/../.hg ] ;
then \
+ @if [ ! -d $(TEST_ROOT)/../../.hg ] && [ ! -d
$(TEST_ROOT)/../../../.hg ]; then \
$(FIND) $(TEST_ROOT) \( -name \*.dll -o -name \*.DLL -o -name
\*.so \) \
-exec $(CHMOD) a+rx {} \;
; \
fi
I've run a find for all test roots and got this:
test/langtools/TEST.ROOT
test/failure_handler/test/TEST.ROOT
test/jaxp/TEST.ROOT
test/nashorn/TEST.ROOT
test/hotspot/jtreg/TEST.ROOT
test/jdk/TEST.ROOT
So, it seems like we should cover all cases with the test above (albeit
still a bit uncomfortable with the idea that this patch would
potentially peek outside the repo).
Maurizio
On 28/09/17 10:27, Maurizio Cimadamore wrote:
On 28/09/17 10:25, Erik Joelsson wrote:
I think you need to also check for "../../../.hg" as the relative
path from the hotspot test root is one level deeper than the other
repositories. The hotspot tests are probably free of such binaries,
but even so we should avoid running this when not needed.
Isn't that too fragile? What if I'm running jdk tests but my repo is
nested inside some other repo?
Maurizio
/Erik
On 2017-09-28 10:49, Maurizio Cimadamore wrote:
Hi,
this fixes the problem of the build changing permissions on some
library files when executing tests [1, 2].
The issue is that a relative path in TestCommon is bogus - jdk tests
are now executed in the folder test/jdk, so there's no longer hg
repo under ../
Patch inline below:
diff -r 355349babaf4 test/TestCommon.gmk
--- a/test/TestCommon.gmk Wed Sep 27 16:47:07 2017 -0700
+++ b/test/TestCommon.gmk Thu Sep 28 09:44:09 2017 +0100
@@ -273,7 +273,7 @@
prep:
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
@$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
- @if [ ! -d $(TEST_ROOT)/../.hg ] ;
then \
+ @if [ ! -d $(TEST_ROOT)/../../.hg ] ;
then \
$(FIND) $(TEST_ROOT) \( -name \*.dll -o -name \*.DLL -o -name
\*.so \) \
-exec $(CHMOD) a+rx {} \;
; \
fi
Cheers
Maurizio
[1] -
http://mail.openjdk.java.net/pipermail/build-dev/2017-September/019796.html
[2] - https://bugs.openjdk.java.net/browse/JDK-8188090