tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ghc: drop 8.8.1
authored by
Gabor Greif
and committed by
Peter Simons
5 years ago
a634bd0f
daf79ea7
+3
-252
4 changed files
expand all
collapse all
unified
split
doc
languages-frameworks
haskell.section.md
pkgs
development
compilers
elm
default.nix
ghc
8.8.1.nix
top-level
haskell-packages.nix
-2
doc/languages-frameworks/haskell.section.md
···
110
110
haskell.compiler.ghc863Binary ghc-8.6.3-binary
111
111
haskell.compiler.ghc865 ghc-8.6.5
112
112
haskell.compiler.integer-simple.ghc865 ghc-8.6.5
113
113
-
haskell.compiler.ghc881 ghc-8.8.1
114
114
-
haskell.compiler.integer-simple.ghc881 ghc-8.8.1
115
113
haskell.compiler.ghc882 ghc-8.8.2
116
114
haskell.compiler.integer-simple.ghc882 ghc-8.8.2
117
115
haskell.compiler.ghc883 ghc-8.8.3
+3
-3
pkgs/development/compilers/elm/default.nix
···
4
4
let
5
5
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
6
6
7
7
-
hsPkgs = haskell.packages.ghc881.override {
7
7
+
hsPkgs = haskell.packages.ghc883.override {
8
8
overrides = self: super: with haskell.lib;
9
9
let elmPkgs = rec {
10
10
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
···
28
28
`package/nix/build.sh`
29
29
*/
30
30
elm-format = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-format.nix {}) (drv: {
31
31
-
# GHC 8.8.1 support
31
31
+
# GHC 8.8.3 support
32
32
# https://github.com/avh4/elm-format/pull/640
33
33
patches = [(
34
34
fetchpatch {
···
39
39
# Tests are failing after upgrade to ghc881.
40
40
# Cause is probably just a minor change in stdout output
41
41
# see https://github.com/avh4/elm-format/pull/640
42
42
-
doCheck = false;
42
42
+
# doCheck = false;
43
43
jailbreak = true;
44
44
}));
45
45
-236
pkgs/development/compilers/ghc/8.8.1.nix
···
1
1
-
{ stdenv, pkgsBuildTarget, targetPackages
2
2
-
3
3
-
# build-tools
4
4
-
, bootPkgs
5
5
-
, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
6
6
-
, bash
7
7
-
8
8
-
, libiconv ? null, ncurses
9
9
-
10
10
-
, # GHC can be built with system libffi or a bundled one.
11
11
-
libffi ? null
12
12
-
13
13
-
, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS
14
14
-
, # LLVM is conceptually a run-time-only depedendency, but for
15
15
-
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
16
16
-
# build-time dependency too.
17
17
-
buildLlvmPackages, llvmPackages
18
18
-
19
19
-
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
20
20
-
# library instead of the faster but GPLed integer-gmp library.
21
21
-
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
22
22
-
23
23
-
, # If enabled, use -fPIC when compiling static libs.
24
24
-
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
25
25
-
26
26
-
, # Whether to build dynamic libs for the standard library (on the target
27
27
-
# platform). Static libs are always built.
28
28
-
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
29
29
-
30
30
-
, # Whetherto build terminfo.
31
31
-
enableTerminfo ? !stdenv.targetPlatform.isWindows
32
32
-
33
33
-
, # What flavour to build. An empty string indicates no
34
34
-
# specific flavour and falls back to ghc default values.
35
35
-
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
36
36
-
(if useLLVM then "perf-cross" else "perf-cross-ncg")
37
37
-
38
38
-
, # Whether to disable the large address space allocator
39
39
-
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
40
40
-
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
41
41
-
}:
42
42
-
43
43
-
assert !enableIntegerSimple -> gmp != null;
44
44
-
45
45
-
let
46
46
-
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
47
47
-
48
48
-
inherit (bootPkgs) ghc;
49
49
-
50
50
-
# TODO(@Ericson2314) Make unconditional
51
51
-
targetPrefix = stdenv.lib.optionalString
52
52
-
(targetPlatform != hostPlatform)
53
53
-
"${targetPlatform.config}-";
54
54
-
55
55
-
buildMK = ''
56
56
-
BuildFlavour = ${ghcFlavour}
57
57
-
ifneq \"\$(BuildFlavour)\" \"\"
58
58
-
include mk/flavours/\$(BuildFlavour).mk
59
59
-
endif
60
60
-
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
61
61
-
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
62
62
-
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
63
63
-
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
64
64
-
CrossCompilePrefix = ${targetPrefix}
65
65
-
HADDOCK_DOCS = NO
66
66
-
BUILD_SPHINX_HTML = NO
67
67
-
BUILD_SPHINX_PDF = NO
68
68
-
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
69
69
-
GhcLibHcOpts += -fPIC
70
70
-
GhcRtsHcOpts += -fPIC
71
71
-
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
72
72
-
EXTRA_CC_OPTS += -std=gnu99
73
73
-
'';
74
74
-
75
75
-
# Splicer will pull out correct variations
76
76
-
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
77
77
-
++ [libffi]
78
78
-
++ stdenv.lib.optional (!enableIntegerSimple) gmp
79
79
-
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
80
80
-
81
81
-
toolsForTarget = [
82
82
-
pkgsBuildTarget.targetPackages.stdenv.cc
83
83
-
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
84
84
-
85
85
-
targetCC = builtins.head toolsForTarget;
86
86
-
87
87
-
# ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856
88
88
-
# see #84670 and #49071 for more background.
89
89
-
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
90
90
-
91
91
-
in
92
92
-
stdenv.mkDerivation (rec {
93
93
-
version = "8.8.1";
94
94
-
name = "${targetPrefix}ghc-${version}";
95
95
-
96
96
-
src = fetchurl {
97
97
-
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
98
98
-
sha256 = "06kj4fhvijinjafiy4s873n60qly323rdlz9bmc79nhlp3cq72lh";
99
99
-
};
100
100
-
101
101
-
enableParallelBuilding = true;
102
102
-
103
103
-
outputs = [ "out" "doc" ];
104
104
-
105
105
-
postPatch = "patchShebangs .";
106
106
-
107
107
-
# GHC is a bit confused on its cross terminology.
108
108
-
preConfigure = ''
109
109
-
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
110
110
-
export "''${env#TARGET_}=''${!env}"
111
111
-
done
112
112
-
# GHC is a bit confused on its cross terminology, as these would normally be
113
113
-
# the *host* tools.
114
114
-
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
115
115
-
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
116
116
-
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
117
117
-
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
118
118
-
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
119
119
-
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
120
120
-
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
121
121
-
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
122
122
-
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
123
123
-
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
124
124
-
125
125
-
echo -n "${buildMK}" > mk/build.mk
126
126
-
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
127
127
-
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
128
128
-
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
129
129
-
'' + stdenv.lib.optionalString stdenv.isDarwin ''
130
130
-
export NIX_LDFLAGS+=" -no_dtrace_dof"
131
131
-
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
132
132
-
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
133
133
-
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
134
134
-
echo "patching llvm-targets for musl targets..."
135
135
-
echo "Cloning these existing '*-linux-gnu*' targets:"
136
136
-
grep linux-gnu llvm-targets | sed 's/^/ /'
137
137
-
echo "(go go gadget sed)"
138
138
-
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
139
139
-
echo "llvm-targets now contains these '*-linux-musl*' targets:"
140
140
-
grep linux-musl llvm-targets | sed 's/^/ /'
141
141
-
142
142
-
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
143
143
-
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
144
144
-
for x in configure aclocal.m4; do
145
145
-
substituteInPlace $x \
146
146
-
--replace '*-android*|*-gnueabi*)' \
147
147
-
'*-android*|*-gnueabi*|*-musleabi*)'
148
148
-
done
149
149
-
'';
150
150
-
151
151
-
# TODO(@Ericson2314): Always pass "--target" and always prefix.
152
152
-
configurePlatforms = [ "build" "host" ]
153
153
-
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
154
154
-
# `--with` flags for libraries needed for RTS linker
155
155
-
configureFlags = [
156
156
-
"--datadir=$doc/share/doc/ghc"
157
157
-
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
158
158
-
] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
159
159
-
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
160
160
-
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
161
161
-
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
162
162
-
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
163
163
-
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
164
164
-
"--enable-bootstrap-with-devel-snapshot"
165
165
-
] ++ stdenv.lib.optionals useLdGold [
166
166
-
"CFLAGS=-fuse-ld=gold"
167
167
-
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
168
168
-
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
169
169
-
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
170
170
-
"--disable-large-address-space"
171
171
-
];
172
172
-
173
173
-
# Make sure we never relax`$PATH` and hooks support for compatibility.
174
174
-
strictDeps = true;
175
175
-
176
176
-
# Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
177
177
-
dontAddExtraLibs = true;
178
178
-
179
179
-
nativeBuildInputs = [
180
180
-
perl autoconf automake m4 python3 sphinx
181
181
-
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
182
182
-
];
183
183
-
184
184
-
# For building runtime libs
185
185
-
depsBuildTarget = toolsForTarget;
186
186
-
187
187
-
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
188
188
-
189
189
-
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
190
190
-
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
191
191
-
192
192
-
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
193
193
-
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
194
194
-
195
195
-
# required, because otherwise all symbols from HSffi.o are stripped, and
196
196
-
# that in turn causes GHCi to abort
197
197
-
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
198
198
-
199
199
-
checkTarget = "test";
200
200
-
201
201
-
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
202
202
-
203
203
-
postInstall = ''
204
204
-
# Install the bash completion file.
205
205
-
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
206
206
-
207
207
-
# Patch scripts to include "readelf" and "cat" in $PATH.
208
208
-
for i in "$out/bin/"*; do
209
209
-
test ! -h $i || continue
210
210
-
egrep --quiet '^#!' <(head -n 1 $i) || continue
211
211
-
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
212
212
-
done
213
213
-
'';
214
214
-
215
215
-
passthru = {
216
216
-
inherit bootPkgs targetPrefix;
217
217
-
218
218
-
inherit llvmPackages;
219
219
-
inherit enableShared;
220
220
-
221
221
-
# Our Cabal compiler name
222
222
-
haskellCompilerName = "ghc-${version}";
223
223
-
};
224
224
-
225
225
-
meta = {
226
226
-
homepage = "http://haskell.org/ghc";
227
227
-
description = "The Glasgow Haskell Compiler";
228
228
-
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
229
229
-
inherit (ghc.meta) license platforms;
230
230
-
};
231
231
-
232
232
-
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
233
233
-
dontStrip = true;
234
234
-
dontPatchELF = true;
235
235
-
noAuditTmpdir = true;
236
236
-
})
-11
pkgs/top-level/haskell-packages.nix
···
56
56
buildLlvmPackages = buildPackages.llvmPackages_6;
57
57
llvmPackages = pkgs.llvmPackages_6;
58
58
};
59
59
-
ghc881 = callPackage ../development/compilers/ghc/8.8.1.nix {
60
60
-
bootPkgs = packages.ghc865Binary;
61
61
-
inherit (buildPackages.python3Packages) sphinx;
62
62
-
buildLlvmPackages = buildPackages.llvmPackages_7;
63
63
-
llvmPackages = pkgs.llvmPackages_7;
64
64
-
};
65
59
ghc882 = callPackage ../development/compilers/ghc/8.8.2.nix {
66
60
bootPkgs = packages.ghc865Binary;
67
61
inherit (buildPackages.python3Packages) sphinx;
···
133
127
buildHaskellPackages = bh.packages.ghc865;
134
128
ghc = bh.compiler.ghc865;
135
129
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { };
136
136
-
};
137
137
-
ghc881 = callPackage ../development/haskell-modules {
138
138
-
buildHaskellPackages = bh.packages.ghc881;
139
139
-
ghc = bh.compiler.ghc881;
140
140
-
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.8.x.nix { };
141
130
};
142
131
ghc882 = callPackage ../development/haskell-modules {
143
132
buildHaskellPackages = bh.packages.ghc882;