8143296: javac-server/sjavac not compatible with LogFailures on Windows

Reviewed-by: ihse
This commit is contained in:
Erik Joelsson 2015-11-24 15:36:32 +01:00
parent 4fd76c3c0f
commit 49c8a97fbc
8 changed files with 80 additions and 30 deletions

View File

@ -423,7 +423,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
AC_MSG_ERROR([fixpath did not work!])
fi
AC_MSG_RESULT([yes])
FIXPATH_DETACH_FLAG="--detach"
fi
AC_SUBST(FIXPATH)
AC_SUBST(FIXPATH_DETACH_FLAG)
])

View File

@ -375,6 +375,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
AC_SUBST(JAVA_FLAGS_BIG)
# By default, the main javac compilations use big
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
AC_SUBST(JAVA_FLAGS_JAVAC)
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])

View File

@ -347,4 +347,10 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
AC_MSG_CHECKING([whether to use javac server])
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
AC_SUBST(ENABLE_JAVAC_SERVER)
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
# resources.
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
fi
])

View File

@ -638,6 +638,7 @@ SJAVAC_SERVER_JAVA_FLAGS
SJAVAC_SERVER_JAVA
JAVA_TOOL_FLAGS_SMALL
JAVA_FLAGS_SMALL
JAVA_FLAGS_JAVAC
JAVA_FLAGS_BIG
JAVA_FLAGS
JOBS
@ -679,6 +680,7 @@ MSVCP_DLL
MSVCR_DLL
LIBCXX
STATIC_CXX_SETTING
FIXPATH_DETACH_FLAG
FIXPATH
GCOV_ENABLED
ZIP_DEBUGINFO_FILES
@ -4610,7 +4612,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1446762265
DATE_WHEN_GENERATED=1448375773
###############################################################################
#
@ -45488,12 +45490,15 @@ $as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FIXPATH_DETACH_FLAG="--detach"
fi
# Check if X11 is needed
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
# No X11 support on windows or macosx
@ -54791,6 +54796,9 @@ $as_echo "$boot_jdk_jvmargs_big" >&6; }
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
# By default, the main javac compilations use big
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command for small workloads" >&5
$as_echo_n "checking flags for boot jdk java command for small workloads... " >&6; }
@ -54967,6 +54975,12 @@ $as_echo_n "checking whether to use javac server... " >&6; }
$as_echo "$ENABLE_JAVAC_SERVER" >&6; }
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
# resources.
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
fi
# Can the C/C++ compiler use precompiled headers?

View File

@ -424,6 +424,7 @@ STRIPFLAGS:=@STRIPFLAGS@
JAVA_FLAGS:=@JAVA_FLAGS@
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
@ -440,13 +441,15 @@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
# it possible to override only the *_CMD variables.
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
JAVAC=@FIXPATH@ $(JAVAC_CMD)
JAVAH=@FIXPATH@ $(JAVAH_CMD)
JAR=@FIXPATH@ $(JAR_CMD)
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
# A specific java binary with specific options can be used to run
# the long running background sjavac servers and other long running tasks.
SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAGS)
SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
$(SJAVAC_SERVER_JAVA_FLAGS)
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
# overriding that value by using ?=.

View File

@ -358,10 +358,13 @@ int main(int argc, char const ** argv)
char *line;
char *current;
int i, cmd;
DWORD exitCode;
DWORD exitCode = 0;
DWORD processFlags = 0;
BOOL processInheritHandles = TRUE;
BOOL waitForChild = TRUE;
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
exit(0);
}
@ -386,7 +389,22 @@ int main(int argc, char const ** argv)
exit(-1);
}
i = 2;
if (argv[2][0] == '-') {
if (strcmp(argv[2], "--detach") == 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath in detached mode\n");
}
processFlags |= DETACHED_PROCESS;
processInheritHandles = FALSE;
waitForChild = FALSE;
} else {
fprintf(stderr, "fixpath Unknown argument: %s\n", argv[2]);
exit(-1);
}
i = 3;
} else {
i = 2;
}
// handle assignments
while (i < argc) {
@ -428,6 +446,10 @@ int main(int argc, char const ** argv)
while (i < argc) {
char const *replaced = replace_cygdrive(argv[i]);
if (replaced[0] == '@') {
if (waitForChild == FALSE) {
fprintf(stderr, "fixpath Cannot use @-files in detached mode: %s\n", replaced);
exit(1);
}
// Found at-file! Fix it!
replaced = fix_at_file(replaced);
}
@ -480,8 +502,8 @@ int main(int argc, char const ** argv)
line,
0,
0,
TRUE,
0,
processInheritHandles,
processFlags,
NULL,
NULL,
&si,
@ -492,24 +514,30 @@ int main(int argc, char const ** argv)
exit(126);
}
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &exitCode);
if (waitForChild == TRUE) {
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &exitCode);
if (getenv("DEBUG_FIXPATH") != NULL) {
for (i=0; i<num_files_to_delete; ++i) {
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
files_to_delete[i]);
if (getenv("DEBUG_FIXPATH") != NULL) {
for (i=0; i<num_files_to_delete; ++i) {
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
files_to_delete[i]);
}
} else {
for (i=0; i<num_files_to_delete; ++i) {
remove(files_to_delete[i]);
}
}
if (exitCode != 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath exit code %d\n",
exitCode);
}
}
} else {
for (i=0; i<num_files_to_delete; ++i) {
remove(files_to_delete[i]);
}
}
if (exitCode != 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath exit code %d\n",
exitCode);
fprintf(stderr, "fixpath Not waiting for child process");
}
}

View File

@ -287,13 +287,6 @@ else # $(HAS_SPEC)=true
BUILD_LOG_WRAPPER := $(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)
# Disable the build log wrapper on sjavac+windows until
# we have solved how to prevent the log wrapper to wait
# for the background sjavac server process.
ifeq ($(ENABLE_SJAVAC)X$(OPENJDK_BUILD_OS),yesXwindows)
LOG_NOFILE := true
endif
# Sanity check the spec file, so it matches this source code
define CheckSpecSanity
ifneq ($$(ACTUAL_TOPDIR), $$(TOPDIR))

View File

@ -63,7 +63,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
# The generate new bytecode javac setup uses the new compiler to compile for the
# new jdk. This new bytecode might only be possible to run using the new jvm.
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
JVM := $(JAVA), \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
FLAGS := -source 9 -target 9 \
-encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
@ -73,7 +73,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
# The generate new bytecode javac setup uses the new compiler to compile for the
# new jdk. This new bytecode might only be possible to run using the new jvm.
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
JVM := $(JAVA), \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
FLAGS := -source 9 -target 9 \
-encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \