Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages moved from testing to community #157

Closed
GammaGames opened this issue Nov 25, 2019 · 16 comments
Closed

Packages moved from testing to community #157

GammaGames opened this issue Nov 25, 2019 · 16 comments

Comments

@GammaGames
Copy link

GammaGames commented Nov 25, 2019

A handful of packages, namely gdal-dev, geos-dev, and proj-dev (and their non-dev dependencies) were moved from testing to community. Changing the apk add commands to use the correct repository, http://dl-cdn.alpinelinux.org/alpine/edge/community, instead of http://dl-cdn.alpinelinux.org/alpine/edge/testing fixes the issues.

This is likely because of something that was brought up in the mailing list, though I haven't been able to find any further discussion after that thread.

@Desa007
Copy link

Desa007 commented Nov 26, 2019

Thanks, it's work.
But now it fails with configure error:

configure: error: could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig

Need help. Thanks

@GammaGames
Copy link
Author

GammaGames commented Nov 26, 2019

Did you do it for both the build-deps-edge and postgis-rundeps-edge virtual packages? The former has the dev packages, while the latter has the regular

Edit: I have done a decent amount of changes to my dockerfile, I had a similar issue that was fixed with #149

@Desa007
Copy link

Desa007 commented Nov 27, 2019

Yes, done for both. Also tried build with postgres:11 and got the same error

configure: error: could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig

http://i.imgur.com/XZCVk4F.png

My Dockerfile:
http://pastiebin.com/embed/5dde3fcc5d54e

@GammaGames
Copy link
Author

Just a few changes:

  1. I am installing g++ in the .build-deps-edge virtual package instead of the .build-deps package
  2. I am installing libstdc++ in the .postgis-rundeps-edge virtual package
  3. I am using postgis 3.0.0

My dockerfile for postgres12-postgis3 looks like the following:

FROM postgres:12-alpine

ENV POSTGIS_VERSION 3.0.0
ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123

RUN set -ex \
    \
    && apk add --no-cache --virtual .fetch-deps ca-certificates openssl tar \
    \
    && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
    && echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
    && mkdir -p /usr/src/postgis \
    && tar \
        --extract \
        --file postgis.tar.gz \
        --directory /usr/src/postgis \
        --strip-components 1 \
    && rm postgis.tar.gz \
    \
    && apk add --no-cache --virtual .build-deps \
        autoconf automake json-c-dev libtool libxml2-dev make perl \
    \
    && apk add --no-cache --virtual .build-deps-edge \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        g++ gdal-dev geos-dev proj-dev protobuf-c-dev \
    && cd /usr/src/postgis \
    && ./autogen.sh \
    && ./configure \
    && make \
    && make install \
    && apk add --no-cache --virtual .postgis-rundeps \
        json-c \
    && apk add --no-cache --virtual .postgis-rundeps-edge \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        geos gdal proj protobuf-c libstdc++ \
    && cd / \
    && rm -rf /usr/src/postgis \
    && apk del .fetch-deps .build-deps .build-deps-edge

@gijoe460
Copy link

gijoe460 commented Dec 6, 2019

GammaGames -

Your build got much further, I am getting the following error now during the build.

/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I../liblwgeom -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros -I../libpgcommon -I../deps/wagyu -I../deps/uthash/include -I/usr/include -I/usr/include/libxml2 -I/usr/include/json-c -fPIC -DPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -flto=thin -emit-llvm -c -o postgis_module.bc postgis_module.c
make[1]: /usr/bin/clang: Command not found
make[1]: Leaving directory '/usr/src/postgis/postgis'
make[1]: *** /usr/local/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.global:1044:postgis_module.bc] Error 127
make: *** [GNUmakefile:20: all] Error 1

Any thoughts?

@GammaGames
Copy link
Author

@gijoe460 Try adding an apk add clang clang-dev before compiling, what version of postgis are you building?

@gijoe460
Copy link

gijoe460 commented Dec 6, 2019

I'm following your build exactly for now. Once i get it working i have some local files/config i do.

@GammaGames
Copy link
Author

Your error message looks like clang is missing, did you try adding it as I said above?

@gijoe460
Copy link

gijoe460 commented Dec 7, 2019

Yes. Looks like we got a little farther along, Still a new error.

cd '/usr/local/lib/postgresql/bitcode' && /usr/lib/llvm8/bin/llvm-lto -thinlto -thinlto-action=thinlink -o postgis-3.index.bc postgis-3/postgis_module.bc postgis-3/lwgeom_accum.bc postgis-3/lwgeom_spheroid.bc postgis-3/lwgeom_ogc.bc postgis-3/lwgeom_functions_analytic.bc postgis-3/lwgeom_inout.bc postgis-3/lwgeom_functions_basic.bc postgis-3/lwgeom_btree.bc postgis-3/lwgeom_box.bc postgis-3/lwgeom_box3d.bc postgis-3/lwgeom_geos.bc postgis-3/lwgeom_geos_prepared.bc postgis-3/lwgeom_geos_clean.bc postgis-3/lwgeom_geos_relatematch.bc postgis-3/lwgeom_export.bc postgis-3/lwgeom_in_gml.bc postgis-3/lwgeom_in_kml.bc postgis-3/lwgeom_in_geohash.bc postgis-3/lwgeom_in_geojson.bc postgis-3/lwgeom_in_encoded_polyline.bc postgis-3/lwgeom_triggers.bc postgis-3/lwgeom_dump.bc postgis-3/lwgeom_dumppoints.bc postgis-3/lwgeom_functions_lrs.bc postgis-3/lwgeom_functions_temporal.bc postgis-3/lwgeom_rectree.bc postgis-3/long_xact.bc postgis-3/lwgeom_sqlmm.bc postgis-3/lwgeom_rtree.bc postgis-3/lwgeom_transform.bc postgis-3/lwgeom_window.bc postgis-3/gserialized_typmod.bc postgis-3/gserialized_gist_2d.bc postgis-3/gserialized_gist_nd.bc postgis-3/gserialized_supportfn.bc postgis-3/gserialized_spgist_2d.bc postgis-3/gserialized_spgist_3d.bc postgis-3/gserialized_spgist_nd.bc postgis-3/brin_2d.bc postgis-3/brin_nd.bc postgis-3/brin_common.bc postgis-3/gserialized_estimate.bc postgis-3/geography_inout.bc postgis-3/geography_btree.bc postgis-3/geography_centroid.bc postgis-3/geography_measurement.bc postgis-3/geography_measurement_trees.bc postgis-3/geometry_inout.bc postgis-3/postgis_libprotobuf.bc postgis-3/vector_tile.pb-c.bc postgis-3/geobuf.pb-c.bc postgis-3/mvt.bc postgis-3/lwgeom_out_mvt.bc postgis-3/geobuf.bc postgis-3/lwgeom_out_geobuf.bc postgis-3/lwgeom_out_geojson.bc postgis-3/postgis_legacy.bc
/bin/sh: /usr/lib/llvm8/bin/llvm-lto: not found
make[1]: *** [/usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk:236: install] Error 127
make[1]: Leaving directory '/usr/src/postgis/postgis'
make: *** [GNUmakefile:20: install] Error 1

@gijoe460
Copy link

gijoe460 commented Dec 7, 2019

I think I got it- Changes made to your Dockerfile

FROM postgres:12-alpine

ENV POSTGIS_VERSION 3.0.0
ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123

RUN set -ex \
    \
    && apk add --no-cache --virtual .fetch-deps ca-certificates openssl tar \
    \
    && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
    && echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
    && mkdir -p /usr/src/postgis \
    && tar \
        --extract \
        --file postgis.tar.gz \
        --directory /usr/src/postgis \
        --strip-components 1 \
    && rm postgis.tar.gz \
    \
    && apk add --no-cache --virtual .build-deps \
        autoconf automake json-c-dev libtool libxml2-dev make perl llvm clang clang-dev \
    \
    && apk add --no-cache --virtual .build-deps-edge \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        g++ gdal-dev geos-dev proj-dev protobuf-c-dev \
    && cd /usr/src/postgis \
    && ./autogen.sh \
    && ./configure \
    && make \
    && make install \
    && apk add --no-cache --virtual .postgis-rundeps \
        json-c \
    && apk add --no-cache --virtual .postgis-rundeps-edge \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        geos gdal proj protobuf-c libstdc++ \
    && cd / \
    && rm -rf /usr/src/postgis \
    && apk del .fetch-deps .build-deps .build-deps-edge

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
COPY ./update-postgis.sh /usr/local/bin

RobAtticus added a commit to RobAtticus/timescaledb-docker that referenced this issue Feb 10, 2020
The previous Dockerfile for PostGIS builds would fail when trying
to use libgeos. Using a Dockerfile from the official postgis repos
helped resolves the issue and upgrades us to PostGIS 3.0.0.

New Dockerfile based on the one found here:
postgis/docker-postgis#157 (comment)
RobAtticus added a commit to RobAtticus/timescaledb-docker that referenced this issue Feb 10, 2020
The previous Dockerfile for PostGIS builds would fail when trying
to use libgeos. Using a Dockerfile from the official postgis repos
helped resolves the issue.

New Dockerfile based on the one found here:
postgis/docker-postgis#157 (comment)
@phillipross
Copy link
Contributor

@GammaGames @Desa007 @gijoe460 I believe this is no longer an issue as of the current builds from the master branch can build v2.5.3 and will build v3.x as soon as some pending PRs are merged.

Can you test/confirm? Thanks!

@gijoe460
Copy link

I'll check today and get back.

@GammaGames
Copy link
Author

GammaGames commented Feb 25, 2020

I just pulled the 12-3.0-alpine and 12-2.5-alpine tags and they seemed to be working fine. Now that the images are on dockerhub I no longer have any reason to be building it myself, so I haven't done that.

Edit: I tried to build both of the above packages, got:

ERROR: unsatisfiable constraints:
  gdal-dev (missing):
    required by: .build-deps-20200225.190532[gdal-dev]
  geos-dev (missing):
    required by: .build-deps-20200225.190532[geos-dev]
  llvm9-dev (missing):
    required by: .build-deps-20200225.190532[llvm9-dev]
  proj-dev (missing):
    required by: .build-deps-20200225.190532[proj-dev]

@phillipross
Copy link
Contributor

@GammaGames when you try to build, are you invoking docker build directly or using make? In the case of the former, please be sure to include the --pull option so that you're sure to have the latest parent images in your local environment.

@GammaGames
Copy link
Author

You're right, that worked. I can't seem to build any containers on the pi though, but that should be a separate issue.

@phillipross
Copy link
Contributor

@GammaGames I think maybe issue #144 is tracking that, but I haven't look at it closely yet

RobAtticus added a commit to timescale/timescaledb-docker that referenced this issue Mar 18, 2020
The previous Dockerfile for PostGIS builds would fail when trying
to use libgeos. Using a Dockerfile from the official postgis repos
helped resolves the issue.

New Dockerfile based on the one found here:
postgis/docker-postgis#157 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants