Subject: regress, tools framework issues (on IRIX 5)
To: None <tech-pkg@netbsd.org>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 05/14/2005 22:42:17
My first attempt of using a regress test on IRIX 5 seems to have thrown me at
the following problem:

lorenz 35% /usr/local/pkg/bin/bmake regress
===> *** No /usr/people/schwarz/pkgsrc/distfiles/pkg-vulnerabilities file
found,
===> *** skipping vulnerability checks. To fix, install
===> *** the pkgsrc/security/audit-packages package and run
===> *** '/usr/local/pkg/sbin/download-vulnerability-list'.
=> No checksum file.
===> Extracting for regress-buildlink-libtool-0.0
===> Required installed package libtool-base>=1.5.14: libtool-base-1.5.14
found
/sbin/cp -R /usr/people/schwarz/pkgsrc/regress/buildlink-libtool/files
/usr/people/schwarz/pkgsrc/regress/buildlink-libtool/work/regress-buildlink-li
btool-0.0
Illegal option -- R
Usage: cp [-ir] f1 f2 
       cp [-ir] f1 ... f2 dir 
*** Error code 2

Stop.
bmake: stopped in /usr/people/schwarz/pkgsrc/regress/buildlink-libtool
*** Error code 1

Stop.
bmake: stopped in /usr/people/schwarz/pkgsrc/regress/buildlink-libtool

This is because my cp does not support -R.
I have

_USE_NEW_TOOLS=yes
USE_TOOLS+=coreutils

in my /etc/mk.conf. This seems  not to be used by the regression test though.


The same issue holds for textproc/nbsed, BTW (in the extract stage; so the
tools framework cannot cope here). Here I suggest replacing -R by -r.

Speaking of nbsed, it appears that the tools framework does not add it as a
dependency on platforms where it defines it as default sed. Or is it supposed
to be installed by bootstrap?

Trying to build nbsed I hit another problem:


===> Overriding tools for nbsed-20040821
/sbin/mkdir -p /usr/people/schwarz/pkgsrc/textproc/nbsed/work/.tools/bin
Cannot create directory
"/usr/people/schwarz/pkgsrc/textproc/nbsed/work/.tools/bin": File exists
*** Error code 2

My mkdir does not like creating an already existing directory, even when using
the -p option.


The following patch seems to do the trick:

--- bsd.tools.mk.orig   2005-05-14 19:46:09.000000000 +0200
+++ bsd.tools.mk        2005-05-14 19:51:45.000000000 +0200
@@ -139,7 +139,10 @@
 override-tools: ${TOOLS_CMD.${_t_}}
 
 ${TOOLS_CMD.${_t_}}:
-       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H:Q}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       if ${TEST} ! -d ${.TARGET:H:Q}; then                            \
+       ${MKDIR} ${.TARGET:H:Q};                                        \
+       fi
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        if ${TEST} -n ${TOOLS_REAL_CMDLINE.${_t_}:Q}""; then            \
                create=wrapper;                                         \

Building textproc/nbsed BTW already tries to use nbsed (with the new tools
framework)! (again, if it is supposed to be installed by bootstrap this is
probably not an issue).

Trying to build textproc/nbcompat with the old tools frameworks leads me to
the next problem. _POSIX2_LINE_MAX is not defined on IRIX 5.
To workaround I suggest the following patch:

--- files/compile.c.orig        2005-05-14 20:13:44.000000000 +0200
+++ files/compile.c     2005-05-14 20:15:51.000000000 +0200
@@ -117,6 +117,10 @@
 #include "defs.h"
 #include "extern.h"
 
+#ifndef _POSIX2_LINE_MAX
+#define _POSIX2_LINE_MAX 2048
+#endif
+ 
 #define LHSZ   128
 #define        LHMASK  (LHSZ - 1)
 static struct labhash {

I took the value from the definition found on a Linux system. Don't know
whether any other default value would be a more reasonable choice.
With this in mind, maybe it does not make sense to have SED default to nbsed,
but rather default to the system's /sbin/sed and use USE_TOOLS+=gsed on that
platform.
Does the new tools framework take into account not to replace SED by gsed for
building gsed? It does not seem to be the case:

lorenz 99% /usr/local/pkg/bin/bmake show-vars VARNAMES=USE_TOOLS
coreutils gsed
lorenz 100% /usr/local/pkg/bin/bmake show-vars VARNAMES=SED
/usr/local/pkg/bin/nbsed
 

Next problem (with new tools framework and USE_TOOLS=coreutils):

===> Applying pkgsrc patches for cvs-1.11.20
===> Overriding tools for cvs-1.11.20
===> Creating toolchain wrappers for cvs-1.11.20
Cannot create directory
"/usr/people/schwarz/pkgsrc/devel/cvs/work/.wrapper/tmp": File exists

In work/.tools/bin there is a link mkdir pointing to /sbin/mkdir, not
${LOCALBASE}/bin/gmkdir, as I would have expected.
Hmmm, looks like the tools framework has evolved, and coreutils is no longer a
supported entry to USE_TOOLS?

USE_TOOLS+=mkdir does not do the trick either.

What did help was adding _TOOLS_USE_PKGSRC.mkdir=yes to /etc/mk.conf.
This looks more of a hack to me though.
Maybe TOOLS_PLATFORM.mkdir should not be set for IRIX 5?
The above problem willl nevertheless surface at least when building coreutils
(which contains gmkdir).

Maybe I should have mkdir be a script like this that first checks whether a
directory already exists before trying to create it? Is this already easily
feasible with the new tools framework?

One positive feedback to end with: the makeinfo problem I have reported in
April (IIRC) no longer occurs (as already discussed on pkgsrccon). 
 

 
-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 georg.schwarz@freenet.de     +49 178 8545053