I can't seem to get GNATCOLL to compile in an Alpine Linux based Docker Container.
My container so far is:
FROM alpine:edge
# Add extra repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories; \
echo 'http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories; \
echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories;
RUN apk add --no-cache build-base coreutils curl-dev gcc-gnat git gmp-dev openssl
# Bootstrap GPRBuild
RUN git clone https://github.com/AdaCore/xmlada.git; \
git clone https://github.com/AdaCore/gprbuild.git; \
cd gprbuild; ./bootstrap.sh --with-xmlada=../xmlada; \
cd ..; \
rm -rf xmlada gprbuild
This works fine and gets me a container with a working GNAT GPR based Ada development environment. The issue comes when I try to install GNATCOLL in this container.
Running docker run -i -t <built_image>
the following occurs:
/ # git clone https://github.com/AdaCore/gnatcoll-core.git
<Typical git clone output>
/ # cd gnatcoll-core/
/gnatcoll-core # make setup
/gnatcoll-core # make
gprbuild -p -m --target=x86_64-linux -j0 -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \
-XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD gnatcoll.gpr
Setup
[mkdir] object directory for project GnatColl
[mkdir] library directory for project GnatColl
gnatcoll.gpr:24:06: unknown project file: "gpr"
make: *** [Makefile:128: build-static] Error 4
Based on the discussion in https://github.com/AdaCore/gnatcoll-core/issues/30 I checked my gprbuild version:
/gnatcoll-core # gprbuild --version
GPRBUILD Pro 18.0w (19940713) (x86_64-alpine-linux-musl)
Copyright (C) 2004-2016, AdaCore
This is free software; see the source for copying conditions.
See your AdaCore support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
So it would seem that gprbuild for musl is woefully out of date, leading to an inability to build GNATCOLL. Is there any way to get a more up-to-date version of gprbuild for musl-c? If not is there any other way to get GNATCOLL installed?
gpr-version.ads
, just before the beginning of the package spec. – Tortgpr.gpr
when building GNATCOLL. This project file is located in thegpr
directory of the GPRbuild repository (see here). You might want to add the location of thegpr.gpr
project to the the environment variableGPR_PROJECT_PATH
(and useexport
to make it visible to child processes). See also Importing Projects in the GPR Tools manual. – Tortgpr.gpr
was not already installed somewhere along with the GPRbuild executable. In that case you could also use that version. – Tortgpr.gpr
was installed. I tried using the one in the project but it re-uses some build variables. In particular gnatcoll uses-XBUILD=PROD
but gprbuild'sgpr.gpr
source file uses-XBUILD=production
so they aren't compatible. There must be some other way to get the desiredgpr.gpr
file, but runningmake install
in the gprbuild project doesn't seem to do it. – Mulloy