tech-pkg archive

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

autoconf AC_PROG_MKDIR_P bug, postgresql pgxs, postgis



autoconf upstream has AC_PROG_MKDIR_P, which finds a "mkdir -p".  It
tries to require that this implementation is parallel safe, in that two
"mkdir -p foo" will always succeed.  (Apparently there is an
implementation out there, even if now historical, that can fail,
probably because it does stat and then if not existing mkdir and if that
fails, returning the error.  But that's not important; the point is that
autoconf code thinks it is true.)

autoconf wrongly rejects NetBSD mkdir, and autoconf's logic is bad; it
basically only accepts GNU coreutils.

postgresql uses this macro and thus gets a fallback config/install-sh
for MKDIR.  But it wants to embed this in pgxs makefile and replaces it
to get rid of relative paths.

Then postgis uses the MKDIR from pgxs, but somehow, the relative path
hack goes awry, even though as I read the code it should work.  This
fails in topology/Makefile.in, but seems ok in some previous makefiles
in the install phase.

Thus there are two bugs:

  autoconf should not reject NetBSD mkdir.  Probably it should not
  reject mkdir on any pkgsrc platform, unless we know that platform is
  actually deficient.

  somewhere between pgxs and postgis, top_srcdir and the relative path
  hack goes wrong, and surely at least one of them is buggy.  However
  upstreams are linuxy and thus likely uninterested in fixing it.  It
  seems reasonably likely other pgxs-using stuff will be affected.

I see two reasonable ways forward:

  In postgresql${VERSION}/Makefile.common (or in client only?), add a
  CONFIGURE_ENV override for the cached mkdir so it finds plain mkdir
  -p.

  In mk/configure/gnu-configure.mk, add the override so everything gets
  the fix.  Later, if we find a supported platform with a deficent
  mkdir, we can exclude it.


The first option is clearly sane, because it works around a
postgresql-bug exposed by config/install-sh.  The second is a big
hammer, but the mkdir fallback script works in alomst all cases.

Therefore I intend to apply the first change, unless people here think
we should do it globally.  And of course unless Adam as $MAINTAINER can
fix the postgis build a different way.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index