aap 1.090 - issues with DEFAULTCHECK=newer

Pavol Juhas <[email protected]> Fri, 7 Dec 2007 15:10:40 -0500
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
--aVD9QWMuhilNxW9f
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

I have recently tried to use DEFAULTCHECK=newer in my aap recipe
and found a couple of issues.  First, aap 1.090 would crash with this
setting, because python getmtime function returns float, and
a string representation of float cannot be converted to long [e.g.,
long("0.0") raises an exception].

It was very simple to fix this, see the attached patch, however there
is still another issue.  If one of the source files changes, the
corresponding object gets recompiled, but not relinked to update
the executable.  For example, for a simple, 2-file recipe

    DEFAULTCHECK = newer
    :program triple : triple.cpp timesthree.cpp

a clean aap build runs correctly

    $ aap
    Aap:  g++       -MM triple.cpp > build-Linux2_6_20_16_generic/triple.cpp.aap
    Aap: g++    -O2  -c -o build-Linux2_6_20_16_generic/triple.o triple.cpp
    Aap:  g++       -MM timesthree.cpp > build-Linux2_6_20_16_generic/timesthree.cpp.aap
    Aap: g++    -O2  -c -o build-Linux2_6_20_16_generic/timesthree.o timesthree.cpp
    Aap: g++  -O2 -o triple build-Linux2_6_20_16_generic/triple.o build-Linux2_6_20_16_generic/timesthree.o 

but after "touch timesthree.cpp", aap does not relink:

    $ aap
    Aap:  g++       -MM timesthree.cpp > build-Linux2_6_20_16_generic/timesthree.cpp.aap
    Aap: g++    -O2  -c -o build-Linux2_6_20_16_generic/timesthree.o timesthree.cpp

The same also happens when I really change the timesthree.cpp file;
I tried it to make sure that aap does not compare signatures of
linked objects.

I hope this is helpful and the issues can be fixed soon.
A similar method, DEFAULTCHECK=time seems to work fine,
and I will be using it for now.

Thanks,

Pavol

--aVD9QWMuhilNxW9f
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="aap1090-checknewer.patch"

Index: Cache.py
===================================================================
RCS file: /cvsroot/a-a-p/Exec/Cache.py,v
retrieving revision 1.22
diff -u -r1.22 Cache.py
--- Cache.py	3 Feb 2005 08:50:08 -0000	1.22
+++ Cache.py	7 Dec 2007 19:38:04 -0000
@@ -105,9 +105,9 @@
     for line in lines:
         try:
             url, lfname, rtime, ltime, atime, rest = string.split(line, "\033")
-            rtime = long(rtime)
-            ltime = long(ltime)
-            atime = long(atime)
+            rtime = long(float(rtime))
+            ltime = long(float(ltime))
+            atime = long(float(atime))
         except:
             # Some error in this line, skip it.
             continue
Index: DoBuild.py
===================================================================
RCS file: /cvsroot/a-a-p/Exec/DoBuild.py,v
retrieving revision 1.86
diff -u -r1.86 DoBuild.py
--- DoBuild.py	7 Aug 2007 11:35:57 -0000	1.86
+++ DoBuild.py	7 Dec 2007 19:38:04 -0000
@@ -538,7 +538,7 @@
             # If the check is "newer" need to find the newest timestamp.
             # For other checks building is to be done if the sign differs.
             if check == "newer":
-                t = long(new)
+                t = long(float(new))
                 if update.time == 0 or t > update.time:
                     update.time = t
                     update.time_source = src_name

--aVD9QWMuhilNxW9f
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
--aVD9QWMuhilNxW9f
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
A-A-P-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/a-a-p-develop

--aVD9QWMuhilNxW9f--