Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3390 closed defect (fixed)

Compilation under Alpine Linux 3.2 gives an error when compiling the postgis and postgis_topology extension

Reported by: boonen Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.1
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

I've downloaded the 2.2.0 distribution and compiled it using the standard building tools of Alpine Linux 3.2. When building the extensions postgis and postgis_topology I get the following error:

cp ../../doc/raster_comments.sql sql_bits/raster_comments.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  ../../spatial_ref_sys.sql > sql_bits/spatial_ref_sys.sql
mkdir -p sql
echo '\echo Use "CREATE EXTENSION postgis" to load this file. \quit' > sql/postgis.sql
cat sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/mark_editable_objects.sql.in sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql >> sql/postgis.sql
mkdir -p sql
cp sql/postgis.sql sql/postgis--2.2.0.sql
mkdir -p sql
cat ../../postgis/postgis.sql ../../raster/rt_pg/rtpostgis.sql | /bin/sh /usr/lib/postgresql/pgxs/src/makefiles/../../config/missing perl ../../utils/create_unpackaged.pl
postgis > sql/postgis--unpackaged--2.2.0.sql
/bin/sh: can't open '/usr/lib/postgresql/pgxs/src/makefiles/../../config/missing'
Makefile:50: recipe for target 'sql/postgis--unpackaged--2.2.0.sql' failed
make: *** [sql/postgis--unpackaged--2.2.0.sql] Error 2
make: *** Deleting file 'sql/postgis--unpackaged--2.2.0.sql'

Note, this resembles the problem in issue #3004.

I can work around this issue by defining the PERL variable in the Makefile after the lines

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

in the Makefile. So, it seems the PGXS is messing up my variables.

Change History (8)

comment:1 Changed 4 years ago by boonen

Summary: Compilation under Alpine Linux 3.2 gives an error when compiling the postigs and postgis_topology extensionCompilation under Alpine Linux 3.2 gives an error when compiling the postgis and postgis_topology extension

comment:2 Changed 4 years ago by robe

(In [14538]) Attempt to install extension install issue on Alpine Linux 3.2 references #3390 for PostGIS 2.3 move perl define below PGXS inclued to prevent PGXS from overwriting it.

comment:3 Changed 4 years ago by robe

boonen,

I can't replicate the issue you are having, but based on what you said, I moved the perl definition below include $(PGXS) as you noted. It still works for me. I've only done this for our trunk (2.3).

Can you give trunk a try. My assumption is that what we determine for PERL is right and it's just PGXS overwriting the variable we set causing the issue in extension install.

If I get positive feedback from you and our bots are okay with the change, then I'll backport to 2.2.

comment:4 Changed 4 years ago by gdt

I've had a similar issue, which I think has been discussed on the list. In pkgsrc, the issue is that the build of base postgresql does not depend on perl, and therefore perl in pgxs is missing. One can argue this is broken, but the basic problem is that packages that depend on many things and can reasonably be split into pieces are difficult to deal with and there are no truly good solutions, other than upstream splitting them.

I have replaced $(PERL) with @PERL@, but the notion of setting PERL=@PERL@ so that it is definitive vs pgxs sounds sensible too.

Arguably postgis should either look for perl and always use @PERL@, or not look for perl and insist on pgxs being right. I prefer postgis looking for it.

comment:5 Changed 4 years ago by robe

gdt,

We've always set PERL=@PERL@ so all I did in r14538 was to move the declaration down.

I thought maybe we were just setting it too early and it was being overwritten by pgxs. I can't really test the theory out since I don't have the issue.

Did I do the right thing in trunk by pushing the definition down to where boonen had it, or was that not the right thing to do and can you test it. If wrong I should just revert my change and if right backport to 2.2.

comment:6 Changed 4 years ago by strk

I also remember PERL was messed up by PGXS (missing at build time) -- the patch seems correct to me, to be backported.

comment:7 Changed 4 years ago by robe

Resolution: fixed
Status: newclosed

(In [14545]) move perl define below PGXS include to prevent PGXS from overwriting it. Hope this fixes Alpine Linux 3.2 install issue closes #3390 for PostGIS 2.2

comment:8 Changed 4 years ago by robe

(In [14546]) update NEWS References #3390, also fix sort of tickets

Note: See TracTickets for help on using tickets.