on master help sign in
Add an alternative stack configuration file to deal with upstream GHC issues.

There is an upstream issue with GHC on some Ubuntu and Fedora machines. The issue is that for GHC versions greater than 8.4.X linking to libFFI is broken. See the following GHC issue page for more information: <https://gitlab.haskell.org/ghc/ghc/issues/15397> This means that an Idris built with `libFFI` support will fail at runtime as the executable would not be able to find the correct `libffi` shared object. This will cause the build to fail. This commit adds an alternative stack configuration file to help bypass the issues for those affected by the issue.

commitf25bcfe30f92e20c2d2dabe33745db9e7a80984d authorJan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk> dateThu 16 May 2019, 11:10 (7 years ago) parente09ab81
2 files changed+45−4
INSTALL.md+20−4 stack-alt.yaml+25
INSTALL.md+20−4
@@ -81,9 +81,9 @@ To install Idris:
8181* `stack install`
8282
8383Stack will install Idris (and related executables) into `$HOME/.local/bin/`
84−on Unix based systems and an appropriate place on Windows. The libraries that
85−are included with Idris (e.g. Builtins, Prelude) will 'install' into `<source
86−dir>/.stack_work/install/...` so you'll need to keep your source directory
84+on Unix based systems and an appropriate place on Windows. The libraries that
85+are included with Idris (e.g. Builtins, Prelude) will 'install' into `<source
86+dir>/.stack_work/install/...` so you'll need to keep your source directory
8787around after you've installed Idris using Stack.
8888
8989Of note: If you haven't used stack before commands will also setup the
@@ -125,4 +125,20 @@ encounter this then the fix is to augment the `PKG_CONFIG_PATH` for
125125
126126```
127127PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig stack build
128−```
128+```
129+
130+## Issue with GHC on Ubuntu/Fedora
131+
132+There is an upstream issue with GHC on some Ubuntu and Fedora machines.
133+The issue is that for GHC versions greater than 8.4.X linking to libFFI is broken.
134+See the following GHC issue page for more information:
135+
136+ <https://gitlab.haskell.org/ghc/ghc/issues/15397>
137+
138+This means that an Idris built with `libFFI` support will fail at runtime as the executable would not be able to find the correct `libffi` shared object.
139+This will cause the build to fail.
140+Specifically, one will see an error message along the lines of:
141+
142+> error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
143+
144+We have supplied an alternative stack configuration file (`stack-alt.yaml`) that will use a version of GHC prior to the upstream issue being introduced.
stack-alt.yamlnew file+25
@@ -0,0 +1,25 @@
1+#recheck extra-deps next on resolver or cabal file change
2+resolver: lts-11.4
3+
4+packages:
5+ - location: .
6+
7+extra-deps:
8+ - network-2.8.0.0@sha256:aae171e6c6028a7791dbe4de5b9d2da398056359e3cc7927465ffa3cdae1aa0b
9+ - Cabal-2.2.0.1@sha256:2a80d8fb655474f0eaeb20434c47f64f84e6302e55973056f00df8ca050b9683
10+ - megaparsec-7.0.4
11+ - parser-combinators-1.0.0
12+ - zip-archive-0.3.3@sha256:47cf2d66cc8e237f7226837758e1b041e24048ef3820d3d10276c500edb921bf
13+ - containers-0.5.11.0@sha256:28ad7337057442f75bc689315ab4ec7bdf5e6b2c39668f306672cecd82c02798
14+
15+flags:
16+ idris:
17+ FFI: true
18+ GMP: true
19+
20+ghc-options:
21+ idris: -fwarn-unused-imports -fwarn-unused-binds
22+
23+nix:
24+ enable: false
25+ shell-file: stack-shell.nix