mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-30 21:55:31 +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\
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
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"?>
|
||||
<plugin>
|
||||
<extension-point id="detectionParticipant" name="%extension-point.name" schema="schema/participant.exsd"/>
|
||||
"org.eclipse.cdt.jsoncdb.core.internal.ui.CompileCommandsJsonParserOptionPage">
|
||||
<extension
|
||||
id="CompileCommandsJsonParserMarker"
|
||||
name="%CompileCommandsJsonParserMarker.name"
|
||||
|
@ -14,4 +13,10 @@
|
|||
type="org.eclipse.core.resources.problemmarker">
|
||||
</super>
|
||||
</extension>
|
||||
<extension
|
||||
id="CompilerBuiltinsDetectorMarker"
|
||||
name="%CompilerBuiltinsDetectorMarker.name"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParserMarker"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -132,15 +132,28 @@ public class CompilerBuiltinsDetector {
|
|||
if (state != ICommandLauncher.COMMAND_CANCELED) {
|
||||
try {
|
||||
// check exit status
|
||||
final int exitValue = proc.waitFor();
|
||||
final int exitValue = proc.exitValue();
|
||||
if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) {
|
||||
// compiler had errors...
|
||||
String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command,
|
||||
exitValue);
|
||||
createMarker(errMsg);
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
// ignore for now
|
||||
} catch (IllegalThreadStateException e) {
|
||||
// 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 {
|
||||
|
|
|
@ -22,6 +22,7 @@ class Messages extends NLS {
|
|||
public static String CompilerBuiltinsDetector_errmsg_command_failed;
|
||||
public static String CompilerBuiltinsDetector_msg_detection_finished;
|
||||
public static String CompilerBuiltinsDetector_msg_detection_start;
|
||||
public static String CompilerBuiltinsDetector_msg_unexpectedly_still_running;
|
||||
public static String DetectorConsole_title;
|
||||
static {
|
||||
// initialize resource bundle
|
||||
|
|
|
@ -14,4 +14,5 @@
|
|||
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_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
|
||||
|
|
Loading…
Add table
Reference in a new issue