Re: [pygccxml-development] Comments on module_builder cache functionality
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2006-08-29 16:30:43
|
Roman Yakovenko wrote: > On 8/29/06, Allen Bierbaum <al...@vr...> wrote: > >> >Actually, if you change any text in implementation_details.h it will >> >rebuild the cache because the md5 hash will catch it. > > > Your code does not contains the check. It doesn't contain a check for implicit includes, no. I have temporarily added the ability for the user to pass in a list of files they know should be used for the signature. This is not a great solution, but it will help out until a better solution is found (see below). >> > >> >As I said on IM though there are changes that both of them miss. >> > >> >The thing that both cache implementations miss is that if a file >> >included by to_be_exported.h changes, then the caches will be invalid >> >but they will not know it. > > > This is an open source project. I claim that pygccxml.parser.file_cache_t > class will not miss. > >> >I have seen this problem before in the pygccxml cache and there is >> >really no good way around it. The only way that pygccxml has to get a >> >full list of dependent header files (ie. build a recursive list of >> >includes) > > > GCCXML does it. > >> >What both of these bugs mean is that it is possible to make a change in >> >your code and have it not get picked up. > > > pygccxml does not contain this bug. Okay. Roman is right. Sorry for doubting you. I just wish I could have found the code quicker. I tracked down where this test is coming from. For those of you that are interested, this check is on line 218 of declarations_cache.py. The test doesn't test the signature by computing a signature against the files that should be included during the current run, instead it does something that works equally as well. It checks to see if any of the files included when the cache was built have changed. If they have then it says the signature is invalid. >> >One hybrid solution that may work is that we could add an optional >> >parameter to the module builder that is a list of "dependent" headers >> >that the user cares about checking. > > > In pygccxml this workds out of the box. > So now I have to figure out how to get this to work with module builder cache and there is a problem. Namely, in module builder the call to parse_declarations does not have access to the list of files that gccxml had to include. The only place where these files seem to be available is in source_reader.py on line 237. It does not appear that this information remains in the pygccxml tree but I could be wrong. Also, the files list is only used to update the decl cache so it is not available later during execution. Does anybody know a way to either a) get the computed file list from source_reader back into the module builder or b) get a list of files that were included from a pygccxml decl tree? Note: Modifying declarations_cache.file_cache_t would not eliminate this need. No matter how the cache is held I need a way to get this list of files in module builder so I can use it to update the cache. -Allen |