Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2003-10-07 09:29:41 -0400
committerDoug Schaefer2003-10-07 09:29:41 -0400
commit2d66790e1246642e8b7d3a5e3c4515d23ee210c7 (patch)
tree547b2e9d1d532484752b2a73bcabf5cdcc49854b
parentdd7d9b27c42692b43787ae10dcc3457b172756d5 (diff)
downloadorg.eclipse.cdt-2d66790e1246642e8b7d3a5e3c4515d23ee210c7.tar.gz
org.eclipse.cdt-2d66790e1246642e8b7d3a5e3c4515d23ee210c7.tar.xz
org.eclipse.cdt-2d66790e1246642e8b7d3a5e3c4515d23ee210c7.zip
Patch for Sean Evoy:
Fixes endless loop when doing cross project builds.
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/ChangeLog26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java4
2 files changed, 28 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
index 35655878af..a6992eb517 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
@@ -1,3 +1,29 @@
+2003-10-03 Sean Evoy
+ Fix for critical bug 44134.
+
+ The problem lies in how the makefile is generated when a build target
+ references other projects. The makefile creates a command to change to
+ the build directory of the referenced project and call $(MAKE) there, i.e.
+ cd <dep_project_build_dir>; $(MAKE) clean all
+
+ The problem arises when the directory change fails. As of RC0, the command
+ after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive
+ make call in the build directory of the build target and 'make' will keep
+ invoking more 'make's until Eclipse runs out of memory. With a manual build,
+ the user can still cancel the build. When autobuild is turned on, they cannot.
+ The only way to shut down Eclipse under that scenario is to kill it, and when
+ it restarts, autobuild is still enabled and the problem repeats.
+
+ The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
+ cd <dep_project_build_dir> && $(MAKE) clean all
+
+ When the dependencies are generated this way, the 'cd' will fail as will the
+ build. The final tweak is to ignore the 'cd' failure and allow the rest of
+ the build to continue, i.e.
+ -cd <dep_project_build_dir> && $(MAKE) clean all
+
+ * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
+
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
index b9d456ec58..2b6a11e47b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
@@ -68,7 +68,7 @@ public class MakefileGenerator {
protected static final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$
protected static final String LINEBREAK = "\\";
protected static final String NEWLINE = System.getProperty("line.separator");
- protected static final String SEMI_COLON = ";";
+ protected static final String LOGICAL_AND = "&&";
protected static final String SEPARATOR = "/";
protected static final String TAB = "\t";
protected static final String WHITESPACE = " ";
@@ -562,7 +562,7 @@ public class MakefileGenerator {
}
managedProjectOutputs.add(buildDir + SEPARATOR + depPrefix + depTarget);
}
- buffer.append(TAB + "cd" + WHITESPACE + buildDir + SEMI_COLON + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE);
+ buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE);
}
}
buffer.append(NEWLINE);

Back to the top