Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hkm/aarch64-musl
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed May 30, 2023
2 parents 293aeb3 + f94ebdf commit 1ea798c
Show file tree
Hide file tree
Showing 401 changed files with 61,485 additions and 188 deletions.
14 changes: 12 additions & 2 deletions build.nix
Expand Up @@ -43,8 +43,18 @@ in rec {
"ghc8107" = "3.4.1";
}.${compiler-nix-name} or "latest";
};
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.4" < 0) {
stack = tool compiler-nix-name "stack" { version = "2.9.3"; inherit evalPackages; };
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.6" < 0) {
stack =
tool compiler-nix-name "stack" {
cabalProjectLocal = ''
constraints: optparse-applicative <0.18
'';
version =
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.2" < 0
then "2.9.3"
else "2.11.1";
inherit evalPackages;
};
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.6" < 0) {
hls-latest = tool compiler-nix-name "haskell-language-server" {
inherit evalPackages;
Expand Down
24 changes: 12 additions & 12 deletions ci.nix
Expand Up @@ -50,41 +50,41 @@
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2211") {
ghc8107 = false;
ghc902 = false;
ghc927 = false;
ghc928 = false;
ghc945 = false;
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
ghc884 = false;
ghc8107 = true;
ghc902 = false;
ghc927 = true;
ghc928 = true;
ghc945 = true;
ghc961 = true;
ghc962 = true;
}));
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
# We need to use the actual nixpkgs version we're working with here, since the values
# of 'lib.systems.examples' are not understood between all versions
let lib = nixpkgs.lib;
in lib.optionalAttrs (nixpkgsName == "unstable"
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc961"])
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc961"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc961"])
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc961"])
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
)) {
inherit (lib.systems.examples) ghcjs;
} // lib.optionalAttrs (nixpkgsName == "unstable"
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc945" "ghc961"])
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
inherit (lib.systems.examples) mingwW64;
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc945" "ghc961"]) {
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"]) {
# Musl cross only works on linux
# aarch64 cross only works on linux
inherit (lib.systems.examples) musl64 aarch64-multiplatform aarch64-multiplatform-musl;
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc945" "ghc961"]) {
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc961"]) {
inherit (lib.systems.examples) aarch64-multiplatform-musl;
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927"]) {
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928"]) {
# TODO fix this for the compilers we build with hadrian (ghc >=9.4)
inherit (lib.systems.examples) aarch64-multiplatform-musl;
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc944" "ghc961"]) {
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962"]) {
inherit (lib.systems.examples) aarch64-multiplatform-musl;
};
isDisabled = d: d.meta.disabled or false;
Expand Down
3 changes: 2 additions & 1 deletion compiler/ghc/default.nix
Expand Up @@ -280,7 +280,8 @@ let
+ lib.optionalString (!enableShared) "+no_dynamic_ghc"
+ lib.optionalString useLLVM "+llvm"
+ lib.optionalString enableDWARF "+debug_info"
+ lib.optionalString targetPlatform.isGhcjs "+native_bignum+no_profiled_libs"
+ lib.optionalString (enableNativeBignum || targetPlatform.isGhcjs) "+native_bignum"
+ lib.optionalString targetPlatform.isGhcjs "+no_profiled_libs"
} --docs=no-sphinx -j --verbose"
# This is needed to prevent $GCC from emitting out of line atomics.
# Those would then result in __aarch64_ldadd1_sync and others being referenced, which
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/development/default.nix
Expand Up @@ -26,5 +26,5 @@ in pkgs.haskell-nix.project {
src = ./.;
};
# Specify the GHC version to use.
compiler-nix-name = "ghc927"; # Not required for `stack.yaml` based projects.
compiler-nix-name = "ghc928"; # Not required for `stack.yaml` based projects.
}
2 changes: 1 addition & 1 deletion docs/tutorials/getting-started-flakes/flake.nix
Expand Up @@ -12,7 +12,7 @@
helloProject =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc927";
compiler-nix-name = "ghc928";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/getting-started/default.nix
Expand Up @@ -26,5 +26,5 @@ in pkgs.haskell-nix.project {
src = ./.;
};
# Specify the GHC version to use.
compiler-nix-name = "ghc927"; # Not required for `stack.yaml` based projects.
compiler-nix-name = "ghc928"; # Not required for `stack.yaml` based projects.
}
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Expand Up @@ -65,7 +65,7 @@
};

outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-2105, nixpkgs-2111, nixpkgs-2205, nixpkgs-2211, flake-utils, ... }@inputs:
let compiler = "ghc927";
let compiler = "ghc928";
config = import ./config.nix;

traceNames = prefix: builtins.mapAttrs (n: v:
Expand Down
6 changes: 3 additions & 3 deletions lib/cabal-project-parser.nix
Expand Up @@ -84,8 +84,8 @@ let
url = repo.location;
"${refOrRev}" = repo.tag;
sha256 = repo."--sha256" or (
if sha256map != null
then sha256map."${repo.location}"."${repo.tag}"
if sha256map != null && sha256map ? ${repo.location}
then sha256map.${repo.location}.${repo.tag}
else null);
subdirs = if repo ? subdir
then pkgs.lib.filter (x: x != "") (pkgs.lib.splitString " " repo.subdir)
Expand Down Expand Up @@ -136,7 +136,7 @@ let
attrs = parseBlockLines x.fst;
sha256 = attrs."--sha256" or (
if sha256map != null
then sha256map."${attrs.url}"
then sha256map.${attrs.url} or null
else null);
in rec {
# This is `some-name` from the `repository some-name` line in the `cabal.project` file.
Expand Down
6 changes: 4 additions & 2 deletions lib/stack-cache-generator.nix
Expand Up @@ -82,8 +82,10 @@ concatMap (dep:
let
is-private = private dep.url;
sha256 =
if dep.sha256 != null then dep.sha256
else if sha256map != null then sha256map."${dep.url}"."${dep.rev}"
if dep.sha256 != null
then dep.sha256
else if sha256map != null && sha256map ? ${dep.url}
then sha256map.${dep.url}.${dep.rev}
else null;
branch = lookupBranch {
location = dep.url;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ea798c

Please sign in to comment.