Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrG7g-0006GK-B4 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 23:24:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UrG7f-00058O-QC for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 23:24:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrG7d-00056b-R1 for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 23:24:33 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrG7Z-0003Ra-Vo for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 23:24:33 +0000 Received: from obelix.localnet (AToulouse-556-1-236-172.w83-193.abo.wanadoo.fr [83.193.132.172]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M3jZR-1U0WyY2pnd-00rpGl; Tue, 25 Jun 2013 01:24:28 +0200 From: =?utf-8?q?C=C3=A9dric_Villemain?= Reply-To: cedric@2ndquadrant.com Organization: 2ndQuadrant To: pgsql-hackers@postgresql.org Subject: Re: Bugfix and new feature for PGXS Date: Tue, 25 Jun 2013 01:24:50 +0200 User-Agent: KMail/1.13.7 (Linux/3.8-2-amd64; KDE/4.8.4; x86_64; ; ) Cc: Andrew Dunstan , Craig Ringer References: <201306181552.36673.cedric@2ndquadrant.com> <201306242202.04162.cedric@2ndquadrant.com> <51C8C5B2.6080609@dunslane.net> In-Reply-To: <51C8C5B2.6080609@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1878449.vCdTz0RkR4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201306250124.54610.cedric@2ndquadrant.com> X-Provags-ID: V02:K0:9G3pliHg/kMoG7EDrp+yBuHcJLPwj1NCJErwJ8iU5ex FLiHcnHSBjYw9frjAfkOzJCAW5QTluZWdfTAFrXiArdpYpVZNF qzeGYw3xYqYXZeocaZQZPNKik2xVqU+OEgA4mxRvzocUpH5akV JRd+Z+2h7mhlCzX5iXG8smQ3KUfIpvjSKvwKlF+nib+CIApZHY 43WDcFfTx2I2oJpovRyvn/NPYv8+QNOOfJvohmn4EizlU8vrxO ZGIgqTlEvorTqzK8FajyPGy1p/mmgjDxNdbLV478VrYVtc7Rxp 7BMzzTJSDuV8d5QGC+PF8fyjSOhnoDxpKzdMdo4RCHMv6OVpJB Xl9Fxz5QNpEboC0FLuH96mLqf3QIL+kKNYZHXe7wocAlhGXzvX wHMgKoBhjWD6w== 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 --nextPart1878449.vCdTz0RkR4 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: >=20 > 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. The patch does not restrict anything, it is not supposed to lead to=20 regression. The assignment of VPATH and srcdir are wrong in the PGXS case, the patch=20 correct them. You're still free to do "make VPATH=3D/mypath ..." the VPATH= =20 provided won't be erased by the pgxs.mk logic. > > So the point is to be able to do exactly that : > >=20 > > $ mkdir /tmp/json_build && cd /tmp/json_build > > $ make USE_PGXS=3D1 -f /path/to/json_build/Makefile >=20 > It doesn't work: >=20 > [andrew@emma vpath.json_build]$ PATH=3D../../inst.vpgxs.5706/bin:$PATH > make -f `pwd`/../json_build/Makefile > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > grep: json_build.control: No such file or directory > gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith > -Wdeclaration-after-statement -Wendif-labels > -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing > -fwrapv -fexcess-precision=3Dstandard -g -fpic -shared -o > json_build.so -L/home/pgl/npgl/inst.vpgxs.5706/lib -Wl,--as-needed > -Wl,-rpath,'/home/pgl/npgl/inst.vpgxs.5706/lib',--enable-new-dtags > cp > =20 > /home/andrew/pgl/extns/vpath.json_build/../json_build/sql/json_build.sql > sql/json_build--.sql > cp: cannot create regular file `sql/json_build--.sql': No such file > or directory > make: *** [sql/json_build--.sql] Error 1 > [andrew@emma vpath.json_build]$ Ah, you make the point : your Makefile does not support VPATH or I failed t= o=20 consider some cases. It seems to me that : EXTVERSION =3D $(shell grep default_version $(EXTENSION).control | sed -e= =20 "s/default_version[[:space:]]*=3D[[:space:]]*'\([^']*\)'/\1/") is not working. I'm going to check GNU Make guidelines about that case (sho= uld=20 $(command) be executed on each path in the VPATH or not ?) [...] thinking a bit more... I suppose gmake expects the Makefile to list $(EXTENSION).control file as a= =20 prerequisite (thus its paths will be known during make invocation and your= =20 command will work) =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 --nextPart1878449.vCdTz0RkR4 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) iQEcBAABAgAGBQJRyNVGAAoJENsgH0yzVBebh9UH/RYqaopZ/9+/xjwqtQmgxZdY 9mg1qB7nxhtLiSWzhvFqt8pBrPFPk0NLf+u4BU+GYH1aIvQ/4awHdfHs+P9WjzoL aKvIWV/zKO0vJXoProCQzMpL2glBcKOfajqz2N31rcl4FzmJdp6U1+9Rgn+uCC/H 5mcgZnn9Cf9ExzHBlr+zQdX7EHA8y1j7M9S+gyOZPraZDv63H8EhDEdk69cuiPSk uEWo7jPEk0Zbwz5uxNlEyGETEiWv6DousVzcLjo4u7PioRPuZ6Vzglhc/IbY3a+9 IIXiahXheO/PbroBOBf2XA+riYyBvkTWXc9jOV9cKgPq1CZu27ULJbn8Q0CaceY= =ZQ5D -----END PGP SIGNATURE----- --nextPart1878449.vCdTz0RkR4--