mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Apply patch for Bugzilla 123302 - NPE in ErrorParserManager during build
Apply patch for Bugzilla 123497 - Project with multiple dependencies fails to build: "no rule for target" Fix problem with tool 'copy' constructor not copying commandLinePattern Fix bugzilla 117311 - QT / MOC compiler and CDT
This commit is contained in:
parent
e600743f89
commit
636fd2d51a
3 changed files with 31 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2005 IBM Corporation and others.
|
* Copyright (c) 2002, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -369,6 +369,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
if (refDelta == null) {
|
if (refDelta == null) {
|
||||||
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
|
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
|
||||||
incrementalBuild(delta, info, generator, monitor);
|
incrementalBuild(delta, info, generator, monitor);
|
||||||
|
// Should only build this project once, for this delta
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
int refKind = refDelta.getKind();
|
int refKind = refDelta.getKind();
|
||||||
if (refKind != IResourceDelta.NO_CHANGE) {
|
if (refKind != IResourceDelta.NO_CHANGE) {
|
||||||
|
@ -377,6 +379,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
refFlags == IResourceDelta.OPEN)) {
|
refFlags == IResourceDelta.OPEN)) {
|
||||||
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
|
outputTrace(getProject().getName(), "Incremental build because of changed referenced project"); //$NON-NLS-1$
|
||||||
incrementalBuild(delta, info, generator, monitor);
|
incrementalBuild(delta, info, generator, monitor);
|
||||||
|
// Should only build this project once, for this delta
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -794,8 +798,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
String[] errorParsers = info.getDefaultConfiguration().getErrorParserList();
|
String[] errorParsers = info.getDefaultConfiguration().getErrorParserList();
|
||||||
ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectory, this, errorParsers);
|
ErrorParserManager epm = new ErrorParserManager(getProject(), workingDirectory, this, errorParsers);
|
||||||
epm.setOutputStream(consoleOutStream);
|
epm.setOutputStream(consoleOutStream);
|
||||||
OutputStream stdout = epm.getOutputStream();
|
// This variable is necessary to ensure that the EPM stream stay open
|
||||||
OutputStream stderr = epm.getOutputStream();
|
// until we explicitly close it. See bug#123302.
|
||||||
|
OutputStream epmOutputStream = epm.getOutputStream();
|
||||||
|
|
||||||
// Get the arguments to be passed to make from build model
|
// Get the arguments to be passed to make from build model
|
||||||
ArrayList makeArgs = new ArrayList();
|
ArrayList makeArgs = new ArrayList();
|
||||||
|
@ -844,7 +849,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
proc.getOutputStream().close();
|
proc.getOutputStream().close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
if (launcher.waitAndRead(stdout, stderr,
|
if (launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
|
||||||
new SubProgressMonitor(monitor,
|
new SubProgressMonitor(monitor,
|
||||||
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
|
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
|
||||||
errMsg = launcher.getErrorMessage();
|
errMsg = launcher.getErrorMessage();
|
||||||
|
@ -873,9 +878,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
// Write message on the console
|
// Write message on the console
|
||||||
consoleOutStream.write(buf.toString().getBytes());
|
consoleOutStream.write(buf.toString().getBytes());
|
||||||
consoleOutStream.flush();
|
consoleOutStream.flush();
|
||||||
|
epmOutputStream.close();
|
||||||
consoleOutStream.close();
|
consoleOutStream.close();
|
||||||
stdout.close();
|
|
||||||
stderr.close();
|
|
||||||
} else {
|
} else {
|
||||||
// The status value was other than 0, so press on with the build process
|
// The status value was other than 0, so press on with the build process
|
||||||
makeArgs.add("pre-build"); //$NON-NLS-1$
|
makeArgs.add("pre-build"); //$NON-NLS-1$
|
||||||
|
@ -915,7 +919,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (launcher.waitAndRead(stdout, stderr,
|
if (launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
|
||||||
new SubProgressMonitor(monitor,
|
new SubProgressMonitor(monitor,
|
||||||
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
|
IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) {
|
||||||
errMsg = launcher.getErrorMessage();
|
errMsg = launcher.getErrorMessage();
|
||||||
|
@ -957,8 +961,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
// Write message on the console
|
// Write message on the console
|
||||||
consoleOutStream.write(buf.toString().getBytes());
|
consoleOutStream.write(buf.toString().getBytes());
|
||||||
consoleOutStream.flush();
|
consoleOutStream.flush();
|
||||||
stdout.close();
|
epmOutputStream.close();
|
||||||
stderr.close();
|
|
||||||
|
|
||||||
// Generate any error markers that the build has discovered
|
// Generate any error markers that the build has discovered
|
||||||
monitor.subTask(ManagedMakeMessages
|
monitor.subTask(ManagedMakeMessages
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
* Copyright (c) 2003, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -335,6 +335,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
if (tool.command != null) {
|
if (tool.command != null) {
|
||||||
command = new String(tool.command);
|
command = new String(tool.command);
|
||||||
}
|
}
|
||||||
|
if (tool.commandLinePattern != null) {
|
||||||
|
commandLinePattern = new String(tool.commandLinePattern);
|
||||||
|
}
|
||||||
if (tool.inputExtensions != null) {
|
if (tool.inputExtensions != null) {
|
||||||
inputExtensions = new ArrayList(tool.inputExtensions);
|
inputExtensions = new ArrayList(tool.inputExtensions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2056,29 +2056,28 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
*/
|
*/
|
||||||
protected void addToBuildVar (LinkedHashMap buildVarToRuleStringMap, String ext,
|
protected void addToBuildVar (LinkedHashMap buildVarToRuleStringMap, String ext,
|
||||||
String varName, String relativePath, IPath sourceLocation, boolean generatedSource) {
|
String varName, String relativePath, IPath sourceLocation, boolean generatedSource) {
|
||||||
// look for the extension in the map
|
List varList = null;
|
||||||
if (varName == null) {
|
if (varName == null) {
|
||||||
|
// Get the proper source build variable based upon the extension
|
||||||
varName = getSourceMacroName(ext).toString();
|
varName = getSourceMacroName(ext).toString();
|
||||||
// Add the resource to the list of all resources associated with a variable.
|
varList = (List)buildSrcVars.get(varName);
|
||||||
List varList = (List)buildSrcVars.get(varName);
|
} else {
|
||||||
|
varList = (List)buildOutVars.get(varName);
|
||||||
|
}
|
||||||
|
// Add the resource to the list of all resources associated with a variable.
|
||||||
|
// Do not allow duplicates - there is no reason to and it can be 'bad' -
|
||||||
|
// e.g., having the same object in the OBJS list can cause duplicate symbol errors from the linker
|
||||||
|
if ((varList != null) && !(varList.contains(sourceLocation))) {
|
||||||
// Since we don't know how these files will be used, we store them using a "location"
|
// Since we don't know how these files will be used, we store them using a "location"
|
||||||
// path rather than a relative path
|
// path rather than a relative path
|
||||||
varList.add(sourceLocation);
|
varList.add(sourceLocation);
|
||||||
} else {
|
if (!buildVarToRuleStringMap.containsKey(varName)) {
|
||||||
// Add the resource to the list of all resources associated with a variable.
|
// TODO - is this an error?
|
||||||
List varList = (List)buildOutVars.get(varName);
|
} else {
|
||||||
if (varList != null) {
|
// Add the resource name to the makefile line that adds resources to the build variable
|
||||||
// Since we don't know how these files will be used, we store them using a "location"
|
addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation, generatedSource);
|
||||||
// path rather than a relative path
|
|
||||||
varList.add(sourceLocation);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!buildVarToRuleStringMap.containsKey(varName)) {
|
|
||||||
// TODO - is this an error?
|
|
||||||
} else {
|
|
||||||
// Add the resource name to the makefile line that adds resources to the build variable
|
|
||||||
addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation, generatedSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue