Skip to content

Commit ae7528a

Browse files
committed
Merge branch 'master' of github.com:input-output-hk/haskell.nix into circuithub
2 parents 94c8675 + 71c5a44 commit ae7528a

File tree

13 files changed

+107
-119
lines changed

13 files changed

+107
-119
lines changed

build.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@ in rec {
4646
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.6" < 0) {
4747
stack =
4848
tool compiler-nix-name "stack" {
49-
cabalProjectLocal = ''
50-
constraints: optparse-applicative <0.18
51-
'';
5249
version =
5350
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.2" < 0
54-
then "2.9.3"
51+
then "2.9.3.1"
5552
else "2.11.1";
5653
inherit evalPackages;
5754
};

builder/comp-builder.nix

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ let
172172
) ++ [ "$(cat $configFiles/configure-flags)"
173173
] ++ commonConfigureFlags);
174174

175-
commonConfigureFlags = ([
175+
commonConfigureFlags = [
176176
# GHC
177177
"--with-ghc=${ghc.targetPrefix}ghc"
178178
"--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
@@ -209,7 +209,7 @@ let
209209
++ lib.optional (enableLibraryProfiling || enableProfiling) "--profiling-detail=${profilingDetail}"
210210
++ lib.optional stdenv.hostPlatform.isLinux (enableFeature enableDeadCodeElimination "split-sections")
211211
++ lib.optionals haskellLib.isCrossHost (
212-
map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
212+
map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals stdenv.hostPlatform.isWindows ["--via-asm"])
213213
++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${
214214
# Older ghcjs patched config.sub to support "js-unknown-ghcjs" (not "javascript-unknown-ghcjs")
215215
if stdenv.hostPlatform.isGhcjs && builtins.compareVersions defaults.ghc.version "9" < 0
@@ -223,23 +223,22 @@ let
223223
++ lib.optionals useLLVM [
224224
"--ghc-option=-fPIC" "--gcc-option=-fPIC"
225225
]
226-
++ map (o: ''--ghc${lib.optionalString (stdenv.hostPlatform.isGhcjs) "js"}-options="${o}"'') ghcOptions
226+
++ map (o: ''--ghc${lib.optionalString stdenv.hostPlatform.isGhcjs "js"}-options="${o}"'') ghcOptions
227227
++ lib.optional (
228228
# GHC 9.2 cross compiler built with older versions of GHC seem to have problems
229229
# with unique conters. Perhaps because the name changed for the counters.
230230
# TODO This work around to use `-j1` should be removed once we are able to build 9.2 with 9.2.
231231
haskellLib.isCrossHost
232232
&& builtins.compareVersions defaults.ghc.version "9.2.1" >= 0
233233
&& builtins.compareVersions defaults.ghc.version "9.3" < 0)
234-
"--ghc-options=-j1"
235-
);
234+
"--ghc-options=-j1";
236235

237236
# the build-tools version might be depending on the version of the package, similarly to patches
238237
executableToolDepends =
239238
(lib.concatMap (c: if c.isHaskell or false
240239
then builtins.attrValues (c.components.exes or {})
241240
else [c])
242-
(builtins.filter (x: !(isNull x)
241+
(builtins.filter (x: x != null
243242
# We always exclude hsc2hs from build-tools because it is unecessary as it is provided by ghc
244243
# and hsc2hs from ghc is first in PATH so the one from build-tools is never used.
245244
&& x.identifier.name or "" != "hsc2hs")
@@ -348,7 +347,11 @@ let
348347
inherit dontPatchELF dontStrip;
349348

350349
passthru = {
351-
inherit (package) identifier;
350+
identifier = package.identifier // {
351+
component-id = "${package.identifier.name}:${componentId.ctype}:${componentId.cname}";
352+
component-name = componentId.cname;
353+
component-type = componentId.ctype;
354+
};
352355
config = component;
353356
srcSubDir = cleanSrc.subDir;
354357
srcSubDirPath = cleanSrc.root + cleanSrc.subDir;
@@ -394,7 +397,7 @@ let
394397
# These only need to be propagated for library components (otherwise they
395398
# will be in `buildInputs`)
396399
++ lib.optionals (haskellLib.isLibrary componentId) configFiles.libDeps # libDeps is already deduplicated
397-
++ lib.optionals (stdenv.hostPlatform.isWindows)
400+
++ lib.optionals stdenv.hostPlatform.isWindows
398401
(haskellLib.uniqueWithName (lib.flatten component.libs)));
399402

400403
buildInputs = haskellLib.checkUnique "${ghc.targetPrefix}${fullName} buildInputs" (
@@ -415,7 +418,7 @@ let
415418

416419
prePatch =
417420
# emcc is very slow if it cannot cache stuff in $HOME
418-
(lib.optionalString (stdenv.hostPlatform.isGhcjs) ''
421+
(lib.optionalString stdenv.hostPlatform.isGhcjs ''
419422
export HOME=$(mktemp -d)
420423
'') +
421424
(lib.optionalString (!canCleanSource) ''

flake.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
flake-compat = { url = "github:input-output-hk/flake-compat/hkm/gitlab-fix"; flake = false; };
1414
flake-utils = { url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs"; };
1515
"hls-1.10" = { url = "github:haskell/haskell-language-server/1.10.0.0"; flake = false; };
16-
"hls-2.0" = { url = "github:haskell/haskell-language-server/2.0.0.0"; flake = false; };
16+
"hls-2.0" = { url = "github:haskell/haskell-language-server/2.0.0.1"; flake = false; };
1717
hydra.url = "hydra";
1818
hackage = {
1919
url = "github:input-output-hk/hackage.nix";
@@ -73,7 +73,7 @@
7373
traceNames = prefix: builtins.mapAttrs (n: v:
7474
if builtins.isAttrs v
7575
then if v ? type && v.type == "derivation"
76-
then __trace (prefix + n) v
76+
then builtins.trace (prefix + n) v
7777
else traceNames (prefix + n + ".") v
7878
else v);
7979

@@ -103,7 +103,7 @@
103103
# flake outputs so that we can incorporate the args passed
104104
# to the compat layer (e.g. sourcesOverride).
105105
overlays = [ allOverlays.combined ]
106-
++ (if checkMaterialization == true then
106+
++ (if checkMaterialization then
107107
[
108108
(final: prev: {
109109
haskell-nix = prev.haskell-nix // {
@@ -161,7 +161,7 @@
161161
# Exposed so that buildkite can check that `allow-import-from-derivation=false` works for core of haskell.nix
162162
roots = legacyPackagesUnstable.haskell-nix.roots compiler;
163163

164-
packages = ((self.internal.compat { inherit system; }).hix).apps;
164+
packages = (self.internal.compat { inherit system; }).hix.apps;
165165

166166
allJobs =
167167
let
@@ -180,15 +180,14 @@
180180
let nixpkgsJobs = allJobs.${nixpkgsVer};
181181
in lib.concatMap (compiler-nix-name:
182182
let ghcJobs = nixpkgsJobs.${compiler-nix-name};
183-
in (
184-
builtins.map (crossPlatform: {
183+
in builtins.map (crossPlatform: {
185184
name = "required-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}";
186185
value = legacyPackages.releaseTools.aggregate {
187186
name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${crossPlatform}";
188187
meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${crossPlatform} jobs";
189-
constituents = lib.collect (d: lib.isDerivation d) ghcJobs.${crossPlatform};
188+
constituents = lib.collect lib.isDerivation ghcJobs.${crossPlatform};
190189
};
191-
}) (names ghcJobs))
190+
}) (names ghcJobs)
192191
) (names nixpkgsJobs)
193192
) (names allJobs));
194193

hix/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let
9090
echo "Updating $FLAKE/flake.nix and deleting old $FLAKE/flake.lock"
9191
rm $FLAKE/flake.lock
9292
else
93-
echo "Updating $FLAKE/flake.nix"
93+
echo "Updating $FLAKE/flake.nix"
9494
fi
9595
cp $HIX_FLAKE $FLAKE/flake.nix
9696
chmod +w $FLAKE/flake.nix

hix/project/default.nix

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ let
3030
then []
3131
else [{ inherit name; value = commandArgs.${name}; }]
3232
) (builtins.attrNames commandArgs));
33-
defaultArgs = {
34-
nixpkgsPin = "nixpkgs-unstable";
35-
};
3633
importDefaults = src:
37-
if src == null || !(__pathExists src)
34+
if src == null || !(builtins.pathExists src)
3835
then {}
3936
else import src;
4037
userDefaults = importDefaults (commandArgs.userDefaults or null);
@@ -64,7 +61,7 @@ let
6461
commandArgs'
6562
({config, ...}: {
6663
src =
67-
if __pathExists (toString (src.origSrcSubDir or src) + "/.git")
64+
if builtins.pathExists (toString (src.origSrcSubDir or src) + "/.git")
6865
then config.evalPackages.haskell-nix.haskellLib.cleanGit {
6966
inherit src name;
7067
}
@@ -73,5 +70,5 @@ let
7370
];
7471
})
7572
];
76-
}).config) project shell;
73+
}).config) project;
7774
in project

lib/call-cabal-project-to-nix.nix

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }@defaults:
2-
let readIfExists = src: fileName:
3-
# Using origSrcSubDir bypasses any cleanSourceWith.
4-
# `lookForCabalProject` allows us to avoid looking in source from hackage
5-
# for cabal.project files. It is set in `modules/hackage-project.nix`.
6-
let origSrcDir = src.origSrcSubDir or src;
7-
in
8-
if (src.lookForCabalProject or true) && builtins.elem ((__readDir origSrcDir)."${fileName}" or "") ["regular" "symlink"]
9-
then __readFile (origSrcDir + "/${fileName}")
10-
else null;
11-
in
122
{ name ? src.name or null # optional name for better error messages
133
, src
144
, materialized-dir ? ../materialized
@@ -19,9 +9,9 @@ in
199
, materialized ? null # Location of a materialized copy of the nix files
2010
, checkMaterialization ? null # If true the nix files will be generated used to check plan-sha256 and material
2111
, cabalProjectFileName ? "cabal.project"
22-
, cabalProject ? readIfExists src cabalProjectFileName
23-
, cabalProjectLocal ? readIfExists src "${cabalProjectFileName}.local"
24-
, cabalProjectFreeze ? readIfExists src "${cabalProjectFileName}.freeze"
12+
, cabalProject ? null
13+
, cabalProjectLocal ? null
14+
, cabalProjectFreeze ? null
2515
, caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages
2616
, compilerSelection ? p: p.haskell-nix.compiler
2717
, ghc ? null # Deprecated in favour of `compiler-nix-name`

0 commit comments

Comments
 (0)