Skip to content

Commit bbd522b

Browse files
committed
Merge branch 'master' of github.com:input-output-hk/haskell.nix into circuithub
2 parents a112f3e + dd0a035 commit bbd522b

File tree

243 files changed

+36582
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+36582
-392
lines changed

.github/workflows/publish.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Publish a flake to flakestry"
2+
on:
3+
push:
4+
tags:
5+
- "v?[0-9]+.[0-9]+.[0-9]+"
6+
- "v?[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "The existing tag to publish"
11+
type: "string"
12+
required: true
13+
jobs:
14+
publish-flake:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: "write"
18+
contents: "read"
19+
steps:
20+
- uses: flakestry/flakestry-publish@main
21+
with:
22+
version: "${{ inputs.tag || github.ref_name }}"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ The troubleshooting documentation also contains some help for other common issue
2525
The `haskell.nix` repository contains the runtime system for building
2626
Haskell packages in Nix. It depends on other repos, which are:
2727

28-
- [`nix-tools`](https://github.com/input-output-hk/nix-tools) — provides the programs for generating Nix expressions from Haskell projects.
29-
3028
- [`hackage.nix`](https://github.com/input-output-hk/hackage.nix) — the latest contents of the [Hackage](https://hackage.haskell.org/) databases, converted to Nix expressions.
3129

3230
- [`stackage.nix`](https://github.com/input-output-hk/stackage.nix) — all of the [Stackage](https://www.stackage.org/) snapshots, converted to Nix expressions.

build.nix

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ let
2020
haskell = pkgs.haskell-nix;
2121
buildHaskell = pkgs.buildPackages.haskell-nix;
2222
tool = buildHaskell.tool;
23+
ghcFromTo = from: to: __compareVersions haskell.compiler.${compiler-nix-name}.version from >= 0 && __compareVersions haskell.compiler.${compiler-nix-name}.version to < 0;
2324
in rec {
2425
tests = import ./test/default.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name; };
2526

@@ -43,53 +44,23 @@ in rec {
4344
"ghc8107" = "3.4.1";
4445
}.${compiler-nix-name} or "latest";
4546
};
46-
} // pkgs.lib.optionalAttrs (
47-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.2" >= 0
48-
&& __compareVersions haskell.compiler.${compiler-nix-name}.version "9.6" < 0) {
47+
} // pkgs.lib.optionalAttrs (ghcFromTo "9.2" "9.6") {
4948
stack =
5049
tool compiler-nix-name "stack" {
5150
version = "2.11.1";
5251
inherit evalPackages;
5352
};
54-
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" < 0) {
53+
} // pkgs.lib.optionalAttrs (ghcFromTo "8.10.7" "9.0") {
5554
# This version will build for ghc < 9.8, but we are only going to test it for
5655
# ghc < 9.0 (since newer versions do not work with ghc 8.10.7).
5756
"hls-22" = tool compiler-nix-name "haskell-language-server" {
5857
inherit evalPackages;
5958
src = pkgs.haskell-nix.sources."hls-2.2";
6059
};
61-
} // pkgs.lib.optionalAttrs (
62-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" >= 0 &&
63-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0
64-
) {
65-
"hls-23" = tool compiler-nix-name "haskell-language-server" {
60+
} // pkgs.lib.optionalAttrs (ghcFromTo "9.0" "9.8") {
61+
"hls-26" = tool compiler-nix-name "haskell-language-server" {
6662
inherit evalPackages;
67-
src = pkgs.haskell-nix.sources."hls-2.3";
68-
};
69-
} // pkgs.lib.optionalAttrs (
70-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" >= 0 &&
71-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.9" < 0
72-
) {
73-
"hls-24" = tool compiler-nix-name "haskell-language-server" {
74-
inherit evalPackages;
75-
src = pkgs.haskell-nix.sources."hls-2.4";
76-
# Even though this is in the cabal.project it is inside a condional
77-
# and so haskell.nix cannot parse it properly. Luckily adding it
78-
# again seems to work fine.
79-
cabalProjectLocal = ''
80-
repository head.hackage.ghc.haskell.org
81-
url: https://ghc.gitlab.haskell.org/head.hackage/
82-
secure: True
83-
key-threshold: 3
84-
root-keys:
85-
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
86-
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
87-
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
88-
--sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68=
89-
90-
if impl(ghc < 9.7)
91-
active-repositories: hackage.haskell.org
92-
'';
63+
src = pkgs.haskell-nix.sources."hls-2.6";
9364
};
9465
})
9566
);

compiler/ghc/default.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ let self =
6464
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
6565
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
6666

67-
, useLdGold ?
67+
, useLdGold ?
6868
# might be better check to see if cc is clang/llvm?
6969
# use gold as the linker on linux to improve link times
7070
# do not use it on musl due to a ld.gold bug. See: <https://sourceware.org/bugzilla/show_bug.cgi?id=22266>.
71-
(stdenv.targetPlatform.isLinux && !stdenv.targetPlatform.isAndroid && !stdenv.targetPlatform.isMusl)
71+
(stdenv.targetPlatform.isLinux && !stdenv.targetPlatform.isAndroid && !stdenv.targetPlatform.isMusl)
7272

7373
, ghc-version ? src-spec.version
7474
, ghc-version-date ? null
@@ -311,7 +311,11 @@ let
311311
# For cross compilers only the RTS should be built with -mno-outline-atomics
312312
+ lib.optionalString (!hostPlatform.isAarch64 && targetPlatform.isLinux && targetPlatform.isAarch64)
313313
" '*.rts.ghc.c.opts += -optc-mno-outline-atomics'"
314-
# The following is required if we build on aarch64-darwin for aarch64-iOS. Otherwise older
314+
+ lib.optionalString enableRelocatedStaticLibs
315+
" '*.*.ghc.*.opts += -fPIC' '*.*.cc.*.opts += -fPIC'"
316+
+ lib.optionalString (enableRelocatedStaticLibs && targetPlatform.isx86_64 && !targetPlatform.isWindows)
317+
" '*.*.ghc.*.opts += -fexternal-dynamic-refs'"
318+
# The following is required if we build on aarch64-darwin for aarch64-iOS. Otherwise older
315319
# iPhones/iPads/... won't understand the compiled code, as the compiler will emit LDSETALH
316320
# + lib.optionalString (targetPlatform.???) "'*.rts.ghc.c.opts += -optc-mcpu=apple-a7 -optc-march=armv8-a+norcpc'"
317321
# For GHC versions in the 9.x range that don't support the +native_bignum flavour transformer yet
@@ -403,7 +407,7 @@ stdenv.mkDerivation (rec {
403407
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
404408
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
405409
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
406-
'') + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
410+
'') + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
407411
# set LD explicitly if we want gold even if we aren't cross compiling
408412
''
409413
export LD="${targetCC.bintools}/bin/ld.gold"
@@ -779,9 +783,9 @@ stdenv.mkDerivation (rec {
779783
'';
780784

781785
# Hadrian's installation only works for native compilers, and is broken for cross compilers.
782-
# However Hadrian produces mostly relocatable installs anyway, so we can simply copy
786+
# However Hadrian produces mostly relocatable installs anyway, so we can simply copy
783787
# stage1/{bin, lib, share} into the destination as the copy phase.
784-
788+
785789
installPhase =
786790
if installStage1
787791
then ''

docs/SUMMARY.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
- [Tutorials](./tutorials/index.md)
55
- [Creating a development environment](./tutorials/development.md)
66
- [Getting started](./tutorials/getting-started.md)
7-
- [Getting started with Flakes](./tutorials/getting-started-flakes.md)
8-
- [Getting started with Hix](./tutorials/getting-started-hix.md)
97
- [Sourcing files only part of git repository using cleanGit](./tutorials/clean-git.md)
108
- [Handling git repositories in projects](./tutorials/source-repository-hashes.md)
119
- [Mapping non-Haskell dependencies to Nixpkgs](./tutorials/pkg-map.md)

docs/tutorials/getting-started-flakes.md

Lines changed: 0 additions & 133 deletions
This file was deleted.

docs/tutorials/getting-started-hix.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)