Bug 5109 - Adding project doesn't fix build errors
Summary: Adding project doesn't fix build errors
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-19 10:57 EDT by John Arthorne CLA
Modified: 2002-01-14 11:59 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2001-10-19 10:57:03 EDT
If I have projects that depend on a missing project, they don't get correctly 
recompiled after adding that required project.  For example:

1) I load our test suite projects into the workspace
2) Since JUnit project is missing, there are thousands of build errors
3) I "Add to workspace" JUnit from the repository
4) The build errors are not fixed
5) Full build all projects -> errors get fixed.

Incremental build should be able to handle this case...
Comment 1 John Arthorne CLA 2001-10-19 12:01:50 EDT
I wonder if this is related to the change in builder behaviour in the new drop?  
At the end of a build, the java builder requests which projects it wants deltas 
for next time.  If the java builder is not requesting projects on the build path 
that don't exist (in my example, JUnit project), then it won't be invoked when 
the JUnit project gets added.  If this is what's happening, the fix is to 
request deltas for all projects on the build path, whether they exist or not.
Comment 2 Philipe Mulet CLA 2001-10-19 12:37:54 EDT
From KJ:

This is one of the cases I was talking about yesterday... if I remember a 
project's classpath without the missing prereq project then when its added I 
immediately do a full build.

If I do not notice that a prereq project or an external jar doesn't exist, then 
I end up with the current behaviour.
===========

The #resolve and #expanded classpath should filter out offending entries

Comment 3 Philipe Mulet CLA 2001-10-22 05:11:02 EDT
From KJ

I also need JavaProject to answer getRequiredProjects() & it MUST include the 
missing ones.
Comment 4 Philipe Mulet CLA 2001-10-22 05:18:04 EDT
I do not think the builder should need to know about deltas in added previously 
missing projects. This should be discovered as a major classpath changes.

Also, the existing infrastructure requires project prerequisites to be passed 
as a collection of IProject, which makes it hard to use for missing ones.
Comment 5 John Arthorne CLA 2001-10-22 14:27:10 EDT
I'm trying to keep the builder behaviour as simple and consistent as possible.  
The rules about when a builder gets invoked are not set in stone (yet), but I 
want to avoid having special cases.  Current behaviour is: a builder is only 
invoked if there is a change to a project that it has declared an interest in.

I'm open to the idea of invoking builders for other situations (such as for 
all added and removed projects), but only if there is a compelling reason.  In 
the case of the java builder, it knows what projects the user has specified on 
the source path, so it should be able to provide them to us, whether they exist 
or not.  It seems easy to create instances of IProject for non-existent 
projects on the classpath, and return them from the build() method.
Comment 6 Philipe Mulet CLA 2001-11-14 10:25:10 EST
Should check with new builder
Comment 7 Kent Johnson CLA 2001-12-10 17:07:16 EST
The new builder includes missing projects in its list of dependent projects.