Re: setting check attribute for header files
Bram Moolenaar <[email protected]> Tue, 07 Aug 2007 14:13:09 +0200
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
Pavol Juhas wrote:
> ...
> > > ----------------------------------------------------------------
> > > :attribute {check = c_md5} hello.h hello.c
> > > :program hello : hello.c
> > > ----------------------------------------------------------------
> > >
> > > However, this builds the target from scratch every time, even
> > > if source files are not changed at all.
> > > Is this a bug or am I missing something?
> >
> > Please have a good look at the log file. It should mention the reason
> > why Aap is building "hello".
>
> The log file for up-to-date target is attached. The reason
> for rebuild is on line 19 - 'no old signature for "hello.h"' -
> as a result aap builds hello.c.aap and hello.o. The sign
> file in BDIR actually contains checksum for hello.h.
>
> When I set DEFAULTCHECK=c_md5, aap behaved as expected and it
> recognized hello.c.aap as up-to-date. I am attaching that logfile as
> well.
>
> > Perhaps you can also try splitting it up in separate build instructions.
> > If that works then it's a bug in :program.
>
> I don't know how to split it up more. I tried to show a minimum example
> of the problem and there is just one source file and one header. In
> fact, the same problem occurs if I move the header code into the c-file.
It took a bit of debugging to discover that when using an automatic
dependency the attributes of the node were not used to detect the check
type.
This patch should fix it:
RCS file: /cvsroot/a-a-p/Exec/DoBuild.py,v
retrieving revision 1.85
diff -u -r1.85 DoBuild.py
--- DoBuild.py 17 Jan 2006 20:05:07 -0000 1.85
+++ DoBuild.py 7 Aug 2007 11:02:59 -0000
@@ -513,7 +513,10 @@
elif virtual:
update.source = src_name
else:
- check = check_name(recdict, src_name, src_dict)
+ alt_dict = None
+ if src_dict.has_key("_node"):
+ alt_dict = src_dict["_node"].attributes
+ check = check_name(recdict, src_name, src_dict, alt_dict)
if check == "newer":
c = "time" # "newer" check also uses timestamp
else:
I have uploaded Aap 1.90.
--
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/