Bug 7934 - Builder always rebuilds when workbench restarted
Summary: Builder always rebuilds when workbench restarted
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 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 10389 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-21 10:08 EST by Nick Edgar CLA
Modified: 2002-03-05 16:23 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 Nick Edgar CLA 2002-01-21 10:08:55 EST
Build 20020109

Whenever I quit and come back in, build causes my project to be totally rebuilt 
from scratch, even though it attempts to read the saved state.
I have seen this problem for quite a while.

I'm using a the self-hosting plugin, but it did this even before I had this 
setup.

I generally run with autobuild off.

I can supply my workspace if it helps.
Comment 1 Philipe Mulet CLA 2002-01-22 11:34:02 EST
This is a platform known issue, sometimes the platform will give us a null 
delta instead of an empty one, causing our builder to defensively perform a 
full build.
Comment 2 John Arthorne CLA 2002-01-23 10:04:54 EST
Nick, let us know if this still happens in 20020122.  There was a tree 
serialization problem that I believe is now fixed.
Comment 3 Nick Edgar CLA 2002-01-23 15:11:05 EST
Seems to be fixed in 0123.
Comment 4 DJ Houghton CLA 2002-01-24 19:48:52 EST
Closing PR.
Comment 5 Philipe Mulet CLA 2002-01-28 06:37:13 EST
Reopening, there seems to be an issue with the new builder, it does not succeed 
to read its own build state (using straight build 20020125) under some 
undetermined circumstances.

The scenario below occured after a fresh restart, sync'up with stream, grabbed 
a few changes, and hit ctrl-B.
-------------
D:\eclipse\sdk\eclipse>D:\jdk1.4\jre\bin\java -verify -Xms100Mb -Xmx250Mb -cp 
startup.jar org.eclipse.core.launcher.UIMain -application org.
eclipse.ui.workbench -ws win32 -data D:\eclipse\workspaces\development2.0
\plugins -refresh -debug -consoleLog D:\jdk1.4
Boot URL:
    file:D:/eclipse/sdk/eclipse/plugins/org.eclipse.core.boot/boot.jar
Install URL: file:D:/eclipse/sdk/eclipse/
Debug-Options: file:D:/eclipse/sdk/eclipse/.options

Starting build of org.eclipse.jdt.core.tests
INCREMENTAL build
Compile this changed source file 
D:/eclipse/workspaces/development2.0/plugins/org.eclipse.jdt.core.tests/Eclipse 
Java Tests Compiler/org/ecl
ipse/jdt/tests/compiler/regression/InitializationTest.java
About to compile 
D:/eclipse/workspaces/development2.0/plugins/org.eclipse.jdt.core.tests/Eclipse 
Java Tests Compiler/org/eclipse/jdt/tests/c
ompiler/regression/InitializationTest.java
Skipped over unchanged class file InitializationTest.class

Starting build of org.eclipse.jdt.core
Performing full build since last saved state was not found
FULL build
About to compile 
D:/eclipse/workspaces/development2.0/plugins/org.eclipse.jdt.core/ant/org/eclips
e/jdt/core/ant/Jdtcom.java
....
Comment 6 Kent Johnson CLA 2002-01-28 13:52:06 EST
PM's state.dat file is fine.

Adding more tracing in & around state reading.
Comment 7 Kent Johnson CLA 2002-01-29 15:50:39 EST
Why is the project org.eclipse.jdt.core.tests being built before 
org.eclipse.jdt.core?

Are your project references correct?
Comment 8 Philipe Mulet CLA 2002-02-11 04:29:20 EST
Project references are now ok, and still these symptoms occur. Seems related to 
the fact that the built state cannot be read. 
Comment 9 Philipe Mulet CLA 2002-02-12 18:44:43 EST
Haven't yet reproduced it with the jdtcore 20020212.
Comment 10 Kent Johnson CLA 2002-02-25 17:01:10 EST
Finally... I think this was always there!

public Object getLastBuiltState(IProject project, IProgressMonitor monitor) {
	PerProjectInfo info = getPerProjectInfo(project);
	Object state = info.savedState;
	if (state == null && !info.triedRead) {
		info.triedRead= true;
		try {
			state = readState(project); // DID NOT SET info.state
		} catch (CoreException e) {}
	}
	return state;
}

So the first request reads the saved state but if the requesting builder did 
not set it when the build was finished, the next request would answer null.

Since builders now ask for the build state of a prereq project, it will not be 
set & thus fail the next time its project was rebuilt.
Comment 11 Kent Johnson CLA 2002-03-05 16:23:00 EST
*** Bug 10389 has been marked as a duplicate of this bug. ***