Author |
Topic |
|
pavold
Junior Member
11 Posts |
Posted - May 27 2007 : 10:18:25 AM
|
Hi,
In my project I have a script that generates resources from an xml. The script generates a header file with symbol #defines and an rc file that is included by the main application resource file.
The problem is that Visual Assist does not automatically reparse the generated header even if it is included in one of the solution projects. The option "Watch for externally modified files and reparse when necessary" is enabled.
If I manually open the header file and force the Reparse all symbols are recognized.
Is there anything I can do about it?
Best Regards, Pavol.
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - May 28 2007 : 09:56:39 AM
|
That is unexpected. With the header file closed is it listed in VA's OFIW dialog? My first thought is that VA does not know about this file, so it is not watching it.
If it is this dialog what is the path to the file? Is it on a local drive or a network drive?
Which IDE and version of VA are you using? |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - May 28 2007 : 10:16:33 AM
|
The file is normally accessible through OFIW dialog and it is stored on local disk drive along the other project files. The path in the dialog is correct and I can open the file from there as usual. I'm using the latest visual assist 10.3.1555 and visual studio 2005 SP1.
After some more investigation I found out, that the problem does not happen all the time. Sometimes, the file is parsed.
For example, I have added a new ID to my xml definitions. If I compile just the xml, the new ID is instantly recognized in the cpp file. But if the generation took place as a part of whole project build, it was not reparsed. I had to open the header file and manualy issue the Reparse command.
Our solution is quite large. Couldn't it be possible, that I'm just not patient enough? |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - May 29 2007 : 06:31:35 AM
|
Can you try running a CPU monitor and see if this gives you any insight into what is happening?
VS2005's default intellisense scanner is know to hog a lot of CPU cycles, and compiling a large project also tends to use a lot of CPU time.
I am wondering if these two effects are combining. If your compile is automatically rebuilding header files then the IDE's intellisense scanner will be scanning these, possibly taking quite a while. While all of this is happening VA is probably not scanning much of anything, since it is waiting for a "quiet time" to reparse files so that it does not impact on your work.
This is a good theory, but proving it one way or the other could be tricky. If you see the CPU return to idle, and give VA a few seconds to catch up (it does not normally try to parse while you are typing) and still the files have not been parsed this suggests there is a real problem. |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - May 30 2007 : 04:56:04 AM
|
I have a confirmation, that the problem is not related to some time issues. I have added a new identifier to the xml and it didn't got recognized even after several builds and plenty of time in between.
The problem only arises when I issue the solution build. If the xml file is compiled separately, header is parsed normally just after the compilation. If I keep the header open, the visual studio ask me to reload it after the build and in this case the header is also parsed ok.
I have disabled the microsoft intellisense, (by renaming on dll) so it should not interfere.
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - May 30 2007 : 06:35:11 AM
|
That is odd, but you have clearly eliminated the obvious answer.
When you build the XML file separately how are you doing this? When the XML file is built when compiling how is this done?
I am wondering if the method of triggering this build is somehow important.
Is there any chance of getting a very simple test project that builds an XML file that I could use for testing purposes here? |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - May 30 2007 : 10:46:58 AM
|
To answer your questions: My xml file is a part of project and I have specified a custom build rules for it. The rule simply calls a ruby script that processes the xml and generates rc and header files. Prerequisite for this build step is the xml file and outputs are .h and .rc files.
Separate compilation is done by issuing "compile" from context menu on the xml file (as for any other project file). Similarly, the file is being processed as any other file in the project when issuing a solution build. I'm really not sure what can be an actual difference between these two.
There is another interesting thing that I have noticed. When I saw that the symbol is not recognized, I have opened the header file. All the symbols in there were immediately painted to the correct color (including the new symbol), but the affected cpp didn't changed until I have explicitly issued the reparse command.
I can try to create a small test project, but unfortunately I'm quite busy now. So it will take a moment until I find a time to do it. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - May 30 2007 : 2:49:20 PM
|
*sigh* I was afraid you were going to say something like that. On paper there is no difference between these two things.
Can you please download and run filemon:
http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx
and filter it to only show the generated header file that is produced, and then leave it running while you do a couple of tests of this. Hopefully this will tell us something.
If it shows VA simply ignoring the file some of the time then we know this is the cause, if not why. I suspect this is what is happening, but it is possible VA is seeing the file change when you compile, but somehow not responding correctly. |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - May 31 2007 : 08:04:04 AM
|
I have created some build logs. You can get them here: http://friday.miner3d.net/~pdr/va
solution_build_2.log is from a solution build after I have added new identifiers. Those were not recognized. I have opened header file and as you can see on picture ribbon_rc.h.png, the symbol is there and shown as recognize.
However as you can see on the second picture (ribbon_cpp.png) that was taken afterwards, the symbol is not known in the cpp.
I got the correct painting only after I have issued a reparse command. I have captured a log from this to reparse.log
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - May 31 2007 : 1:39:13 PM
|
Reading over the logs I have just noticed something interesting in the solution build log. The very first entry is:
1 12:39:36 ruby.exe:3988 CREATE C:\\...\\Ribbon_rc.h SUCCESS Options: OverwriteIf Access: All
depending on exactly how VA is hooking and watching for file changes (I am not sure of the details off hand) I am wondering if this matters. If VA thinks that instead of being modified the file has been replaced then this *might* explain what is going on here.
Is it easy to change how the ruby script replaces the current file content? I am wondering if you can open the file, then delete its content, then start writing to it. If this is a very easy and safe change to make it would be interesting to see if it fixes the problem. |
zen is the art of being at one with the two'ness |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - May 31 2007 : 3:16:08 PM
|
You wrote that it only happens some of the time - when you do builds of the whole solution. Are there many files that get generated? VA will throttle back if it sees many source/header files getting modified. If you have many files being auto-generated that don't need to be regenerated, those could interfere with VA seeing changes that matter. |
|
|
pavold
Junior Member
11 Posts |
Posted - May 31 2007 : 5:35:47 PM
|
Actually, there are only 3 files generated at the moment in the whole solution. One header, one rc and one inline file.
|
|
|
pavold
Junior Member
11 Posts |
Posted - Jun 04 2007 : 03:03:53 AM
|
I tried to avoid re-creation of the header file from the ruby script. FileMon doesn't show any CREATE actions now. Unfortunately the problem persists. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Jun 04 2007 : 10:26:49 AM
|
*sigh* so much for that easy fix. I will ask about this, see if anyone has any ideas.
For now, are you able to add a final build step to your project? I am thinking of adding a "touch" command, to update the date/time stamp on the generated header files to solution properties -> Build Events -> Post-Build Event.
The theory is that VA should see the file change, and so reparse it. Since this should be after the compile and link has finished hopefully VA will be sufficiently caught up that the reparse actually happens. |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - Jun 04 2007 : 11:51:31 AM
|
Well, this is not very good solution, since it would also invalidate the build and VS will build all files, that include the header file again => not good.
Anyway, this issue is not a big problem, it's more an inconvenience. I'll be glad if you could fix it, but I can live with it for a while. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Jun 04 2007 : 1:05:23 PM
|
*oops* you are right, this is obvious when you point it out.
I am thinking about Sean's comment that VA might simply be seeing a lot of activity. Can you configure FileMon to watch for all activity in:
*\\Local Settings\\Application Data\\VisualAssist\\vs8\\history\\*
and set it running next time you do a compile with a modified XML file? This should allow us to determine all code files that VA reparses during the compile. If this is several hundred files then it makes sense that this one file is being lost in a sea of changes. However if there is very little activity then we will have to try and work out what is going on. |
zen is the art of being at one with the two'ness |
|
|
pavold
Junior Member
11 Posts |
Posted - Jun 05 2007 : 03:46:34 AM
|
I have uploaded new logs here: http://friday.miner3d.net/~pdr/va
This time, I have used "VisualAssist" filter in the Filemon. There was no access to the location you specified during the build, nor after the build.
I have seen entries for the 'history' location only if I manually issued the reparse command on the header file, as I mentioned before.
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Jun 05 2007 : 08:02:27 AM
|
*sigh* this suggests that VA is not reparsing any files at all. I rather suspected that would be the answer.
I will ask our developers, to be honest I am not sure what to suggest next. |
zen is the art of being at one with the two'ness |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Jun 05 2007 : 1:12:38 PM
|
Do you have "parse all files when opening a project" enabled (VA Options | Performance | Parse all files)? Do you wait a few seconds after completing a build to see if VA knows about the new symbols? Are the old symbols still recognized by VA after the build? Are all of the solution files on the same drive letter? Are the solution files on the same drive as the IDE?
See if this results in different behavior: after the build completes, switch to another application wait 5 seconds switch back to the IDE wait a few seconds and then check to see if the new symbols are known
|
|
|
pavold
Junior Member
11 Posts |
Posted - Jun 05 2007 : 1:30:42 PM
|
- Yes. Symbols are recognized if I close and reopen the solution - Yes, even a half an hour does not help. As I mentioned before, the symbols are not recognized even after several builds with considerable time in-between. - Yes - Yes - Yes
- Tried several times, does not help at all. The symbols are recognized *only* if I open the header file and manually issue reparse. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Jun 05 2007 : 1:40:54 PM
|
Please send in log files per these instructions: http://docs.wholetomato.com?W305
Please also include the name of the generated file.
Try to minimize activity during the logging (but not so much that the problem ceases to be a problem) - something along these lines: restart IDE enable logging open the solution modify the xml file build check for symbol recognition exit IDE
|
|
|
pavold
Junior Member
11 Posts |
Posted - Jun 05 2007 : 2:41:06 PM
|
I sent the log files as requested. During the logging, I opened the solution, added a new symbol to xml file and started the build. After the build symbol was not known. I waited several minutes, switching to other applications and leaving the computer idle. Symbol was still not recognized.
After that, I opened the generated header file (symbol was still unknown) and issued Reparse. After this the symbol was recognized.
Then I closed the visual studio. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Jun 11 2007 : 12:07:55 PM
|
This thread continued via email. case=6949
|
|
|
|
Topic |
|