Your message dated Sat, 18 Sep 2010 18:17:06 +0000
with message-id <[email protected]>
and subject line Bug#506968: fixed in ccache 3.1-1
has caused the Debian Bug report #506968,
regarding ccache: Hash the output of "gcc -dumpversion" and "gcc -dumpmachine"
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
506968: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506968
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ccache
Version: 2.4-16
Severity: wishlist
Tags: patch

Hello,

I have already sent this feature request to [email protected] but I have
the feeling the ccache is not maintained by the original developer anymore.

Here is a link to the archived message:
http://lists.samba.org/archive/ccache/2008q4/000359.html

I have already created a patch to implement this feature. The patch is based
on the current Debian svn version and is attached. The patch adds the file
15_hash_compiler_version.diff to the debian/patches folder. Also the CREDITS
file is updated ;)

I've also made some minor fixes in debian/rules. These fixes simply add some
new xxx.unpatched files for proper patch rollback.

The patch does not include changes to the debian/changelog, as I'm not sure
if this part of work lies on my side or the maintainers side.

(Please do not use the patch from the mailing list, as it is not compatible to
the debian version. Use the attached instead.)

Best regards,
Alex

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27.7-c1 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ccache depends on:
ii  libc6                  2.7-16            GNU C Library: Shared libraries
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

ccache recommends no packages.

Versions of packages ccache suggests:
pn  distcc                        <none>     (no description available)

-- no debconf information

*** hash_compiler_version.patch
Index: debian/patches/CREDITS
===================================================================
--- debian/patches/CREDITS      (revision 11878)
+++ debian/patches/CREDITS      (working copy)
@@ -53,3 +53,7 @@
 14_hardlink_doc.diff:
   Ville Skytta <[email protected]>
   
http://cvs.fedoraproject.org/viewcvs/rpms/ccache/F-9/ccache-2.4-hardlink-doc.patch?rev=1.1&view=markup
+
+15_hash_compiler_version.diff
+  Alexander Block <[email protected]>
+  http://lists.samba.org/archive/ccache/2008q4/000359.html
Index: debian/patches/15_hash_compiler_version.diff
===================================================================
--- debian/patches/15_hash_compiler_version.diff        (revision 0)
+++ debian/patches/15_hash_compiler_version.diff        (revision 0)
@@ -0,0 +1,151 @@
+diff -u ccache-2.4/ccache.c ccache-2.4-changed/ccache.c
+--- ccache.c   2004-09-13 12:38:30.000000000 +0200
++++ ccache.c   2008-11-26 15:31:35.000000000 +0100
+@@ -27,7 +27,7 @@
+ char *cache_dir = NULL;
+ 
+ /* the directory for temporary files */
+-static char *temp_dir = NULL;
++char *temp_dir = NULL;
+ 
+ /* the debug logfile name, if set */
+ char *cache_logfile = NULL;
+@@ -132,7 +132,7 @@
+ /* return a string to be used to distinguish temporary files 
+    this also tries to cope with NFS by adding the local hostname 
+ */
+-static const char *tmp_string(void)
++const char *tmp_string(void)
+ {
+       static char *ret;
+ 
+@@ -259,6 +259,7 @@
+       struct stat st;
+       int status;
+       int nlevels = 2;
++    int do_hash_size_mtime = 1;
+       char *input_base;
+       char *tmp;
+       
+@@ -331,8 +332,16 @@
+               hash_string(str_basename(args->argv[0]));
+       }
+ 
+-      hash_int(st.st_size);
+-      hash_int(st.st_mtime);
++      /* hash "gcc -dumpversion" and "gcc -dumpmachine" */
++      if (getenv("CCACHE_HASH_COMPILER_VERSION")) {
++              if (hash_gcc_version(args->argv) == 0)
++                      do_hash_size_mtime = 0;
++      } 
++ 
++      if (do_hash_size_mtime) {
++              hash_int(st.st_size);
++              hash_int(st.st_mtime);
++      }   
+ 
+       /* possibly hash the current working directory */
+       if (getenv("CCACHE_HASHDIR")) {
+diff -u ccache-2.4/ccache.h ccache-2.4-changed/ccache.h
+--- ccache.h   2004-09-13 12:38:30.000000000 +0200
++++ ccache.h   2008-11-26 15:26:46.000000000 +0100
+@@ -73,6 +73,8 @@
+ void hash_file(const char *fname);
+ char *hash_result(void);
+ void hash_buffer(const char *s, int len);
++int hash_execute_output(char **argv);
++int hash_gcc_version(char **argv);
+ 
+ void cc_log(const char *format, ...);
+ void fatal(const char *msg);
+@@ -119,6 +121,8 @@
+ int snprintf(char *,size_t ,const char *, ...);
+ #endif
+ 
++const char *tmp_string(void);
++
+ void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
+ void cleanup_all(const char *dir);
+ void wipe_all(const char *dir);
+diff -u ccache-2.4/ccache.yo ccache-2.4-changed/ccache.yo
+--- ccache.yo  2004-09-13 12:38:30.000000000 +0200
++++ ccache.yo  2008-11-26 15:27:50.000000000 +0100
+@@ -203,6 +203,11 @@
+ strike problems with gdb not using the correct directory then enable
+ this option.
+ 
++dit(bf(CCACHE_HASH_COMPILER_VERSION)) This tells ccache to hash the 
++compiler by using the output of "gcc -dumpversion" and 
++gcc -dumpmachine". This method can prevent cache misses when the used 
++compiler was rebuilt but not changed.
++
+ dit(bf(CCACHE_UNIFY)) If you set the environment variable CCACHE_UNIFY
+ then ccache will use the C/C++ unifier when hashing the pre-processor
+ output if -g is not used in the compile. The unifier is slower than a
+diff -u ccache-2.4/hash.c ccache-2.4-changed/hash.c
+--- hash.c     2004-09-13 12:38:30.000000000 +0200
++++ hash.c     2008-11-26 15:26:46.000000000 +0100
+@@ -23,6 +23,9 @@
+ 
+ static struct mdfour md;
+ 
++/* found in ccache.c */
++extern char *temp_dir;
++
+ void hash_buffer(const char *s, int len)
+ {
+       mdfour_update(&md, (unsigned char *)s, len);
+@@ -61,6 +64,51 @@
+       close(fd);
+ }
+ 
++int hash_execute_output(char **argv)
++{
++      char *tmp_stdout, *tmp_stderr;
++      char *exe_path, *exe_basename;
++      int status;
++
++      exe_path = strdup(argv[0]); // We need a copy because basename() may 
change the original
++      exe_basename = basename(exe_path);
++
++      // TODO: I'm not sure if the naming of the temporary files is ok this 
way. Please 
++      // modify it if required (or delete this TODO)
++      x_asprintf(&tmp_stdout, "%s/%s.stdout.%s", temp_dir, exe_basename, 
tmp_string());
++      x_asprintf(&tmp_stderr, "%s/%s.stderr.%s", temp_dir, exe_basename, 
tmp_string());
++
++      status = execute(argv, tmp_stdout, tmp_stderr);
++      if (status == 0) {
++              hash_file(tmp_stdout);
++              hash_file(tmp_stderr);
++      }
++      unlink(tmp_stdout);
++      unlink(tmp_stderr);
++ 
++      free(exe_path);
++      free(tmp_stdout);
++      free(tmp_stderr);
++
++      return status;
++}
++
++/* hash gcc version with "gcc -dumpversion" and "gcc -dumpmachine" */
++int hash_gcc_version(char **argv)
++{
++      char* tmp_argv[3];
++      tmp_argv[0] = argv[0];
++      tmp_argv[1] = "-dumpversion";
++      tmp_argv[2] = NULL;
++      if (hash_execute_output(tmp_argv) != 0) {
++              tmp_argv[1] = "-dumpmachine";
++              if (hash_execute_output(tmp_argv) != 0) {
++                      return 0;
++              }
++      }
++      return -1;
++}
++
+ /* return the hash result as a static string */
+ char *hash_result(void)
+ {
+Common subdirectories: ccache-2.4/packaging and ccache-2.4-changed/packaging
+Common subdirectories: ccache-2.4/web and ccache-2.4-changed/web
Index: debian/rules
===================================================================
--- debian/rules        (revision 11878)
+++ debian/rules        (working copy)
@@ -29,6 +29,8 @@
         # Apply Debian specific patches
        cp $(CURDIR)/ccache.c $(CURDIR)/ccache.c.unpatched
        cp $(CURDIR)/util.c $(CURDIR)/util.c.unpatched
+       cp $(CURDIR)/hash.c $(CURDIR)/hash.c.unpatched
+       cp $(CURDIR)/stats.c $(CURDIR)/stats.c.unpatched
        cp $(CURDIR)/ccache.1 $(CURDIR)/ccache.1.unpatched
        cp $(CURDIR)/ccache.h $(CURDIR)/ccache.h.unpatched
        cp $(CURDIR)/ccache.yo $(CURDIR)/ccache.yo.unpatched
@@ -36,6 +38,8 @@
        cp $(CURDIR)/configure $(CURDIR)/configure.unpatched
        cp $(CURDIR)/configure.in $(CURDIR)/configure.in.unpatched
        cp $(CURDIR)/Makefile.in $(CURDIR)/Makefile.in.unpatched
+       cp $(CURDIR)/web/index.html $(CURDIR)/web/index.html.unpatched
+       cp $(CURDIR)/web/ccache-man.html $(CURDIR)/web/ccache-man.html.unpatched
        if test ! -f patch-stamp; then \
                for patch in $(CURDIR)/debian/patches/*.diff ;\
                do \
@@ -65,6 +69,8 @@
        # Unapply patches
        -test -r $(CURDIR)/ccache.c.unpatched && mv 
$(CURDIR)/ccache.c.unpatched $(CURDIR)/ccache.c
        -test -r $(CURDIR)/util.c.unpatched && mv $(CURDIR)/util.c.unpatched 
$(CURDIR)/util.c
+       -test -r $(CURDIR)/hash.c.unpatched && mv $(CURDIR)/hash.c.unpatched 
$(CURDIR)/hash.c
+       -test -r $(CURDIR)/stats.c.unpatched && mv $(CURDIR)/stats.c.unpatched 
$(CURDIR)/stats.c
        -test -r $(CURDIR)/ccache.1.unpatched && mv 
$(CURDIR)/ccache.1.unpatched $(CURDIR)/ccache.1
        -test -r $(CURDIR)/ccache.h.unpatched && mv 
$(CURDIR)/ccache.h.unpatched $(CURDIR)/ccache.h
        -test -r $(CURDIR)/ccache.yo.unpatched && mv 
$(CURDIR)/ccache.yo.unpatched $(CURDIR)/ccache.yo
@@ -72,6 +78,8 @@
        -test -r $(CURDIR)/configure.unpatched && mv 
$(CURDIR)/configure.unpatched $(CURDIR)/configure
        -test -r $(CURDIR)/configure.in.unpatched && mv 
$(CURDIR)/configure.in.unpatched $(CURDIR)/configure.in
        -test -r $(CURDIR)/Makefile.in.unpatched && mv 
$(CURDIR)/Makefile.in.unpatched $(CURDIR)/Makefile.in
+       -test -r $(CURDIR)/web/index.html.unpatched && mv 
$(CURDIR)/web/index.html.unpatched $(CURDIR)/web/index.html
+       -test -r $(CURDIR)/web/ccache-man.html.unpatched && mv 
$(CURDIR)/web/ccache-man.html.unpatched $(CURDIR)/web/ccache-man.html
        -rm -f $(CURDIR)/manage-cache.sh
        -rm -f patch-stamp
 



--- End Message ---
--- Begin Message ---
Source: ccache
Source-Version: 3.1-1

We believe that the bug you reported is fixed in the latest version of
ccache, which is due to be installed in the Debian FTP archive:

ccache_3.1-1.debian.tar.gz
  to main/c/ccache/ccache_3.1-1.debian.tar.gz
ccache_3.1-1.dsc
  to main/c/ccache/ccache_3.1-1.dsc
ccache_3.1-1_amd64.deb
  to main/c/ccache/ccache_3.1-1_amd64.deb
ccache_3.1.orig.tar.bz2
  to main/c/ccache/ccache_3.1.orig.tar.bz2



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joel Rosdahl <[email protected]> (supplier of updated ccache package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 18 Sep 2010 19:19:07 +0200
Source: ccache
Binary: ccache
Architecture: source amd64
Version: 3.1-1
Distribution: experimental
Urgency: low
Maintainer: Y Giridhar Appaji Nag <[email protected]>
Changed-By: Joel Rosdahl <[email protected]>
Description: 
 ccache     - Compiler cache for fast recompilation of C/C++ code
Closes: 506968
Changes: 
 ccache (3.1-1) experimental; urgency=low
 .
   * New upstream version.
   * It's now possible to set up ccache to hash the output of a custom
     command to identify the compiler. Closes: #506968.
Checksums-Sha1: 
 aaaf5e58fad060efb744fab4361062318d516fa8 1198 ccache_3.1-1.dsc
 40c872cbfa3de04b94405167665ef5685ed8b310 250668 ccache_3.1.orig.tar.bz2
 aae740c933b119043f15e9d65fe26c0c4fd2b4e3 11973 ccache_3.1-1.debian.tar.gz
 af40a98f2022442d584c483ad735be03f0bfd2af 89922 ccache_3.1-1_amd64.deb
Checksums-Sha256: 
 220003dddc218fdcc45b803c00cfdc8e71c416c942e8a496fe0136b7477c7599 1198 
ccache_3.1-1.dsc
 b8a4cc2321325488307d894ed1c39deef138e0d5e073ed3e265085fe6a5d7c59 250668 
ccache_3.1.orig.tar.bz2
 e64ecce68e9420c2db2b2a72a3beb340127e5a99a351af2f8d34c20fb8bc9b4e 11973 
ccache_3.1-1.debian.tar.gz
 00e52db0b6dc8de5492844799862c31af888fb5b984c184f49b8b2ae084a5d85 89922 
ccache_3.1-1_amd64.deb
Files: 
 b36b8eff7fe9d602dcbd02ec109019f5 1198 devel optional ccache_3.1-1.dsc
 7961852e1e36f11559039c32142f58df 250668 devel optional ccache_3.1.orig.tar.bz2
 fd7df40f5cb18198a7f4458962f91cb3 11973 devel optional 
ccache_3.1-1.debian.tar.gz
 553fbad517779688b3695bb3aba5429c 89922 devel optional ccache_3.1-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkyU+iQACgkQAGT5/7uEXpcDnQCaA8kKvTeQBYtSJVbwAejewgod
kGYAoKnQRA3+VDWH/u0XJQxq2id0nfCY
=DtqN
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to