Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrVBR-0000F6-I8 for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2013 15:29:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UrVBQ-0003gq-Tm for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2013 15:29:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrVBP-0003gj-7t for pgsql-hackers@postgresql.org; Tue, 25 Jun 2013 15:29:27 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrVBK-0005Ym-St for pgsql-hackers@postgresql.org; Tue, 25 Jun 2013 15:29:26 +0000 Received: from obelix.localnet (AToulouse-556-1-236-172.w83-193.abo.wanadoo.fr [83.193.132.172]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0Mefts-1UcA9n1ZBg-00OYCt; Tue, 25 Jun 2013 17:29:19 +0200 From: =?utf-8?q?C=C3=A9dric_Villemain?= Reply-To: cedric@2ndquadrant.com Organization: 2ndQuadrant To: Andrew Dunstan Subject: Re: Bugfix and new feature for PGXS Date: Tue, 25 Jun 2013 17:29:42 +0200 User-Agent: KMail/1.13.7 (Linux/3.8-2-amd64; KDE/4.8.4; x86_64; ; ) Cc: pgsql-hackers@postgresql.org, Craig Ringer References: <201306181552.36673.cedric@2ndquadrant.com> <201306250124.54610.cedric@2ndquadrant.com> <51C9B4DB.8000007@dunslane.net> In-Reply-To: <51C9B4DB.8000007@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1447890.NI7WZsFnVc"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201306251729.47025.cedric@2ndquadrant.com> X-Provags-ID: V02:K0:Vx/y4PrqrKnJuAslcfgyqwLJ+dH5L10CZdI2/KUGATu bMIHTy58gOKNG+2W3i5n38CYhfhZbz4X/BEXWmUasnsEcburyk Kt6qu31D+MjRne0aJBIIF6kz60YQ0/mwlGgA+/ahlA5DEMBr0z MtxD/OXB8kMR7CIh5KSKnLUBobwtep3IY/pSqg3tx/UO3Thx0y gjcLF81RmAzY1sAwYRJ13wfBQxnoVLw0VakLNh2tFxeIFPDZ/i /Sw7LdoUc2gNayBj2BGY3BNURrANbhTSMUzmXATqov9KSDd6k/ bX5PdF7iJ4rDIz7aDfyEN5hts7YDQB9Ib7FHe2NwhOQ/Amkmp7 iZDhYDmB009WqjJMYScDvvdlDfaMOiohksZyohXDw X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --nextPart1447890.NI7WZsFnVc Content-Type: multipart/mixed; boundary="Boundary-01=_ndbyRVGiEeii+/C" Content-Transfer-Encoding: 7bit --Boundary-01=_ndbyRVGiEeii+/C Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le mardi 25 juin 2013 17:18:51, Andrew Dunstan a =C3=A9crit : > On 06/24/2013 07:24 PM, C=C3=A9dric Villemain wrote: > > Le mardi 25 juin 2013 00:18:26, Andrew Dunstan a =C3=A9crit : > >> On 06/24/2013 04:02 PM, C=C3=A9dric Villemain wrote: > >>> WIth extension, we do have to set VPATH explicitely if we want to use > >>> VPATH (note that contribs/extensions must not care that postgresql has > >>> been built with or without VPATH set). My patches try to fix that. > >>=20 > >> No, this is exactly what I'm objecting to. I want to be able to do: > >> invoke_vpath_magic > >> standard_make_commands_as_for_non_vpath > >>=20 > >> Your patches have been designed to overcome your particular issues, but > >> they don't meet the general case, IMNSHO. This is why I want to have > >> more discussion about how vpath builds could work for PGXS modules. > >=20 > > The patch does not restrict anything, it is not supposed to lead to > > regression. > > The assignment of VPATH and srcdir are wrong in the PGXS case, the patch > > correct them. You're still free to do "make VPATH=3D/mypath ..." the VP= ATH > > provided won't be erased by the pgxs.mk logic. >=20 > I still think this is premature. I have spent some more time trying to > make it work the way I think it should, so far without success. I think > we need more discussion about how we'd like VPATH to work for PGXS > would. There's no urgency about this - we've lived with the current > situation for quite a while. Sure... I did a quick and dirty patch (I just validate without lot of testing),=20 attached to this email to fix json_build (at least for make, make install) As you're constructing targets based on commands to execute in the srcdir=20 directory, and because srcdir is only set in pgxs.mk, it is possible to def= ine=20 srcdir early in the json_build/Makefile and use it. > When I have more time I will work on it some more. Thank you =2D-=20 C=C3=A9dric Villemain +33 (0)6 20 30 22 52 http://2ndQuadrant.fr/ PostgreSQL: Support 24x7 - D=C3=A9veloppement, Expertise et Formation --Boundary-01=_ndbyRVGiEeii+/C Content-Type: text/x-patch; charset="UTF-8"; name="makefile.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="makefile.patch" diff --git a/Makefile b/Makefile index ce10008..87582d1 100644 =2D-- a/Makefile +++ b/Makefile @@ -1,24 +1,28 @@ EXTENSION =3D json_build =2DEXTVERSION =3D $(shell grep default_version $(EXTENSION).control | sed= -e "s/default_version[[:space:]]*=3D[[:space:]]*'\([^']*\)'/\1/") =20 =2DDATA =3D $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.= sql)) =2DDOCS =3D $(wildcard doc/*.md) +srcdir =3D $(dir $(firstword $(MAKEFILE_LIST))) +EXTVERSION =3D $(shell grep default_version $(srcdir)/$(EXTENSION).control= | sed -e "s/default_version[[:space:]]*=3D[[:space:]]*'\([^']*\)'/\1/") + +DATA =3D $(filter-out $(wildcard $(srcdir)/sql/*--*.sql),$(wildcar= d $(srcdir)/sql/*.sql)) +DOCS =3D $(wildcard $(srcdir)/doc/*.md) USE_MODULE_DB =3D 1 =2DTESTS =3D $(wildcard test/sql/*.sql) +TESTS =3D $(wildcard $(srcdir)/test/sql/*.sql) REGRESS_OPTS =3D --inputdir=3Dtest --outputdir=3Dtest \ --load-extension=3D$(EXTENSION) =2DREGRESS =3D $(patsubst test/sql/%.sql,%,$(TESTS)) +REGRESS =3D $(patsubst $(srcdir)/test/sql/%.sql,%,$(TESTS)) MODULE_big =3D $(EXTENSION) =2DOBJS =3D $(patsubst src/%.c,src/%.o,$(wildcard src/*.c)) +OBJS =3D $(patsubst $(srcdir)/src/%.c,$(srcdir)/src/%.o,$(wildcard= $(srcdir)/src/*.c)) PG_CONFIG =3D pg_config =20 all: sql/$(EXTENSION)--$(EXTVERSION).sql =20 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql + $(MKDIR_P) sql cp $< $@ =20 + DATA_built =3D sql/$(EXTENSION)--$(EXTVERSION).sql =2DDATA =3D $(filter-out sql/$(EXTENSION)--$(EXTVERSION).sql, $(wildcard sq= l/*--*.sql)) +DATA =3D $(filter-out $(srcdir)/sql/$(EXTENSION)--$(EXTVERSION).sql, $(wil= dcard $(srcdir)/sql/*--*.sql)) EXTRA_CLEAN =3D sql/$(EXTENSION)--$(EXTVERSION).sql =20 PGXS :=3D $(shell $(PG_CONFIG) --pgxs) --Boundary-01=_ndbyRVGiEeii+/C-- --nextPart1447890.NI7WZsFnVc Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQEcBAABAgAGBQJRybdqAAoJENsgH0yzVBeb4j0H/iDYMw+Dd8F6vK6dy8qD3Bun cSMXCSWQ/aW9DVl5xejWP/A85CehRUfUIolgULuqXWizrZglir04LHcsGs83CSl9 Zokmf3IubauNUm4LtgCUdjWRPPAdt86Mfw5rpPqLNjRDm2BUQoIFy/11F0Whswqh GYxhhhbSgjo83btqy9JRqSEE7tTul27yICg1DcdjGeSqYIBQ7zwJzNMBh7LZXp8D mrWQE/c6drBea/RA/9B8TtVbpfOdns1SenCpLAPqHAG8vcb23AKvbr2L8w586zTp H5rsrLzNZzmK0+zjj0XTquu8NZWiF+7xNnIHsNpNUvKcH0sW8hMJDiePjTy5ynQ= =q4Xq -----END PGP SIGNATURE----- --nextPart1447890.NI7WZsFnVc--