Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: 1. new java project "test1" 2. new class "test1" (some crap 'public static int foo=1;') 3. project->properties->builders->new->program->ok 4. on 'main' tab, use '/bin/ls' or other output generating program for 'location' 5. on 'build options' tab, select only 'after a clean' 6. click ok 7. the builder runs immediately 8. project->clean->ok 9. the builder doesn't run 10. change the class 11. the builder doesn't run 12. project->clean->ok 13. the builder doesn't run eg. the builder doesn't run after a clean like it's supposed to More information:
Shouldn't this be moved to Platform/Resources since the Java builder is not involved here ?
This is not JDT.
I can see the same behavior in 3.4M2 too.
I have the same problem in 3.3 (and 3.3.1 and 3.3.2), but not 3.2.x, although my case is with Ant builders. Could this be considered for fixing in the 3.3.x line? (I assume the "version 3.4" status of the bug means it is not at this point.) I tried to debug this. I found that the build that is triggered after a clean is an incremental build (which seems to be transformed into auto, if that option is on). In version 3.2, this code in BuildManager converts it to a full build, and so the "after clean" build is triggered: if (!clean && lastBuiltTree == null) trigger = IncrementalProjectBuilder.FULL_BUILD; In 3.3, there is similar code: if (!clean && currentLastBuiltTree == null) trigger = IncrementalProjectBuilder.FULL_BUILD; but, the currentLastBuiltTree is non-null, and so the build remains incremental (or auto) and does not trigger the "after clean" builder. Is the tree supposed to be null? Does it make sense that the build is initially triggered as incremental instead of full? Is there some other way of manually initiating a full build of a project(s), which could be used as a work-around?
I tried experimenting with changing the build performed after a clean to full and it fixed the problem - at least when auto build is off. When auto build is on, however, it doesn't help. It seems I was mistaken when I said previously that an incremental build is transformed into an auto build when that option is on. Instead, it seems that no build at all is triggered after a clean when auto build is on, and it is just the standard auto build kicking in. Of course, I am sure that changing this to full build is not the right approach, and would probably cause serious problems elsewhere, since it always worked with incremental and auto builds in the past, and that the real issue is why the delta tree is now non-null. If this is not a priority for fixing soon, I would appreciate even just some suggestions for further analysis, as this bug is causing me a lot of pain.
This seems to be the same as bug 182781, but that bug is marked as having been fixed. I have a patch that solved the problem for me, which I will try to attach.
Created attachment 84692 [details] BuildManager patch This patch clears the builder's delta state when a clean is performed. As a result, the incremental/auto build that follows the clean will become a full build and the "build after clean" builder will be triggered.
Yes, this is a regression caused by the fix for bug 182781. A simpler fix may be to move the if (!builder.getCommand().isBuilding(trigger)) statement into the try/finally, since the finally block ensures the build state is discarded on clean.
If the "if isbuilding" statement were moved inside the try/finally, wouldn't the delta state be updated for all build types, instead of just for clean, and result in a regression of bug 173931, as described in bug 182781? Unless, an explicit check were added to the finally block to not touch the delta state if "not doing a clean and the builder is not being invoked", in which case, it would be simpler to leave the "if isbuilding" outside the try/finally and do the check there, as in my patch.
Created attachment 87153 [details] Fix 01
Created attachment 87417 [details] Proposal 02 It is just a proposal. FULL_BUILD will be triggered during a manual/auto build only if the builder doesn't respond to INCREMENTAL_BUILD/AUTO_BUILD trigger.
Created attachment 87424 [details] Proposal 02
Created attachment 87431 [details] Proposal 02
Fix released. I ended up going with Isaac's patch to BuildManager, and the JUnit tests from Szymon's proposal 02. Thanks all.
Verified in I20080205-0010.
This seems broken again in Kepler (SR2). Can somebody look into it?