Skip to content

Commit 089ed5a

Browse files
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.
2 parents ad70d59 + cc38a22 commit 089ed5a

File tree

14 files changed

+52
-45
lines changed

14 files changed

+52
-45
lines changed

ogma-cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Provide ability to customize template in fprime command (#185).
77
* Provide ability to customize template in standalone command (#189).
88
* Add repository information to cabal package (#148).
9+
* Add version bounds to all dependencies (#119).
910

1011
## [1.5.0] - 2024-11-21
1112

ogma-cli/ogma-cli.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ executable ogma
139139

140140
build-depends:
141141
base >= 4.11.0.0 && < 5
142-
, optparse-applicative
142+
, optparse-applicative >= 0.14 && < 0.19
143143
, ogma-core >= 1.5.0 && < 1.6
144144

145145
hs-source-dirs:
@@ -160,11 +160,11 @@ test-suite test-ogma
160160

161161
build-depends:
162162
base >= 4.11.0.0 && < 5
163-
, HUnit
164-
, process
165-
, test-framework
166-
, test-framework-hunit
167-
, unix
163+
, HUnit >= 1.2.0.0 && < 1.7
164+
, process >= 1.6 && < 1.7
165+
, test-framework >= 0.8.2 && < 0.9
166+
, test-framework-hunit >= 0.2.0 && < 0.4
167+
, unix >= 2.7.2.2 && < 2.9
168168

169169
hs-source-dirs:
170170
tests

ogma-core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Use template expansion system to generate F' monitoring component (#185).
77
* Use template expansion system to generate standalone Copilot monitor (#189).
88
* Add repository information to cabal package (#148).
9+
* Add version bounds to all dependencies (#119).
910

1011
## [1.5.0] - 2024-11-21
1112

ogma-core/ogma-core.cabal

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ library
119119
build-depends:
120120
base >= 4.11.0.0 && < 5
121121
, aeson >= 2.0.0.0 && < 2.2
122-
, bytestring
123-
, filepath
124-
, mtl
122+
, bytestring >= 0.10.8.2 && < 0.13
123+
, filepath >= 1.4.2 && < 1.6
124+
, mtl >= 2.2.2 && < 2.4
125125
, text >= 1.2.3.1 && < 2.1
126126

127127
, ogma-extra >= 1.5.0 && < 1.6
@@ -149,13 +149,13 @@ test-suite unit-tests
149149
Main.hs
150150

151151
build-depends:
152-
base
153-
, directory
154-
, HUnit
155-
, QuickCheck
156-
, test-framework
157-
, test-framework-hunit
158-
, test-framework-quickcheck2
152+
base >= 4.11.0.0 && < 5
153+
, directory >= 1.3.1.5 && < 1.4
154+
, HUnit >= 1.2.0.0 && < 1.7
155+
, QuickCheck >= 2.8.2 && < 2.16
156+
, test-framework >= 0.8.2 && < 0.9
157+
, test-framework-hunit >= 0.2.0 && < 0.4
158+
, test-framework-quickcheck2 >= 0.3.0.4 && < 0.4
159159

160160
, ogma-core
161161

ogma-extra/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Deprecate unnecessary functions (#185).
66
* Add repository information to cabal package (#148).
7+
* Add version bounds to all dependencies (#119).
78

89
## [1.5.0] - 2024-11-21
910

ogma-extra/ogma-extra.cabal

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ library
7676
build-depends:
7777
base >= 4.11.0.0 && < 5
7878
, aeson >= 2.0.0.0 && < 2.2
79-
, bytestring
80-
, Cabal
81-
, directory
82-
, filepath
79+
, bytestring >= 0.10.8.2 && < 0.13
80+
, Cabal >= 2.2.0.0 && < 3.9
81+
, directory >= 1.3.1.5 && < 1.4
82+
, filepath >= 1.4.2 && < 1.6
8383
, microstache >= 1.0 && < 1.1
8484
, text >= 1.2.3.1 && < 2.1
8585

@@ -100,10 +100,10 @@ test-suite unit-tests
100100
Main.hs
101101

102102
build-depends:
103-
base
104-
, QuickCheck
105-
, test-framework
106-
, test-framework-quickcheck2
103+
base >= 4.11.0.0 && < 5
104+
, QuickCheck >= 2.8.2 && < 2.16
105+
, test-framework >= 0.8.2 && < 0.9
106+
, test-framework-quickcheck2 >= 0.3.0.4 && < 0.4
107107

108108
, ogma-extra
109109

ogma-language-c/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [1.X.Y] - 2024-12-24
44

55
* Add repository information to cabal package (#148).
6+
* Add version bounds to all dependencies (#119).
67

78
## [1.5.0] - 2024-11-21
89

ogma-language-c/ogma-language-c.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ custom-setup
7171
setup-depends:
7272
base >= 4.11.0.0 && < 5
7373
, Cabal >= 2.0 && < 3.9
74-
, process
75-
, BNFC >= 2.9.1
74+
, process >= 1.6 && < 1.7
75+
, BNFC >= 2.9.1 && < 2.10
7676

7777
library
7878

@@ -91,7 +91,7 @@ library
9191

9292
build-depends:
9393
base >= 4.11.0.0 && < 5
94-
, array >= 0.5.2.0
94+
, array >= 0.5.2.0 && < 0.6
9595

9696
hs-source-dirs:
9797
src
@@ -108,9 +108,9 @@ test-suite unit-tests
108108

109109
build-depends:
110110
base >= 4.11.0.0 && < 5
111-
, QuickCheck
112-
, test-framework
113-
, test-framework-quickcheck2
111+
, QuickCheck >= 2.8.2 && < 2.16
112+
, test-framework >= 0.8.2 && < 0.9
113+
, test-framework-quickcheck2 >= 0.3.0.4 && < 0.4
114114

115115
, ogma-language-c
116116

ogma-language-cocospec/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [1.X.Y] - 2024-12-24
44

55
* Add repository information to cabal package (#148).
6+
* Add version bounds to all dependencies (#119).
67

78
## [1.5.0] - 2024-11-21
89

ogma-language-cocospec/ogma-language-cocospec.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ custom-setup
7272
setup-depends:
7373
base >= 4.11.0.0 && < 5
7474
, Cabal >= 2.0 && < 3.9
75-
, process
76-
, BNFC >= 2.9.1
75+
, process >= 1.6 && < 1.7
76+
, BNFC >= 2.9.1 && < 2.10
7777

7878
library
7979

@@ -92,7 +92,7 @@ library
9292

9393
build-depends:
9494
base >= 4.11.0.0 && < 5
95-
, array >= 0.5.2.0
95+
, array >= 0.5.2.0 && < 0.6
9696

9797
hs-source-dirs:
9898
src
@@ -109,9 +109,9 @@ test-suite unit-tests
109109

110110
build-depends:
111111
base >= 4.11.0.0 && < 5
112-
, QuickCheck
113-
, test-framework
114-
, test-framework-quickcheck2
112+
, QuickCheck >= 2.8.2 && < 2.16
113+
, test-framework >= 0.8.2 && < 0.9
114+
, test-framework-quickcheck2 >= 0.3.0.4 && < 0.4
115115

116116
, ogma-language-cocospec
117117

0 commit comments

Comments
 (0)