pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/imake Beat some sense in, to make it easier to d...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d8cd5752bd99
branches:  trunk
changeset: 352034:d8cd5752bd99
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sun Sep 04 18:44:06 2016 +0000

description:
Beat some sense in, to make it easier to debug build failures.

   - Generate all files into the current (build) directory, not /tmp.
   - Do not delete any of the temporary files, to allow analysis after
     build failure.
   - Log the command lines executed.
   - Warn if scrubbing the Imakefile to alert the user to check if that
     broke it.

This currently does not capture the munging imake does on the output
from cpp, as that is disgustingly done in place and changing that
would require more extensive hacking. However, it's now readily
possible to rerun the cpp command directly for diagnostic purposes;
the previously-secret file that imake uses to start the cpp invocation
is now left in .imake.start.c.

PKGREVISION -> 1.

diffstat:

 devel/imake/Makefile              |    3 +-
 devel/imake/distinfo              |    4 +-
 devel/imake/patches/patch-imake.c |  106 ++++++++++++++++++++++++++++++++++++-
 3 files changed, 106 insertions(+), 7 deletions(-)

diffs (152 lines):

diff -r 3558c9f8afa1 -r d8cd5752bd99 devel/imake/Makefile
--- a/devel/imake/Makefile      Sun Sep 04 18:35:33 2016 +0000
+++ b/devel/imake/Makefile      Sun Sep 04 18:44:06 2016 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.21 2014/05/21 21:10:54 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2016/09/04 18:44:06 dholland Exp $
 
 DISTNAME=              imake-1.0.7
+PKGREVISION=           1
 CATEGORIES=            x11 devel
 MASTER_SITES=          ${MASTER_SITE_XORG:=util/}
 EXTRACT_SUFX=          .tar.bz2
diff -r 3558c9f8afa1 -r d8cd5752bd99 devel/imake/distinfo
--- a/devel/imake/distinfo      Sun Sep 04 18:35:33 2016 +0000
+++ b/devel/imake/distinfo      Sun Sep 04 18:44:06 2016 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.12 2015/11/03 03:27:35 agc Exp $
+$NetBSD: distinfo,v 1.13 2016/09/04 18:44:06 dholland Exp $
 
 SHA1 (imake-1.0.7.tar.bz2) = 52e236776133f217d438622034b8603d201a6ec5
 RMD160 (imake-1.0.7.tar.bz2) = 7a8d7b830463c1c429a8ad8349324e607ea255fb
 SHA512 (imake-1.0.7.tar.bz2) = b3527c8fead25c6e093e1fe4a39e60ff210212dcd323e206505b9e872a3f36d9db85f85cab5a6f0fa914fa5c558ef54b499b2b13ccd66739223e4e72ef805d08
 Size (imake-1.0.7.tar.bz2) = 156543 bytes
-SHA1 (patch-imake.c) = ae55d0ed6321c1723c3e8cbbca88611a42bf15bf
+SHA1 (patch-imake.c) = 7f8511f147d90cede0b5dfcb8dda3d7542891ae0
 SHA1 (patch-imakemdep.h) = a8aa1adff501da7eb22d695ff93f0517ce146269
diff -r 3558c9f8afa1 -r d8cd5752bd99 devel/imake/patches/patch-imake.c
--- a/devel/imake/patches/patch-imake.c Sun Sep 04 18:35:33 2016 +0000
+++ b/devel/imake/patches/patch-imake.c Sun Sep 04 18:44:06 2016 +0000
@@ -1,8 +1,89 @@
-$NetBSD: patch-imake.c,v 1.5 2014/03/14 21:14:28 asau Exp $
+$NetBSD: patch-imake.c,v 1.6 2016/09/04 18:44:06 dholland Exp $
+
+Beat some sense in.
+
+   - Generate all files into the current (build) directory, not /tmp.
+     (hunks 1-2)
+
+   - Do not delete any of the temporary files, to allow analysis after
+     build failure. (hunks 3-4, first part of 8)
+
+   - Log the command lines executed. (hunk 5)
+
+   - Warn if scrubbing the Imakefile to alert the user to check if that
+     broke it (second part of hunk 8)
+
+Also,
+
+   - Force use of just "gcc" for pkgsrc, so as to not bypass the
+     wrappers (hunk 7)
+
+   - Force ELF for freebsd versions >= 6 (hunk 6)
+
 
---- imake.c.orig       2013-07-23 04:53:04.000000000 +0000
+--- imake.c.orig       2013-08-17 10:11:50.000000000 +0000
 +++ imake.c
-@@ -1158,7 +1158,9 @@ get_binary_format(FILE *inFile)
+@@ -303,9 +303,9 @@ void KludgeOutputLine(char **), KludgeRe
+ const char *cpp = NULL;
+ 
+ const char    *tmpMakefile;
+-const char    *tmpMakefileTemplate = "/tmp/Imf.XXXXXX";
++const char    *tmpMakefileTemplate = ".imake.Makefile.XXXXXX";
+ const char    *tmpImakefile;
+-const char    *tmpImakefileTemplate = "/tmp/IIf.XXXXXX";
++const char    *tmpImakefileTemplate = ".imake.Imakefile.XXXXXX";
+ const char    *make_argv[ ARGUMENTS ] = {
+ #ifdef WIN32
+     "nmake"
+@@ -319,7 +319,7 @@ int        cpp_argindex;
+ const char    *Imakefile = NULL;
+ const char    *Makefile = "Makefile";
+ const char    *Template = "Imake.tmpl";
+-const char    *ImakefileC = "Imakefile.c";
++const char    *ImakefileC = ".imake.start.c";
+ boolean haveImakefileC = FALSE;
+ const char    *cleanedImakefile = NULL;
+ const char    *program;
+@@ -412,7 +412,8 @@ main(int argc, char *argv[])
+               fd = mkstemp(tmpMakefileName);
+               if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) {
+                  if (fd != -1) {
+-                    unlink(tmpMakefileName); close(fd);
++                    /*unlink(tmpMakefileName);*/
++                    close(fd);
+                  }
+                  LogFatal("Cannot create temporary file %s.", tmpMakefileName);
+               }
+@@ -454,12 +455,14 @@ showit(FILE *fd)
+ void
+ wrapup(void)
+ {
++#if 0
+       if (tmpMakefile != Makefile)
+               unlink(tmpMakefile);
+       if (cleanedImakefile && cleanedImakefile != Imakefile)
+               unlink(cleanedImakefile);
+       if (haveImakefileC)
+               unlink(ImakefileC);
++#endif
+ }
+ 
+ #ifdef SIGNALRETURNSINT
+@@ -773,6 +776,13 @@ doit(FILE *outfd, const char *cmd, const
+ {
+       int             pid;
+       waitType        status;
++      unsigned i;
++
++      fprintf(stderr, "imake: executing:");
++      for (i=0; argv[i]; i++) {
++         fprintf(stderr, " %s", argv[i]);
++      }
++      fprintf(stderr, "\n");
+ 
+       /*
+        * Fork and exec the command.
+@@ -1158,7 +1168,9 @@ get_binary_format(FILE *inFile)
    } else
        strcpy (cmd, "objformat");
  
@@ -13,7 +94,7 @@
        (objprog = popen(cmd, "r")) != NULL &&
        fgets(buf, sizeof(buf), objprog) != NULL &&
        strncmp(buf, "elf", 3) == 0)
-@@ -1337,54 +1339,8 @@ get_gcc_version(FILE *inFile, char *name
+@@ -1337,54 +1349,8 @@ get_gcc_version(FILE *inFile, char *name
  static boolean
  get_gcc(char *cmd)
  {
@@ -70,3 +151,20 @@
  }
  
  #ifdef CROSSCOMPILE
+@@ -1795,12 +1761,15 @@ CleanCppInput(const char *imakefile)
+                           outFile = fdopen(fd, "w");
+                       if (outFile == NULL) {
+                           if (fd != -1) {
+-                             unlink(tmpImakefileName); close(fd);
++                             /*unlink(tmpImakefileName);*/
++                             close(fd);
+                           }
+                           LogFatal("Cannot open %s for write.",
+                               tmpImakefileName);
+                       }
+ #endif
++                      fprintf(stderr, "%s: Warning: cleaning Imakefile\n",
++                              program);
+                       tmpImakefile = tmpImakefileName;
+                   }
+                   writetmpfile(outFile, punwritten, pbuf-punwritten,



Home | Main Index | Thread Index | Old Index