PostgreSQL 9.3 beta breaks some extensions "make install" - Mailing list pgsql-hackers

From Marti Raudsepp
Subject PostgreSQL 9.3 beta breaks some extensions "make install"
Date
Msg-id CABRT9RASFgGqP-DJv0EAyXeFnquuap1-P=PVma=ZtnKHiNWPpA@mail.gmail.com
Whole thread Raw
Responses Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Hi list,

While testing out PostgreSQL 9.3beta1, I stumbled upon a problem
installing some extensions (pgTAP and semver among others):

% make
[...]
% make DESTDIR=/tmp/foo install
[...]
/usr/bin/install -c -m 644 ./sql/semver--unpackaged--0.2.1.sql
./sql/semver--0.2.4--0.3.0.sql ./sql/semver--0.2.1--0.2.4.sql
./sql/semver--0.3.0.sql ./sql/semver--0.3.0.sql
'/tmp/foo/usr/share/postgresql/extension/'
/usr/bin/install: will not overwrite just-created
‘/tmp/foo/usr/share/postgresql/extension/semver--0.3.0.sql’ with
‘./sql/semver--0.3.0.sql’
make: *** [install] Error 1

I traced the problem down to commit
9db7ccae2000524b72a4052352cbb5407fb53b02 "Use system install program
when available and usable". It turns out that 'install' from coreutils
8.21 complains when it's told to install the same source file twice.

It's caused by this common pattern in extension makefiles:
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql

The wildcard will match semver--0.3.0.sql too, in addition to the
direct reference, causing it to be duplicated (unless "make install"
is called from a clean directory).

The attached 1st patch fixes this case by putting $(sort ...) around
the DATA install command, which drops duplicate filenames. While there
are other install commands, the chances of them containing duplicate
names seem lower.

I'm not sure if this is worth worrying about, but there's still a
problem when DATA and DATA_built are separated, e.g:
DATA = $(wildcard sql/*--*.sql)
DATA_built = sql/$(EXTENSION)--$(EXTVERSION).sql

This can't be solved with a sort since DATA_built doesn't use
$(addprefix). But the install could be split into 2 separate commands
(2nd patch)

Regards,
Marti

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: erroneous restore into pg_catalog schema
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Logging of PAM Authentication Failure