mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug 580045 - Display an error when reused launcher causes race condition
This reverts commit d01a15f013
and
fixes marker creation too.
Change-Id: I0d391c6df9ac4b17f3e5c8b6e87d5a7991fdc669
This commit is contained in:
parent
b390885211
commit
815b3f9a92
5 changed files with 26 additions and 5 deletions
|
@ -11,4 +11,5 @@ which is available at https://www.eclipse.org/legal/epl-2.0/\n\
|
||||||
\n\
|
\n\
|
||||||
SPDX-License-Identifier: EPL-2.0
|
SPDX-License-Identifier: EPL-2.0
|
||||||
extension-point.name = Tool Detection Participant
|
extension-point.name = Tool Detection Participant
|
||||||
CompileCommandsJsonParserMarker.name = JSON compilation database
|
CompileCommandsJsonParserMarker.name = JSON compilation database
|
||||||
|
CompilerBuiltinsDetectorMarker.name=Compiler Builtins Detector Problem
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<?eclipse version="3.4"?>
|
<?eclipse version="3.4"?>
|
||||||
<plugin>
|
<plugin>
|
||||||
<extension-point id="detectionParticipant" name="%extension-point.name" schema="schema/participant.exsd"/>
|
<extension-point id="detectionParticipant" name="%extension-point.name" schema="schema/participant.exsd"/>
|
||||||
"org.eclipse.cdt.jsoncdb.core.internal.ui.CompileCommandsJsonParserOptionPage">
|
|
||||||
<extension
|
<extension
|
||||||
id="CompileCommandsJsonParserMarker"
|
id="CompileCommandsJsonParserMarker"
|
||||||
name="%CompileCommandsJsonParserMarker.name"
|
name="%CompileCommandsJsonParserMarker.name"
|
||||||
|
@ -14,4 +13,10 @@
|
||||||
type="org.eclipse.core.resources.problemmarker">
|
type="org.eclipse.core.resources.problemmarker">
|
||||||
</super>
|
</super>
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension
|
||||||
|
id="CompilerBuiltinsDetectorMarker"
|
||||||
|
name="%CompilerBuiltinsDetectorMarker.name"
|
||||||
|
point="org.eclipse.core.resources.markers">
|
||||||
|
<super type="org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParserMarker"/>
|
||||||
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -132,15 +132,28 @@ public class CompilerBuiltinsDetector {
|
||||||
if (state != ICommandLauncher.COMMAND_CANCELED) {
|
if (state != ICommandLauncher.COMMAND_CANCELED) {
|
||||||
try {
|
try {
|
||||||
// check exit status
|
// check exit status
|
||||||
final int exitValue = proc.waitFor();
|
final int exitValue = proc.exitValue();
|
||||||
if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) {
|
if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) {
|
||||||
// compiler had errors...
|
// compiler had errors...
|
||||||
String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command,
|
String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command,
|
||||||
exitValue);
|
exitValue);
|
||||||
createMarker(errMsg);
|
createMarker(errMsg);
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ex) {
|
} catch (IllegalThreadStateException e) {
|
||||||
// ignore for now
|
// Bug 580045 - reused launcher race condition
|
||||||
|
String warnMsg = String.format(Messages.CompilerBuiltinsDetector_msg_unexpectedly_still_running,
|
||||||
|
command);
|
||||||
|
|
||||||
|
if (console != null) {
|
||||||
|
final ConsoleOutputStream cis = console.getInfoStream();
|
||||||
|
try {
|
||||||
|
cis.write(warnMsg.getBytes());
|
||||||
|
cis.write("\n".getBytes()); //$NON-NLS-1$
|
||||||
|
} catch (IOException ignore) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createMarker(warnMsg);
|
||||||
|
Plugin.getDefault().getLog().log(Status.warning(warnMsg, e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Messages extends NLS {
|
||||||
public static String CompilerBuiltinsDetector_errmsg_command_failed;
|
public static String CompilerBuiltinsDetector_errmsg_command_failed;
|
||||||
public static String CompilerBuiltinsDetector_msg_detection_finished;
|
public static String CompilerBuiltinsDetector_msg_detection_finished;
|
||||||
public static String CompilerBuiltinsDetector_msg_detection_start;
|
public static String CompilerBuiltinsDetector_msg_detection_start;
|
||||||
|
public static String CompilerBuiltinsDetector_msg_unexpectedly_still_running;
|
||||||
public static String DetectorConsole_title;
|
public static String DetectorConsole_title;
|
||||||
static {
|
static {
|
||||||
// initialize resource bundle
|
// initialize resource bundle
|
||||||
|
|
|
@ -14,4 +14,5 @@
|
||||||
CompilerBuiltinsDetector_errmsg_command_failed=%1$s exited with status %2$d.
|
CompilerBuiltinsDetector_errmsg_command_failed=%1$s exited with status %2$d.
|
||||||
CompilerBuiltinsDetector_msg_detection_finished=Detecting compiler built-ins took %d ms.
|
CompilerBuiltinsDetector_msg_detection_finished=Detecting compiler built-ins took %d ms.
|
||||||
CompilerBuiltinsDetector_msg_detection_start=%1$s Detecting compiler built-ins for project '%2$s'
|
CompilerBuiltinsDetector_msg_detection_start=%1$s Detecting compiler built-ins for project '%2$s'
|
||||||
|
CompilerBuiltinsDetector_msg_unexpectedly_still_running=%1$s unexpectedly still running. Detecting compiler built-ins may not have captured all built-ins.
|
||||||
DetectorConsole_title=Compiler Built-ins Detection Console
|
DetectorConsole_title=Compiler Built-ins Detection Console
|
||||||
|
|
Loading…
Add table
Reference in a new issue