Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314015 - Includes path doesn't take until restart
Summary: Includes path doesn't take until restart
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: Doug Schaefer CLA
QA Contact: Andrew Gvozdev CLA
URL:
Whiteboard:
Keywords:
: 314032 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-22 10:14 EDT by Doug Schaefer CLA
Modified: 2010-06-01 10:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Schaefer CLA 2010-05-22 10:14:53 EDT
I have defined a tool chain for Android now (previously I was using the default toolchain). It's now using per file per language discovery which appears to be slightly different, but I haven't figured out how yet.

The PerFileSICollector is properly picking up the include paths, but the new scanner info doesn't seem to get registered properly. When I restart the workspace or close and reopen the project, the scanner info does get properly registered as it deserializes the .sc file.

So it seems the build path isn't working where the deserialize is. I need to make them behave the same.

My current debugging has me at PerFileSICollector.updateScannerConfiguration which does call updateDiscoveredInfo with the right pathInfo. Need to dive into that.
Comment 1 Doug Schaefer CLA 2010-05-22 10:29:27 EDT
Ah, the updateDiscoveredInfo is what serializes the .sc file. It's fine. I did notice there were no listeners to the change events there. I also noticed that PERFORM_CORE_UPDATE is turned off in the scanner config builder. Digging more...
Comment 2 Doug Schaefer CLA 2010-05-22 10:42:23 EDT
The core update is another red herring since that seems to be for the .cproject file and scanner info doesn't go there.

I need to figure out how the discovered info gets into the system. It isn't happening at build time in my set up. It is during deserialize. Need to go there next.
Comment 3 James Blackburn CLA 2010-05-22 11:10:32 EDT
I'm not in front of a computer... But I seem to remember that scanner discovery hooks off the project description model and loads during the project LOADED event. Check out who extends icprojecrdescriptionlistener, I bet you'll find SD involved somehow.
Comment 4 Doug Schaefer CLA 2010-05-22 21:14:17 EDT
It doesn't look like anyone implements IDiscoveredInfoListener.  Did someone remove them? Or were there never any.
Comment 5 Doug Schaefer CLA 2010-05-22 22:09:03 EDT
(In reply to comment #3)
> I'm not in front of a computer... But I seem to remember that scanner discovery
> hooks off the project description model and loads during the project LOADED
> event. Check out who extends icprojecrdescriptionlistener, I bet you'll find SD
> involved somehow.

Nope, I put a breakpoint in the getIncludes method of the CCommandDSC and on project open, it only happens as a side affect of first time someone gets a project description which causes the load of the path info.

I just tried adding a path in my makefile. The change didn't get registered then either. There doesn't seem to be any change management in the per file stuff.
Comment 6 Doug Schaefer CLA 2010-05-22 22:52:00 EDT
Now this is pretty bad.

I tried a Makefile project on Linux with the standard per project discovery and tried adding a non-builtin directory outside of the workspace to the include path. It never gets added to the discovery info. I see it in the .sc file but there's a lot of crap in there.

I was hoping it was working and would show me how to notify the project model of the path change.
Comment 7 Doug Schaefer CLA 2010-05-31 16:08:38 EDT
Back to debugging and recording what I'm finding.

Just took a look at the indexer side of things, ITranslationUnit.getAST(), and find that, even though I have per file scanner discovery turned on, the DescriptionScannerInfo provider isn't providing per file info.
Comment 8 Doug Schaefer CLA 2010-05-31 16:31:16 EDT
I think I found it. The call to CfgDiscoverdPathManager.removeDiscoveredInfo() in ScannerConfigBuilder.build() was commented out. However, this is what triggered the new discovery information to get loaded.

While it may not make sense to reload it after every build, it does need to be reloaded sometimes. I'll see if I can put the call in the proper strategic place.
Comment 9 CDT Genie CLA 2010-05-31 17:23:06 EDT
*** cdt cvs genie on behalf of dschaefer ***
Bug 314015 Test fix for scanner discovery.

[*] ScannerConfigBuilder.java 1.13 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java?root=Tools_Project&r1=1.12&r2=1.13
Comment 10 Doug Schaefer CLA 2010-06-01 10:31:09 EDT
This fix seems to solve it. Marking fixed. Andrew G already has a bug open for the performance issues which we'll have to address for 7.0.1 or 8.
Comment 11 Doug Schaefer CLA 2010-06-01 10:32:01 EDT
*** Bug 314032 has been marked as a duplicate of this bug. ***