You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'develop-version-bounds' into develop. Close#119.
**Description**
The cabal packages do not currently specify version bounds. This makes
hackage complain when we upload packages, and can create stability /
installation issues for users.
**Type**
- Bug: Cabal files are missing useful information.
**Additional context**
None.
**Requester**
- Ivan Perez.
**Method to check presence of bug**
It's not possible to check automatically. The check is done by opening
the cabal files and checking whether all dependencies of all components
specify version bounds.
To ensure that the bounds set are acceptable, the following two
dockerfiles compile Ogma with the oldest version of GHC supported (based
on the version bound on base), and the newest (based on other
constraints, as well as imports in the code that are only available in
modern versions of dependencies of GHC):
```Dockerfile
--- Dockerfile-ghc-8.4
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install --yes software-properties-common
RUN add-apt-repository ppa:hvr/ghc
RUN apt-get update
RUN apt-get install --yes ghc-8.4.4 cabal-install-2.4
RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.4.4/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update
RUN cabal v1-sandbox init
RUN cabal v1-install alex happy
RUN apt-get install --yes git
CMD git clone $REPO \
&& cd $NAME \
&& git checkout $COMMIT \
&& cd .. \
&& cabal v1-sandbox init \
&& cabal v1-install $NAME/$PAT**/ --constraint="aeson>=2.0.3.0" --enable-tests \
&& echo "Success"
--- Dockerfile-ghc-9.4
FROM ubuntu:focal
RUN apt-get update
RUN apt-get install --yes libz-dev
RUN apt-get install --yes git
RUN apt-get install --yes wget
RUN mkdir -p $HOME/.ghcup/bin
RUN wget https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -O $HOME/.ghcup/bin/ghcup
RUN chmod a+x $HOME/.ghcup/bin/ghcup
ENV PATH=$PATH:/root/.ghcup/bin/
ENV PATH=$PATH:/root/.cabal/bin/
RUN apt-get install --yes curl
RUN apt-get install --yes gcc g++ make libgmp3-dev
RUN ghcup install ghc 9.4
RUN ghcup install cabal 3.2
RUN ghcup set ghc 9.4.8
RUN cabal update
SHELL ["/bin/bash", "-c"]
CMD git clone $REPO \
&& cd $NAME \
&& git checkout $COMMIT \
&& export PATH=$PATH:$PWD/.cabal-sandbox/bin/ \
&& cabal v1-sandbox init \
&& cabal v1-install alex happy --constraint="happy<2.0" \
&& cabal v1-install BNFC ogma-**/ --constraint="aeson>=2.0.3.0" \
&& cabal v1-install ogma-**/ --constraint="aeson>=2.0.3.0" --enable-tests \
&& echo "Success"
```
Command (substitute variables based on new path after merge):
```sh
$ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e "PAT=ogma" -e "COMMIT=<HASH>" -it ogma-verify-119-ghc-8.4
$ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e "PAT=ogma" -e "COMMIT=<HASH>" -it ogma-verify-119-ghc-9.4
```
Notice that we use two commands, one for each of the above dockerfiles.
**Expected result**
All dependencies of all components specify version bounds. Installing
Ogma with the dockerfiles above prints sucess, indicating that it can be
installed with GHC 8.4 and GHC 9.4.
**Solution implemented**
Add version bounds to all dependencies of all components of all packages.
**Further notes**
We pick the latest versions of all dependencies available, and the
earliest versions that are compatible with base 4.11 (the earliest
currently supported by Ogma) that provide the definitions needed, with
the same signature.
Ogma currently fails to be installed with GHC 9.6 and above (in part due
to imports from mtl:Control.Monad.Except that are no longer exported by
that module). We determine GHC 9.4 to be the latest version that Ogma
can be compiled with, and pick other versions of other libraries
accordingly.
0 commit comments