Skip to content

Commit c009e33

Browse files
committed
Make GHC base libraries dependent on GHC version.
See input-output-hk#84, input-output-hk#167. Using https://github.com/bgamari/ghc-utils/tree/master/library-versions for it, as a lookup Map compiled into the binary using TH.
1 parent b209e08 commit c009e33

File tree

5 files changed

+150
-53
lines changed

5 files changed

+150
-53
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,13 @@ Stack2nix can generate a nix expressions for Haskell packages hosted in git repo
5454
## Testing
5555

5656
Run `./scripts/travis.sh` to build and test.
57+
58+
## Development
59+
60+
### Updating GHC base packages
61+
62+
```
63+
curl https://raw.githubusercontent.com/bgamari/ghc-utils/master/library-versions/pkg_versions.txt > pkg_versions.txt
64+
```
65+
66+
then check it into the repo.

pkg_versions.txt

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# packed versions file -- generate with ./pack_pkg_list.hs
2+
#
3+
4+
# We extract the Win32 pkg version information manually here
5+
7.0.1 Win32/2.2.0.2
6+
7.0.2 Win32/2.2.0.2
7+
7.0.3 Win32/2.2.0.2
8+
7.0.4 Win32/2.2.0.2
9+
7.2.1 Win32/2.2.1.0
10+
7.2.2 Win32/2.2.1.0
11+
7.4.1 Win32/2.2.2.0
12+
7.4.2 Win32/2.2.2.0
13+
7.6.1 Win32/2.3.0.0
14+
7.6.2 Win32/2.3.0.0
15+
7.6.3 Win32/2.3.0.0
16+
7.8.1 Win32/2.3.0.2
17+
7.8.2 Win32/2.3.0.2
18+
7.8.3 Win32/2.3.0.2
19+
7.8.4 Win32/2.3.0.2
20+
7.10.1 Win32/2.3.1.0
21+
7.10.2 Win32/2.3.1.0
22+
7.10.3 Win32/2.3.1.0
23+
8.0.1 Win32/2.3.1.1
24+
8.0.2 Win32/2.3.1.1
25+
8.2.1 Win32/2.5.4.1
26+
8.2.2 Win32/2.5.4.1
27+
8.4.1 Win32/2.6.1.0
28+
8.4.2 Win32/2.6.1.0
29+
8.4.3 Win32/2.6.1.0
30+
8.4.4 Win32/2.6.1.0
31+
8.6.1 Win32/2.6.1.0
32+
8.6.2 Win32/2.6.1.0
33+
8.6.3 Win32/2.6.1.0
34+
8.6.4 Win32/2.6.1.0
35+
8.6.5 Win32/2.6.1.0
36+
8.8.1 Win32/2.6.1.0
37+
HEAD Win32/2.6.1.0
38+
39+
############################################
40+
# GHC 7.0 - GHC 7.6
41+
7.0.1 Cabal/1.10.0.0 array/0.3.0.2 base/4.3.0.0 bin-package-db/0.0.0.0 bytestring/0.9.1.8 containers/0.4.0.0 directory/1.1.0.0 extensible-exceptions/0.1.1.2 ffi/1.0 filepath/1.2.0.0 ghc/7.0.1* ghc-binary/0.5.0.2* ghc-prim/0.2.0.0 haskell2010/1.0.0.0* haskell98/1.1.0.0 hpc/0.5.0.6 integer-gmp/0.2.0.2 old-locale/1.0.0.2 old-time/1.0.0.6 pretty/1.0.1.2 process/1.0.1.4 random/1.0.0.3 rts/1.0 template-haskell/2.5.0.0 time/1.2.0.3 unix/2.4.1.0
42+
7.0.2 Cabal/1.10.1.0 array/0.3.0.2 base/4.3.1.0 bin-package-db/0.0.0.0 bytestring/0.9.1.10 containers/0.4.0.0 directory/1.1.0.0 extensible-exceptions/0.1.1.2 ffi/1.0 filepath/1.2.0.0 ghc/7.0.2* ghc-binary/0.5.0.2* ghc-prim/0.2.0.0 haskell2010/1.0.0.0* haskell98/1.1.0.1 hpc/0.5.0.6 integer-gmp/0.2.0.3 old-locale/1.0.0.2 old-time/1.0.0.6 pretty/1.0.1.2 process/1.0.1.5 random/1.0.0.3 rts/1.0 template-haskell/2.5.0.0 time/1.2.0.3 unix/2.4.2.0
43+
7.0.3 Cabal/1.10.1.0 array/0.3.0.2 base/4.3.1.0 bin-package-db/0.0.0.0 bytestring/0.9.1.10 containers/0.4.0.0 directory/1.1.0.0 extensible-exceptions/0.1.1.2 ffi/1.0 filepath/1.2.0.0 ghc/7.0.3* ghc-binary/0.5.0.2* ghc-prim/0.2.0.0 haskell2010/1.0.0.0* haskell98/1.1.0.1 hpc/0.5.0.6 integer-gmp/0.2.0.3 old-locale/1.0.0.2 old-time/1.0.0.6 pretty/1.0.1.2 process/1.0.1.5 random/1.0.0.3 rts/1.0 template-haskell/2.5.0.0 time/1.2.0.3 unix/2.4.2.0
44+
7.0.4 Cabal/1.10.2.0 array/0.3.0.2 base/4.3.1.0 bin-package-db/0.0.0.0 bytestring/0.9.1.10 containers/0.4.0.0 directory/1.1.0.0 extensible-exceptions/0.1.1.2 ffi/1.0 filepath/1.2.0.0 ghc/7.0.4* ghc-binary/0.5.0.2* ghc-prim/0.2.0.0 haskell2010/1.0.0.0* haskell98/1.1.0.1 hpc/0.5.0.6 integer-gmp/0.2.0.3 old-locale/1.0.0.2 old-time/1.0.0.6 pretty/1.0.1.2 process/1.0.1.5 random/1.0.0.3 rts/1.0 template-haskell/2.5.0.0 time/1.2.0.3 unix/2.4.2.0
45+
7.2.1 Cabal/1.12.0 array/0.3.0.3 base/4.4.0.0 bin-package-db/0.0.0.0 binary/0.5.0.2* bytestring/0.9.2.0 containers/0.4.1.0 directory/1.1.0.1 extensible-exceptions/0.1.1.3 ffi/1.0 filepath/1.2.0.1 ghc/7.2.1* ghc-prim/0.2.0.0 haskell2010/1.1.0.0* haskell98/2.0.0.0* hoopl/3.8.7.1 hpc/0.5.1.0 integer-gmp/0.3.0.0 old-locale/1.0.0.3 old-time/1.0.0.7 pretty/1.1.0.0 process/1.1.0.0 rts/1.0 template-haskell/2.6.0.0 time/1.2.0.5 unix/2.5.0.0
46+
7.2.2 Cabal/1.12.0 array/0.3.0.3 base/4.4.1.0 bin-package-db/0.0.0.0 binary/0.5.0.2* bytestring/0.9.2.0 containers/0.4.1.0 directory/1.1.0.1 extensible-exceptions/0.1.1.3 ffi/1.0 filepath/1.2.0.1 ghc/7.2.2* ghc-prim/0.2.0.0 haskell2010/1.1.0.0* haskell98/2.0.0.0* hoopl/3.8.7.1 hpc/0.5.1.0 integer-gmp/0.3.0.0 old-locale/1.0.0.3 old-time/1.0.0.7 pretty/1.1.0.0 process/1.1.0.0 rts/1.0 template-haskell/2.6.0.0 time/1.2.0.5 unix/2.5.0.0
47+
7.4.1 Cabal/1.14.0 array/0.4.0.0 base/4.5.0.0 bin-package-db/0.0.0.0 binary/0.5.1.0 bytestring/0.9.2.1 containers/0.4.2.1 deepseq/1.3.0.0 directory/1.1.0.2 extensible-exceptions/0.1.1.4 filepath/1.3.0.0 ghc/7.4.1* ghc-prim/0.2.0.0 haskell2010/1.1.0.1* haskell98/2.0.0.1* hoopl/3.8.7.3 hpc/0.5.1.1 integer-gmp/0.4.0.0 old-locale/1.0.0.4 old-time/1.1.0.0 pretty/1.1.1.0 process/1.1.0.1 rts/1.0 template-haskell/2.7.0.0 time/1.4 unix/2.5.1.0
48+
7.4.2 Cabal/1.14.0 array/0.4.0.0 base/4.5.1.0 bin-package-db/0.0.0.0 binary/0.5.1.0 bytestring/0.9.2.1 containers/0.4.2.1 deepseq/1.3.0.0 directory/1.1.0.2 extensible-exceptions/0.1.1.4 filepath/1.3.0.0 ghc/7.4.2* ghc-prim/0.2.0.0 haskell2010/1.1.0.1* haskell98/2.0.0.1* hoopl/3.8.7.3 hpc/0.5.1.1 integer-gmp/0.4.0.0 old-locale/1.0.0.4 old-time/1.1.0.0 pretty/1.1.1.0 process/1.1.0.1 rts/1.0 template-haskell/2.7.0.0 time/1.4 unix/2.5.1.1
49+
7.6.1 Cabal/1.16.0 array/0.4.0.1 base/4.6.0.0 bin-package-db/0.0.0.0 binary/0.5.1.1 bytestring/0.10.0.0 containers/0.5.0.0 deepseq/1.3.0.1 directory/1.2.0.0 filepath/1.3.0.1 ghc/7.6.1* ghc-prim/0.3.0.0 haskell2010/1.1.1.0* haskell98/2.0.0.2* hoopl/3.9.0.0 hpc/0.6.0.0 integer-gmp/0.5.0.0 old-locale/1.0.0.5 old-time/1.1.0.1 pretty/1.1.1.0 process/1.1.0.2 rts/1.0 template-haskell/2.8.0.0 time/1.4.0.1 unix/2.6.0.0
50+
7.6.2 Cabal/1.16.0 array/0.4.0.1 base/4.6.0.1 bin-package-db/0.0.0.0 binary/0.5.1.1 bytestring/0.10.0.2 containers/0.5.0.0 deepseq/1.3.0.1 directory/1.2.0.1 filepath/1.3.0.1 ghc/7.6.2* ghc-prim/0.3.0.0 haskell2010/1.1.1.0* haskell98/2.0.0.2* hoopl/3.9.0.0 hpc/0.6.0.0 integer-gmp/0.5.0.0 old-locale/1.0.0.5 old-time/1.1.0.1 pretty/1.1.1.0 process/1.1.0.2 rts/1.0 template-haskell/2.8.0.0 time/1.4.0.1 unix/2.6.0.1
51+
7.6.3 Cabal/1.16.0 array/0.4.0.1 base/4.6.0.1 bin-package-db/0.0.0.0 binary/0.5.1.1 bytestring/0.10.0.2 containers/0.5.0.0 deepseq/1.3.0.1 directory/1.2.0.1 filepath/1.3.0.1 ghc/7.6.3* ghc-prim/0.3.0.0 haskell2010/1.1.1.0* haskell98/2.0.0.2* hoopl/3.9.0.0 hpc/0.6.0.0 integer-gmp/0.5.0.0 old-locale/1.0.0.5 old-time/1.1.0.1 pretty/1.1.1.0 process/1.1.0.2 rts/1.0 template-haskell/2.8.0.0 time/1.4.0.1 unix/2.6.0.1
52+
53+
############################################
54+
# GHC 7.8.x
55+
7.8.1 Cabal/1.18.1.3 array/0.5.0.0 base/4.7.0.0 bin-package-db/0.0.0.0 binary/0.7.1.0 bytestring/0.10.4.0 containers/0.5.5.1 deepseq/1.3.0.2 directory/1.2.1.0 filepath/1.3.0.2 ghc/7.8.1* ghc-prim/0.3.1.0 haskell2010/1.1.2.0* haskell98/2.0.0.3* hoopl/3.10.0.1 hpc/0.6.0.1 integer-gmp/0.5.1.0 old-locale/1.0.0.6 old-time/1.1.0.2 pretty/1.1.1.1 process/1.2.0.0 rts/1.0 template-haskell/2.9.0.0 time/1.4.2 transformers/0.3.0.0 unix/2.7.0.1
56+
7.8.2 Cabal/1.18.1.3 array/0.5.0.0 base/4.7.0.0 bin-package-db/0.0.0.0 binary/0.7.1.0 bytestring/0.10.4.0 containers/0.5.5.1 deepseq/1.3.0.2 directory/1.2.1.0 filepath/1.3.0.2 ghc/7.8.2* ghc-prim/0.3.1.0 haskell2010/1.1.2.0* haskell98/2.0.0.3* hoopl/3.10.0.1 hpc/0.6.0.1 integer-gmp/0.5.1.0 old-locale/1.0.0.6 old-time/1.1.0.2 pretty/1.1.1.1 process/1.2.0.0 rts/1.0 template-haskell/2.9.0.0 time/1.4.2 transformers/0.3.0.0 unix/2.7.0.1
57+
7.8.3 Cabal/1.18.1.3 array/0.5.0.0 base/4.7.0.1 bin-package-db/0.0.0.0 binary/0.7.1.0 bytestring/0.10.4.0 containers/0.5.5.1 deepseq/1.3.0.2 directory/1.2.1.0 filepath/1.3.0.2 ghc/7.8.3* ghc-prim/0.3.1.0 haskeline/0.7.1.2 haskell2010/1.1.2.0* haskell98/2.0.0.3* hoopl/3.10.0.1 hpc/0.6.0.1 integer-gmp/0.5.1.0 old-locale/1.0.0.6 old-time/1.1.0.2 pretty/1.1.1.1 process/1.2.0.0 rts/1.0 template-haskell/2.9.0.0 terminfo/0.4.0.0 time/1.4.2 transformers/0.3.0.0 unix/2.7.0.1 xhtml/3000.2.1
58+
7.8.4 Cabal/1.18.1.5 array/0.5.0.0 base/4.7.0.2 bin-package-db/0.0.0.0 binary/0.7.1.0 bytestring/0.10.4.0 containers/0.5.5.1 deepseq/1.3.0.2 directory/1.2.1.0 filepath/1.3.0.2 ghc/7.8.4* ghc-prim/0.3.1.0 haskeline/0.7.1.2 haskell2010/1.1.2.0* haskell98/2.0.0.3* hoopl/3.10.0.1 hpc/0.6.0.1 integer-gmp/0.5.1.0 old-locale/1.0.0.6 old-time/1.1.0.2 pretty/1.1.1.1 process/1.2.0.0 rts/1.0 template-haskell/2.9.0.0 terminfo/0.4.0.0 time/1.4.2 transformers/0.3.0.0 unix/2.7.0.1 xhtml/3000.2.1
59+
60+
############################################
61+
# GHC 7.10.x
62+
63+
7.10.1 Cabal/1.22.2.0 array/0.5.1.0 base/4.8.0.0 bin-package-db/0.0.0.0 binary/0.7.3.0 bytestring/0.10.6.0 containers/0.5.6.2 deepseq/1.4.1.1 directory/1.2.2.0 filepath/1.4.0.0 ghc/7.10.1* ghc-prim/0.4.0.0 haskeline/0.7.2.1 hoopl/3.10.0.2 hpc/0.6.0.2 integer-gmp/1.0.0.0 pretty/1.1.2.0 process/1.2.3.0 rts/1.0 template-haskell/2.10.0.0 terminfo/0.4.0.1 time/1.5.0.1 transformers/0.4.2.0 unix/2.7.1.0 xhtml/3000.2.1
64+
7.10.2 Cabal/1.22.4.0 array/0.5.1.0 base/4.8.1.0 bin-package-db/0.0.0.0 binary/0.7.5.0 bytestring/0.10.6.0 containers/0.5.6.2 deepseq/1.4.1.1 directory/1.2.2.0 filepath/1.4.0.0 ghc/7.10.2* ghc-prim/0.4.0.0 haskeline/0.7.2.1 hoopl/3.10.0.2 hpc/0.6.0.2 integer-gmp/1.0.0.0 pretty/1.1.2.0 process/1.2.3.0 rts/1.0 template-haskell/2.10.0.0 terminfo/0.4.0.1 time/1.5.0.1 transformers/0.4.2.0 unix/2.7.1.0 xhtml/3000.2.1
65+
7.10.3 Cabal/1.22.5.0 array/0.5.1.0 base/4.8.2.0 bin-package-db/0.0.0.0 binary/0.7.5.0 bytestring/0.10.6.0 containers/0.5.6.2 deepseq/1.4.1.1 directory/1.2.2.0 filepath/1.4.0.0 ghc/7.10.3* ghc-prim/0.4.0.0 haskeline/0.7.2.1 hoopl/3.10.0.2 hpc/0.6.0.2 integer-gmp/1.0.0.0 pretty/1.1.2.0 process/1.2.3.0 rts/1.0 template-haskell/2.10.0.0 terminfo/0.4.0.1 time/1.5.0.1 transformers/0.4.2.0 unix/2.7.1.0 xhtml/3000.2.1
66+
67+
############################################
68+
# GHC 8.0.x
69+
70+
8.0.1 Cabal/1.24.0.0 array/0.5.1.1 base/4.9.0.0 binary/0.8.3.0 bytestring/0.10.8.1 containers/0.5.7.1 deepseq/1.4.2.0 directory/1.2.6.2 filepath/1.4.1.0 ghc/8.0.1* ghc-boot/8.0.1 ghc-boot-th/8.0.1 ghc-prim/0.5.0.0 ghci/8.0.1 haskeline/0.7.2.3 hoopl/3.10.2.1 hpc/0.6.0.3 integer-gmp/1.0.0.1 pretty/1.1.3.3 process/1.4.2.0 rts/1.0 template-haskell/2.11.0.0 terminfo/0.4.0.2 time/1.6.0.1 transformers/0.5.2.0 unix/2.7.2.0 xhtml/3000.2.1
71+
8.0.2 Cabal/1.24.2.0 array/0.5.1.1 base/4.9.1.0 binary/0.8.3.0 bytestring/0.10.8.1 containers/0.5.7.1 deepseq/1.4.2.0 directory/1.3.0.0 filepath/1.4.1.1 ghc/8.0.2 ghc-boot/8.0.2 ghc-boot-th/8.0.2 ghc-prim/0.5.0.0 ghci/8.0.2 haskeline/0.7.3.0 hoopl/3.10.2.1 hpc/0.6.0.3 integer-gmp/1.0.0.1 pretty/1.1.3.3 process/1.4.3.0 rts/1.0 template-haskell/2.11.1.0 terminfo/0.4.0.2 time/1.6.0.1 transformers/0.5.2.0 unix/2.7.2.1 xhtml/3000.2.1
72+
73+
############################################
74+
# GHC 8.2.x
75+
76+
8.2.1 Cabal/2.0.0.2 array/0.5.2.0 base/4.10.0.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.10.2 deepseq/1.4.3.0 directory/1.3.0.2 filepath/1.4.1.2 ghc/8.2.1* ghc-boot/8.2.1 ghc-boot-th/8.2.1 ghc-compact/0.1.0.0 ghc-prim/0.5.1.0 ghci/8.2.1 haskeline/0.7.4.0 hoopl/3.10.2.2 hpc/0.6.0.3 integer-gmp/1.0.1.0 pretty/1.1.3.3 process/1.6.1.0 rts/1.0 template-haskell/2.12.0.0 terminfo/0.4.1.0 time/1.8.0.2 transformers/0.5.2.0 unix/2.7.2.2 xhtml/3000.2.2
77+
8.2.2 Cabal/2.0.1.0 array/0.5.2.0 base/4.10.1.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.10.2 deepseq/1.4.3.0 directory/1.3.0.2 filepath/1.4.1.2 ghc/8.2.2* ghc-boot/8.2.2 ghc-boot-th/8.2.2 ghc-compact/0.1.0.0 ghc-prim/0.5.1.0 ghci/8.2.2 haskeline/0.7.4.0 hoopl/3.10.2.2 hpc/0.6.0.3 integer-gmp/1.0.1.0 pretty/1.1.3.3 process/1.6.1.0 random/1.1 rts/1.0 template-haskell/2.12.0.0 terminfo/0.4.1.0 time/1.8.0.2 transformers/0.5.2.0 unix/2.7.2.2 xhtml/3000.2.2
78+
79+
############################################
80+
# GHC 8.4.x
81+
82+
8.4.1 Cabal/2.2.0.0 array/0.5.2.0 base/4.11.0.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.11.0 deepseq/1.4.3.0 directory/1.3.1.5 filepath/1.4.2 ghc/8.4.1* ghc-boot/8.4.1 ghc-boot-th/8.4.1 ghc-compact/0.1.0.0 ghc-prim/0.5.2.0 ghci/8.4.1 haskeline/0.7.4.2 hpc/0.6.0.3 integer-gmp/1.0.1.0 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.4.5.0 template-haskell/2.13.0.0 terminfo/0.4.1.1 text/1.2.3.0 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2
83+
8.4.2 Cabal/2.2.0.1 array/0.5.2.0 base/4.11.1.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.11.0 deepseq/1.4.3.0 directory/1.3.1.5 filepath/1.4.2 ghc/8.4.2* ghc-boot/8.4.2 ghc-boot-th/8.4.2 ghc-compact/0.1.0.0 ghc-prim/0.5.2.0 ghci/8.4.2 haskeline/0.7.4.2 hpc/0.6.0.3 integer-gmp/1.0.2.0 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 random/1.1 rts/1.0 template-haskell/2.13.0.0 terminfo/0.4.1.1 text/1.2.3.0 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1 stm/2.4.5.0
84+
8.4.3 Cabal/2.2.0.1 array/0.5.2.0 base/4.11.1.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.11.0 deepseq/1.4.3.0 directory/1.3.1.5 filepath/1.4.2 ghc/8.4.3* ghc-boot/8.4.3 ghc-boot-th/8.4.3 ghc-compact/0.1.0.0 ghc-prim/0.5.2.0 ghci/8.4.3 haskeline/0.7.4.2 hpc/0.6.0.3 integer-gmp/1.0.2.0 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.4.5.0 template-haskell/2.13.0.0 terminfo/0.4.1.1 text/1.2.3.0 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1
85+
8.4.4 Cabal/2.2.0.1 array/0.5.2.0 base/4.11.1.0 binary/0.8.5.1 bytestring/0.10.8.2 containers/0.5.11.0 deepseq/1.4.3.0 directory/1.3.1.5 filepath/1.4.2 ghc/8.4.4* ghc-boot/8.4.4 ghc-boot-th/8.4.4 ghc-compact/0.1.0.0 ghc-prim/0.5.2.0 ghci/8.4.4 haskeline/0.7.4.2 hpc/0.6.0.3 integer-gmp/1.0.2.0 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.4.5.1 template-haskell/2.13.0.0 terminfo/0.4.1.1 text/1.2.3.1 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1
86+
87+
############################################
88+
# GHC 8.6.x
89+
90+
8.6.1 Cabal/2.4.0.1 array/0.5.2.0 base/4.12.0.0 binary/0.8.6.0 bytestring/0.10.8.2 containers/0.6.0.1 deepseq/1.4.4.0 directory/1.3.3.0 filepath/1.4.2.1 ghc/8.6.1* ghc-boot/8.6.1 ghc-boot-th/8.6.1 ghc-compact/0.1.0.0 ghc-heap/8.6.1 ghc-prim/0.5.3 ghci/8.6.1 haskeline/0.7.4.3 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.6.1 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.5.0.0 template-haskell/2.14.0.0 terminfo/0.4.1.2 text/1.2.3.1 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1
91+
8.6.2 Cabal/2.4.0.1 array/0.5.3.0 base/4.12.0.0 binary/0.8.6.0 bytestring/0.10.8.2 containers/0.6.0.1 deepseq/1.4.4.0 directory/1.3.3.0 filepath/1.4.2.1 ghc/8.6.2* ghc-boot/8.6.2 ghc-boot-th/8.6.2 ghc-compact/0.1.0.0 ghc-heap/8.6.2 ghc-prim/0.5.3 ghci/8.6.2 haskeline/0.7.4.3 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.6.1 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.5.0.0 template-haskell/2.14.0.0 terminfo/0.4.1.2 text/1.2.3.1 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1
92+
8.6.3 Cabal/2.4.0.1 array/0.5.3.0 base/4.12.0.0 binary/0.8.6.0 bytestring/0.10.8.2 containers/0.6.0.1 deepseq/1.4.4.0 directory/1.3.3.0 filepath/1.4.2.1 ghc/8.6.3 ghc-boot/8.6.3 ghc-boot-th/8.6.3 ghc-compact/0.1.0.0 ghc-heap/8.6.3 ghc-prim/0.5.3 ghci/8.6.3 haskeline/0.7.4.3 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.6.3 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.3.0 rts/1.0 stm/2.5.0.0 template-haskell/2.14.0.0 terminfo/0.4.1.2 text/1.2.3.1 time/1.8.0.2 transformers/0.5.5.0 unix/2.7.2.2 xhtml/3000.2.2.1
93+
8.6.4 Cabal/2.4.0.1 array/0.5.3.0 base/4.12.0.0 binary/0.8.6.0 bytestring/0.10.8.2 containers/0.6.0.1 deepseq/1.4.4.0 directory/1.3.3.0 filepath/1.4.2.1 ghc/8.6.4* ghc-boot/8.6.4 ghc-boot-th/8.6.4 ghc-compact/0.1.0.0 ghc-heap/8.6.4 ghc-prim/0.5.3 ghci/8.6.4 haskeline/0.7.4.3 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.6.3 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.5.0 rts/1.0 stm/2.5.0.0 template-haskell/2.14.0.0 terminfo/0.4.1.2 text/1.2.3.1 time/1.8.0.2 transformers/0.5.6.2 unix/2.7.2.2 xhtml/3000.2.2.1
94+
8.6.5 Cabal/2.4.0.1 array/0.5.3.0 base/4.12.0.0 binary/0.8.6.0 bytestring/0.10.8.2 containers/0.6.0.1 deepseq/1.4.4.0 directory/1.3.3.0 filepath/1.4.2.1 ghc/8.6.5* ghc-boot/8.6.5 ghc-boot-th/8.6.5 ghc-compact/0.1.0.0 ghc-heap/8.6.5 ghc-prim/0.5.3 ghci/8.6.5 haskeline/0.7.4.3 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.6.3 mtl/2.2.2 parsec/3.1.13.0 pretty/1.1.3.6 process/1.6.5.0 rts/1.0 stm/2.5.0.0 template-haskell/2.14.0.0 terminfo/0.4.1.2 text/1.2.3.1 time/1.8.0.2 transformers/0.5.6.2 unix/2.7.2.2 xhtml/3000.2.2.1
95+
96+
############################################
97+
# GHC 8.8.x
98+
99+
8.8.1 Cabal/3.0.0.0 array/0.5.4.0 base/4.13.0.0 binary/0.8.7.0 bytestring/0.10.9.0 containers/0.6.2.1 deepseq/1.4.4.0 directory/1.3.3.2 filepath/1.4.2.1 ghc/8.8.1* ghc-boot/8.8.1 ghc-boot-th/8.8.1 ghc-compact/0.1.0.0 ghc-heap/8.8.1 ghc-prim/0.5.3 ghci/8.8.1 haskeline/0.7.5.0 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.8.1 mtl/2.2.2 parsec/3.1.14.0 pretty/1.1.3.6 process/1.6.5.1 rts/1.0 stm/2.5.0.0 template-haskell/2.15.0.0 terminfo/0.4.1.4 text/1.2.4.0 time/1.9.3 transformers/0.5.6.2 unix/2.7.2.2 xhtml/3000.2.2.1
100+
101+
############################################
102+
# GHC HEAD
103+
104+
HEAD Cabal/3.0.0.0 array/0.5.4.0 base/4.13.0.0 binary/0.8.7.0 bytestring/0.10.9.0 containers/0.6.2.1 deepseq/1.4.4.0 directory/1.3.3.2 filepath/1.4.2.1 ghc/8.9* ghc-boot/8.9* ghc-boot-th/8.9* ghc-compact/0.1.0.0 ghc-heap/8.9* ghc-prim/0.6.1 ghci/8.9* haskeline/0.7.5.0 hpc/0.6.0.3 integer-gmp/1.0.2.0 libiserv/8.9* mtl/2.2.2 parsec/3.1.14.0 pretty/1.1.3.6 process/1.6.5.1 stm/2.5.0.0 template-haskell/2.16.0.0 terminfo/0.4.1.4 text/1.2.3.1 time/1.9.3 transformers/0.5.6.2 unix/2.7.2.2 xhtml/3000.2.2.1

src/Stack2nix/External/Stack.hs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE OverloadedStrings #-}
33
{-# LANGUAGE RecordWildCards #-}
4+
{-# LANGUAGE TemplateHaskell #-}
45

56
module Stack2nix.External.Stack
67
( PackageRef(..), runPlan
@@ -17,6 +18,8 @@ import Data.Text (pack, unpack)
1718
import Distribution.Nixpkgs.Haskell.Derivation (Derivation,
1819
configureFlags)
1920
import qualified Distribution.Nixpkgs.Haskell.Hackage as DB
21+
import Language.Haskell.TH (runIO,)
22+
import Language.Haskell.TH.Syntax (qAddDependentFile)
2023
import Options.Applicative
2124
import Path (parseAbsFile)
2225
import Stack.Build.Source (getGhcOptions, loadSourceMapFull)
@@ -125,7 +128,10 @@ planAndGenerate boptsCli baseDir remoteUri args@Args {..} ghcVersion = do
125128
)
126129
pkgs
127130
let locals = map (\l -> show (packageName (lpPackage l))) _locals
128-
liftIO . render drvs args locals $ nixVersion ghcVersion
131+
basePackageNames <- case M.lookup (show ghcVersion) ghcBaseLibsMap of
132+
Nothing -> fail $ "GHC version " ++ show ghcVersion ++ " was not in compiled-in pkg_versions.txt!"
133+
Just names -> pure (Set.fromList names)
134+
liftIO $ render drvs args locals (nixVersion ghcVersion) basePackageNames
129135

130136
-- | Add ghc-options declared in stack.yaml to the nix derivation for a package
131137
-- by adding to the configureFlags attribute of the derivation
@@ -200,3 +206,28 @@ globalOpts currentDir stackRoot Args{..} =
200206

201207
buildOpts :: BuildOptsCLI
202208
buildOpts = fromJust . getParseResult $ execParserPure defaultPrefs (info (buildOptsParser Build) briefDesc) ["--dry-run"]
209+
210+
ghcBaseLibsMap :: Map String [String]
211+
ghcBaseLibsMap =
212+
$$(do
213+
-- From https://github.com/bgamari/ghc-utils/blob/master/library-versions/pkg_versions.txt
214+
let path = "pkg_versions.txt"
215+
qAddDependentFile path
216+
s <- runIO $ readFile path
217+
218+
let nonCommentLines :: [String]
219+
nonCommentLines =
220+
[ l | l@(firstChar:_) <- lines s, firstChar /= '#' ]
221+
222+
let ghcsWithLibNames :: Map String [String]
223+
-- `fromListWith (++)` because the Win32 information is in a separate
224+
-- section on the top of `pkg_versions.txt`, for the same keys; that
225+
-- needs to be merged in.
226+
ghcsWithLibNames = M.fromListWith (++) $
227+
[ (ghc, libNames)
228+
| ghc:libs <- map words nonCommentLines
229+
, let libNames = map (takeWhile (/= '/')) libs
230+
]
231+
232+
[|| ghcsWithLibNames ||]
233+
)

0 commit comments

Comments
 (0)