mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-08-15 09:50:27 +03:00
Spelling, typo and whitespace fixes (#833)
* Spelling and typo fixes in doc and code comments * Trailing whitespace or whitespace only truncation * readTheDocs formatting corrections
This commit is contained in:
parent
b35e9c7a35
commit
09526c8555
@ -246,7 +246,7 @@ let
|
||||
# Not sure why pkgconfig needs to be propagatedBuildInputs but
|
||||
# for gi-gtk-hs it seems to help.
|
||||
++ builtins.concatLists pkgconfig;
|
||||
|
||||
|
||||
buildInputs = component.libs
|
||||
++ map (d: d.components.library or d) component.depends;
|
||||
|
||||
@ -284,7 +284,7 @@ let
|
||||
# Note: Cabal does *not* copy test executables during the `install` phase.
|
||||
#
|
||||
# Note 2: if a package contains multiple libs (lib + sublibs) SETUP register will generate a
|
||||
# folder isntead of a file for the configuration. Therfore if the result is a folder,
|
||||
# folder instead of a file for the configuration. Therefore if the result is a folder,
|
||||
# we need to register each and every element of that folder.
|
||||
#
|
||||
# Note 3: if a package has no libs SETUP will not generate anything. This can
|
||||
@ -342,7 +342,7 @@ let
|
||||
''}
|
||||
fi
|
||||
'')
|
||||
# In case `setup copy` did not creat this
|
||||
# In case `setup copy` did not create this
|
||||
+ (lib.optionalString enableSeparateDataOutput "mkdir -p $data")
|
||||
+ (lib.optionalString (stdenv.hostPlatform.isWindows && (haskellLib.mayHaveExecutable componentId)) ''
|
||||
echo "Symlink libffi and gmp .dlls ..."
|
||||
|
@ -14,8 +14,8 @@ let
|
||||
ghc = (ghc.passthru.buildGHC or ghc);
|
||||
hsPkgs = hsPkgs.buildPackages;
|
||||
# We need to use the buildPackages stdenv to build the setup-builder.
|
||||
# in the native case, it would be the same in the corss case however
|
||||
# re *really* want to build the Setup.hs on the build machine and not
|
||||
# in the native case, it would be the same in the cross case however
|
||||
# we *really* want to build the Setup.hs on the build machine and not
|
||||
# have the stdenv confuse it with the target/host env.
|
||||
inherit (buildPackages) stdenv;
|
||||
inherit buildPackages pkgconfig;
|
||||
|
@ -74,7 +74,7 @@ let
|
||||
++ lib.optional doHaddock' "doc";
|
||||
|
||||
propagatedBuildInputs = builtins.concatLists pkgconfig;
|
||||
|
||||
|
||||
buildInputs = component.libs
|
||||
++ map (d: d.components.library.haddock or d) component.depends;
|
||||
|
||||
|
@ -10,18 +10,18 @@ let
|
||||
|
||||
target-pkg = "${ghc.targetPrefix}ghc-pkg";
|
||||
|
||||
# This is a bit of a hack. So we'll have a slightly longer explaination here:
|
||||
# This is a bit of a hack. So we'll have a slightly longer explanation here:
|
||||
|
||||
# Every library component built with `comp-builder.nix` includes an `exactDep`
|
||||
# and `envDep` directory with precomputed values used here.
|
||||
# GHC derivations include `exactDep` and `envDep` directories that have
|
||||
# the same information for each of the built in packages.
|
||||
|
||||
# exactDep will pass --exact-configuration to the `SETUP_HS confiugre` command.
|
||||
# exactDep will pass --exact-configuration to the `SETUP_HS configure` command.
|
||||
# This requires us to pass --dependency={dep name}={pkg id}. The dependency
|
||||
# name will usually be the name of the package `p`, which we can locate in the
|
||||
# package-db, passed in via `pdbArg`. Thus querying the package-db for the
|
||||
# id field for package `p`, will unsually provide is with the right value. Sublibs
|
||||
# id field for package `p`, will usually provide us with the right value. Sublibs
|
||||
# need a bit of special handling:
|
||||
#
|
||||
# - Sublibs: if the dependency is a sublibrary of a package, we need to use
|
||||
@ -136,15 +136,15 @@ in
|
||||
cat $ghc/exactDeps/$p/configure-flags >> $out/configure-flags
|
||||
cat $ghc/exactDeps/$p/cabal.config >> $out/cabal.config
|
||||
fi
|
||||
done
|
||||
done
|
||||
''
|
||||
# This code originates in the `generic-builder.nix` from nixpkgs. However GHC has been fixed
|
||||
# to drop unused libraries referneced from libraries; and this patch is usually included in the
|
||||
# nixpkgs's GHC builds. This doesn't sadly make this stupid hack unnecessary. It resurfes in
|
||||
# to drop unused libraries referenced from libraries; and this patch is usually included in the
|
||||
# nixpkgs's GHC builds. This doesn't sadly make this stupid hack unnecessary. It resurfaces in
|
||||
# the form of Cabal trying to be smart. Cabal when linking a library figures out that you likely
|
||||
# need those `rpath` entries, and passes `-optl-Wl,-rpath,...` for each dynamic library path to
|
||||
# GHC, thus subverting the linker and forcing it to insert all those RPATHs weather or not they
|
||||
# are needed. We therfore reuse the linker hack here to move all al dynamic lirbaries into a
|
||||
# are needed. We therefore reuse the linker hack here to move all dynamic libraries into a
|
||||
# common folder (as links) and thus prevent Cabal from going nuts.
|
||||
#
|
||||
# TODO: Fix Cabal.
|
||||
|
@ -4,7 +4,7 @@ that will impact users.
|
||||
## July 21, 2020
|
||||
* Removed `components.all`, use `symlinkJoin` on components.exes or
|
||||
`shellFor` if you need a shell.
|
||||
* Added `components` arguemnt to `shellFor`.
|
||||
* Added `components` argument to `shellFor`.
|
||||
|
||||
## July 21, 2020
|
||||
* Added GHC 8.8.4 and replaced 8.8.3 in tests and as the ghc
|
||||
@ -31,7 +31,7 @@ that will impact users.
|
||||
`p.tool "alex" "3.2.5"` or `shellFor { tools = { alex = "3.2.5"; } }`.
|
||||
* `haskell-nix.nix-tools` -> `haskell-nix.nix-tools.ghc883` (it includes
|
||||
the hpack exe now).
|
||||
* `haskell-nix.cabal-install` ->
|
||||
* `haskell-nix.cabal-install` ->
|
||||
`p.tool "cabal" "3.2.0.0"` or `shellFor { tools = { cabal = "3.2.0.0"; } }`
|
||||
* `haskell-nix.haskellNixRoots` -> `haskell-nix.roots ghc883` or `p.roots`
|
||||
|
||||
|
4
ci.nix
4
ci.nix
@ -1,5 +1,5 @@
|
||||
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluting
|
||||
# on a machine with e.g. no way to build the Darwin IFDs you need!
|
||||
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
|
||||
# on a machine with e.g. no way to build the Darwin IFDs you need!
|
||||
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
|
||||
, ifdLevel ? 3
|
||||
# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules.
|
||||
|
@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
|
||||
patches = ghc-patches;
|
||||
name = "${targetPrefix}ghc-${ghc-version}-configured-src";
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
# Make sure we never relax`$PATH` and hooks support for compatibility.
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -111,4 +111,4 @@ stdenv.mkDerivation (rec {
|
||||
++ stdenv.lib.optional (ghc-patches != []) "autoreconfPhase"
|
||||
++ [ "configurePhase" "installPhase" ];
|
||||
installPhase = "cp -r . $out";
|
||||
})
|
||||
})
|
||||
|
@ -19,7 +19,7 @@
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
, # LLVM is conceptually a run-time-only dependency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
buildLlvmPackages, llvmPackages
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
, enableLibraryProfiling ? true
|
||||
|
||||
, # Whetherto build terminfo. Musl fails to build terminfo as ncurses seems to be linked to glibc
|
||||
, # Whether to build terminfo. Musl fails to build terminfo as ncurses seems to be linked to glibc
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.isMusl
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
@ -68,7 +68,7 @@ let
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO check if this posible fix for segfaults works or not.
|
||||
# TODO check if this possible fix for segfaults works or not.
|
||||
targetLibffi =
|
||||
# on native platforms targetPlatform.{libffi, gmp} do not exist; thus fall back
|
||||
# to the non-targetPlatform version in those cases.
|
||||
@ -174,8 +174,8 @@ stdenv.mkDerivation (rec {
|
||||
"distPhase"
|
||||
];
|
||||
|
||||
# ghc hardcodes the TOP dir durcing config, this breaks when
|
||||
# splitting the configured src from the the build process.
|
||||
# ghc hardcodes the TOP dir during config, this breaks when
|
||||
# splitting the configured src from the build process.
|
||||
postUnpack = ''
|
||||
(cd $sourceRoot
|
||||
TOP=$(cat mk/config.mk|grep ^TOP|awk -F\ '{ print $3 }')
|
||||
@ -202,7 +202,7 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
outputs = [ "out" "doc" "generated" ];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
# Make sure we never relax`$PATH` and hooks support for compatibility.
|
||||
strictDeps = true;
|
||||
|
||||
# Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
|
||||
@ -311,7 +311,7 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
configured-src = configured-src;
|
||||
|
||||
# Used to detect non haskell-nix compilers (accedental use of nixpkgs compilers can lead to unexpected errors)
|
||||
# Used to detect non haskell-nix compilers (accidental use of nixpkgs compilers can lead to unexpected errors)
|
||||
isHaskellNixCompiler = true;
|
||||
} // extra-passthru;
|
||||
|
||||
@ -326,4 +326,4 @@ stdenv.mkDerivation (rec {
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
noAuditTmpdir = true;
|
||||
})
|
||||
})
|
||||
|
@ -40,7 +40,7 @@ let
|
||||
passthru = {
|
||||
inherit all-ghcjs;
|
||||
inherit (project) configured-src;
|
||||
# Used to detect non haskell-nix compilers (accedental use of nixpkgs compilers can lead to unexpected errors)
|
||||
# Used to detect non haskell-nix compilers (accidental use of nixpkgs compilers can lead to unexpected errors)
|
||||
isHaskellNixCompiler = true;
|
||||
} // ghcjs.components.exes;
|
||||
dontConfigure = true;
|
||||
@ -65,4 +65,4 @@ let
|
||||
# https://github.com/ghcjs/ghcjs/issues/654
|
||||
# enableParallelBuilding = true;
|
||||
};
|
||||
in booted-ghcjs
|
||||
in booted-ghcjs
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
## Update `overlays/bootstrap.nix`
|
||||
|
||||
Each ghc version is defined in this file. Duplicate one of the exising
|
||||
Each ghc version is defined in this file. Duplicate one of the existing
|
||||
ghc version definitions and replace the version numbers. Make sure
|
||||
you update the `spec.sha256` or the other versions source will be used.
|
||||
Check the LLVM version that should be used in the
|
||||
@ -27,7 +27,7 @@ The `nix-build` command will fail with something like:
|
||||
Materialized nix used for dummy-data-x86_64-unknown-linux-musl-ghc-8.10.1 incorrect. To fix run: /nix/store/wnwpyrhv4nxgyljz3f20gdpspjxvm7h4-updateMaterialized
|
||||
```
|
||||
|
||||
Run the `updateMaterialized` script and repat the `nix-build` until it no longer fails.
|
||||
Run the `updateMaterialized` script and repeat the `nix-build` until it no longer fails.
|
||||
If the failure is not a problem with materialization and no `updateMaterialized` script
|
||||
is provided then you may need to fix the failure another way or (if it only relates to
|
||||
one of the cross compilers) modify `scripts/check-compiler-materialization/default.nix`
|
||||
|
@ -61,7 +61,7 @@ of packages available on hackage.
|
||||
[stackage.nix][] is similar to hackage.nix but provides all stackage
|
||||
snapshots (lts, and nightly) as nix expressions. It naturally depends
|
||||
on hackage.nix to resolve package names, versions and revisions to the
|
||||
repsective packages from hackage.nix.
|
||||
respective packages from hackage.nix.
|
||||
|
||||
[haskell.nix]: https://github.com/input-output-hk/haskell.nix
|
||||
[hackage.nix]: https://github.com/input-output-hk/hackage.nix
|
||||
|
@ -77,7 +77,7 @@ nixpkgs (*This has undergone substantially less testing*).
|
||||
|
||||
### Component builder
|
||||
|
||||
To prevent depending on mutliple instances of the same libraries, the
|
||||
To prevent depending on multiple instances of the same libraries, the
|
||||
component builder will try to build every package from scratch and
|
||||
rely as little as possible on packages that are shipped with the GHC
|
||||
distribution. The exceptions are packages that are known to not be
|
||||
|
@ -24,3 +24,5 @@ git clone https://github.com/input-output-hk/haskell.nix
|
||||
cd haskell.nix
|
||||
nix build -f . pkgs.haskell-nix.nix-tools.ghc884 --arg sourcesOverride '{ nix-tools = ../nix-tools; }' --out-link nt
|
||||
```
|
||||
|
||||
[haskell.nix]: https://github.com/input-output-hk/haskell.nix
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Manually generating Nix expressions
|
||||
|
||||
We believe that imports from derivations (IFDs) provide tremendous
|
||||
value in nix and the aversion towards them stems mostly from
|
||||
value in nix and the aversion towards them stems mostly from
|
||||
poor tooling and ci support for them. We do not believe
|
||||
that poor tooling or ci support should cripple nix capability
|
||||
of abstraction. Hence haskell.nix makes excessive use of
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Motivation
|
||||
|
||||
Why do we need another Haskell infrastructure for Nix?
|
||||
Why do we need another Haskell infrastructure for Nix?
|
||||
|
||||
Doesn't nixpkgs
|
||||
provide a sufficiently good Haskell infrastructure already?
|
||||
provide a sufficiently good Haskell infrastructure already?
|
||||
|
||||
Problems with
|
||||
the nixpkgs haskell infrastructure are covered in the following sections:
|
||||
|
@ -29,7 +29,7 @@ Make sure you are using the same compiler for the cabal build as for the `haskel
|
||||
|
||||
(Cabal users only. For stack users, package versions come from the snapshot, so stack and `haskell.nix` will agree.)
|
||||
|
||||
Cabal has the concept of the Hackage "index state".
|
||||
Cabal has the concept of the Hackage "index state".
|
||||
This is a timestamp, and it tells Cabal to behave "as if" it was seeing Hackage at that point in time.
|
||||
Pinning it is generally good for reproducibility regardless of whether you use `haskell.nix` (you can do so in `cabal.project`).
|
||||
|
||||
@ -67,6 +67,6 @@ So this is expected, unfortunately.
|
||||
### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?
|
||||
|
||||
The `haskell-nix.roots "ghc884"` should include all the evaluation-time dependencies
|
||||
and the main build time dependecies of a project using ghc 8.8.3.
|
||||
and the main build time dependencies of a project using ghc 8.8.4.
|
||||
So you can add that to the relevant GC root.
|
||||
In practice, if you're using a CI system like Hydra/Hercules, this means adding it to a job in `release.nix`/`ci.nix`.
|
||||
|
@ -20,7 +20,7 @@ you could run:
|
||||
nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz")).nixpkgsArgs; (haskell-nix.hackage-package { name = "lens"; version = "4.17.1"; })).components.library'
|
||||
```
|
||||
This would build the (public) library component of the [lens-4.17.1][] package
|
||||
from hackage.
|
||||
from hackage.
|
||||
|
||||
### Pinning hackage index
|
||||
|
||||
@ -32,7 +32,7 @@ nix build '(with import <nixpkgs> (import (builtins.fetchTarball "https://github
|
||||
```
|
||||
This would use the hackage index as of `2019-07-14T00:00:00Z` to produce a
|
||||
build plan for the [lens-4.17.1][] package.
|
||||
|
||||
|
||||
[Stackage]: https://stackage.org
|
||||
[Hackage]: https://hackage.haskell.org
|
||||
[hackage.nix]: https://github.com/input-output-hk/hackage.nix
|
||||
|
@ -29,7 +29,7 @@ in a change to the `.cabal` file the test will still be built the same).
|
||||
```
|
||||
components.tests.test.extraSrcFiles = [ "subdir-needed-by-test" ];
|
||||
```
|
||||
Or alternatively, override the source with a suitable filter function.
|
||||
Or alternatively, override the source with a suitable filter function.
|
||||
```
|
||||
components.tests.test.src = haskell-nix.haskellLib.cleanSourceWith {
|
||||
inherit src;
|
||||
@ -64,7 +64,7 @@ sub directories containing git repos.
|
||||
|
||||
For example if `repoA` and `repoB` are two git repos with
|
||||
cabal packages and want to use the `repoB` package when building
|
||||
`repoA. First we can add `../repoB` to `repoA/cabal.project`:
|
||||
`repoA`. First we can add `../repoB` to `repoA/cabal.project`:
|
||||
|
||||
```
|
||||
packages:
|
||||
|
@ -146,7 +146,7 @@ get a shell with some packages.
|
||||
Once you have a development shell, then you can begin configuring
|
||||
Emacs to use it. The way I do it is:
|
||||
|
||||
1. Run [lorri watch](https://github.com/target/lorri) to continously
|
||||
1. Run [lorri watch](https://github.com/target/lorri) to continuously
|
||||
build the shell environment and maintain GC roots.
|
||||
|
||||
2. Use [emacs‑direnv](https://github.com/wbolster/emacs-direnv) to
|
||||
@ -168,7 +168,7 @@ Emacs to use it. The way I do it is:
|
||||
## Using `nix repl`
|
||||
|
||||
It's sometimes useful to load [Haskell.nix][] in the REPL to explore
|
||||
attrsets and try examples.
|
||||
attrsets and try examples.
|
||||
|
||||
```
|
||||
# example.nix
|
||||
@ -194,8 +194,10 @@ Added 2 variables.
|
||||
nix-repl> lib.take 5 pkgNames
|
||||
[ "ALUT" "ANum" "Allure" "Boolean" "BoundedChan" ]
|
||||
|
||||
nix-repl>
|
||||
nix-repl>
|
||||
```
|
||||
|
||||
Now that you have `nix-tools` and are able to import [Haskell.nix][],
|
||||
you can continue to the next chapter.
|
||||
|
||||
[haskell.nix]: https://github.com/input-output-hk/haskell.nix
|
||||
|
@ -6,14 +6,14 @@ If your project depends on a Hackage package, then the `hackage.nix` revision us
|
||||
|
||||
## Updating and pinning `hackage.nix` and `stackage.nix`
|
||||
|
||||
`haskell.nix` pins particular revisions of these repositories internally, both for our own usage in testing, and so that users have a sensible default when getting started.
|
||||
`haskell.nix` pins particular revisions of these repositories internally, both for our own usage in testing, and so that users have a sensible default when getting started.
|
||||
These revisions are updated nightly, so you can get newer revisions of `hackage.nix` and `stackage.nix` by updating your revision of `haskell.nix` itself.
|
||||
|
||||
However, this exposes you to changes in `haskell.nix` which you may not want, such as changes that force compiler rebuilds, or the occasional bug.
|
||||
Instead, you can pin `hackage.nix` and `stackage.nix` independently. For example:
|
||||
|
||||
```nix
|
||||
let
|
||||
let
|
||||
# You can use a tool like `niv` to manage this boilerplate
|
||||
hackageSrc = builtins.fetchTarball https://github.com/input-output-hk/hackage.nix/archive/master.tar.gz;
|
||||
stackageSrc = builtins.fetchTarball https://github.com/input-output-hk/stackage.nix/archive/master.tar.gz;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Capturing and storing the nix files for a project so that they do
|
||||
not need to be built (or checked). This allows us to cache the input
|
||||
of an IFD (import from derviation).
|
||||
of an IFD (import from derivation).
|
||||
|
||||
## Why use materialization?
|
||||
|
||||
@ -32,7 +32,7 @@ dependencies of nix-tools for instance).
|
||||
nix files automatically.
|
||||
* You are certain that the IFD you materialize is not `system`-dependent. If it was you'd
|
||||
obtain different nix expressions depending on which `system` the IFD was evaluated.
|
||||
|
||||
|
||||
## How can we materialize the nix files?
|
||||
|
||||
Lets say we want to build `hlint`. We might start with an `hlint`
|
||||
@ -150,7 +150,7 @@ store will be read only.
|
||||
## How can we check `sha256` and `materialized` are up to date?
|
||||
|
||||
Let's pretend we had to go back to `hlint` version `2.2.10`.
|
||||
We can tell haskell.nix to check the materialiazation either by:
|
||||
We can tell haskell.nix to check the materialization either by:
|
||||
|
||||
* Removing the materialization files with `rm -rf hlint.materialized`
|
||||
* Temporarily adding `checkMaterialization = true;`
|
||||
@ -231,13 +231,13 @@ Yes and it gives us the same speed improvement, however:
|
||||
* It does not help at all in `restricted-eval` mode (Hydra).
|
||||
|
||||
* Users will still wind up building or downloading the dependencies
|
||||
needed to build the nix fileds (if they do not have them).
|
||||
needed to build the nix files (if they do not have them).
|
||||
|
||||
For those reasons it might be best to make a copy instead
|
||||
of using the `/nix/store/...` path directly.
|
||||
|
||||
If you really want to use the `/nix/store/...` path directly
|
||||
you should gaurd against the path not existing as passing in
|
||||
you should guard against the path not existing as passing in
|
||||
a non-existing path is now an error:
|
||||
|
||||
```nix
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
Cabal files may contain dependencies to external non-Haskell
|
||||
dependencies via:
|
||||
* [`build-tool-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-build-tool-depends)
|
||||
* [`pkgconfig-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-pkgconfig-depends).
|
||||
|
||||
* [`build-tool-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-build-tool-depends)
|
||||
* [`pkgconfig-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-pkgconfig-depends)
|
||||
* [`frameworks`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-frameworks)
|
||||
* [`extra-libraries`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-extra-libraries)
|
||||
|
||||
|
@ -5,7 +5,7 @@ to git repositories containing the version of a particular package
|
||||
that we wish to use. This is mostly handled automatically by
|
||||
`nix-tools` and `haskell.nix` however when we want to use a nix
|
||||
system that is configured to use restricted mode (typically hydra)
|
||||
it will need an aditionaly hash.
|
||||
it will need additional hashes for the referenced repositories.
|
||||
|
||||
When using `project`, `cabalProject` or `stackProject` functions
|
||||
you can include the hash needed in a comment.
|
||||
|
@ -65,7 +65,7 @@ let
|
||||
nextState (builtins.head pair) (builtins.elemAt pair 1)
|
||||
else
|
||||
if name != null
|
||||
then nextState name s # Append another line to the current attirbute
|
||||
then nextState name s # Append another line to the current attribute
|
||||
else __trace "Expected attribute but found `${s}`" { inherit name attrs; }
|
||||
) { name = null; attrs = {}; } (stripComments (unindent blockLines))).attrs;
|
||||
|
||||
|
@ -18,7 +18,7 @@ in
|
||||
, cabalProject ? readIfExists src cabalProjectFileName
|
||||
, cabalProjectLocal ? readIfExists src "${cabalProjectFileName}.local"
|
||||
, cabalProjectFreeze ? readIfExists src "${cabalProjectFileName}.freeze"
|
||||
, caller ? "callCabalProjectToNix" # Name of the calling funcion for better warning messages
|
||||
, caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages
|
||||
, ghc ? null # Deprecated in favour of `compiler-nix-name`
|
||||
, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
|
||||
, nix-tools ? evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name} # When building cabal projects we use the nix-tools
|
||||
@ -26,7 +26,7 @@ in
|
||||
, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
|
||||
# `--enable-tests --enable-benchmarks` are included by default.
|
||||
# If the tests and benchmarks are not needed and they
|
||||
# causes the wrong plan to be choosen, then we can use
|
||||
# cause the wrong plan to be chosen, then we can use
|
||||
# `configureArgs = "--disable-tests --disable-benchmarks";`
|
||||
, sha256map ? null
|
||||
# An alternative to adding `--sha256` comments into the
|
||||
@ -153,7 +153,7 @@ let
|
||||
# Deal with source-repository-packages in a way that will work in
|
||||
# restricted-eval mode (as long as a sha256 is included).
|
||||
# Replace source-repository-package blocks that have a sha256 with
|
||||
# packages: block containing nix sotre paths of the fetched repos.
|
||||
# packages: block containing nix store paths of the fetched repos.
|
||||
replaceSoureRepos = projectFile:
|
||||
let
|
||||
blocks = pkgs.lib.splitString "\nsource-repository-package\n" ("\n" + projectFile);
|
||||
@ -194,7 +194,7 @@ let
|
||||
}
|
||||
else replaceSoureRepos rawCabalProject;
|
||||
|
||||
# The use of a the actual GHC can cause significant problems:
|
||||
# The use of the actual GHC can cause significant problems:
|
||||
# * For hydra to assemble a list of jobs from `components.tests` it must
|
||||
# first have GHC that will be used. If a patch has been applied to the
|
||||
# GHC to be used it must be rebuilt before the list of jobs can be assembled.
|
||||
@ -377,7 +377,7 @@ let
|
||||
# This creates `.cabal` directory that is as it would have
|
||||
# been at the time `cached-index-state`. We may include
|
||||
# some packages that will be excluded by `index-state-found`
|
||||
# which is used by cabal (cached-index-state >= index-state-found).
|
||||
# which is used by cabal (cached-index-state >= index-state-found).
|
||||
dotCabal {
|
||||
inherit cabal-install nix-tools extra-hackage-tarballs;
|
||||
index-state = cached-index-state;
|
||||
|
@ -6,7 +6,7 @@ let
|
||||
# Transform
|
||||
# "." -> ""
|
||||
# "./." -> ""
|
||||
# "./xyz" -> "xyz"
|
||||
# "./xyz" -> "xyz"
|
||||
normalizeRelativePath = rel:
|
||||
if rel == "." || rel == "./."
|
||||
then ""
|
||||
@ -86,4 +86,4 @@ in
|
||||
|| traceReason "extra source file" (extraSrcMatch rPath)
|
||||
|| traceReason "extra doc file" (extraDocMatch rPath)
|
||||
|| traceReason "other source file" (lib.any (f: f == rPath) otherSourceFiles);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This is a source filter function which cleans common build products
|
||||
# and files not needed to do a haskell build from a source directory.
|
||||
#
|
||||
# This can avoid unecessary builds when these files change.
|
||||
# This can avoid unnecessary builds when these files change.
|
||||
#
|
||||
# It should be used with "pkgs.lib.cleanSourceWith". Alternatively,
|
||||
# use the convenience function "cleanSourceHaskell".
|
||||
|
@ -40,7 +40,7 @@
|
||||
# relative references to those siblings will work.
|
||||
#
|
||||
# name: Optional name to use as part of the store path.
|
||||
# If you do not provide a `name` it wil be derived
|
||||
# If you do not provide a `name` it will be derived
|
||||
# from the `subDir`. You should provide `name` or
|
||||
# `subDir`. If you do not a warning will be displayed
|
||||
# and the name used will be `source`.
|
||||
@ -80,7 +80,7 @@
|
||||
else
|
||||
if subDirName != ""
|
||||
then if src ? name
|
||||
then src.name + "-" + subDirName
|
||||
then src.name + "-" + subDirName
|
||||
else "source-" + subDirName
|
||||
else if src ? name
|
||||
then src.name
|
||||
@ -120,4 +120,4 @@
|
||||
src ? _isLibCleanSourceWithEx
|
||||
|| src ? _isLibCleanSourceWith
|
||||
|| !(pathHasContext (toString src));
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ in {
|
||||
&& stdenv.hostPlatform == stdenv.targetPlatform;
|
||||
|
||||
# Takes a version number or attr set of arguments (for cabalProject)
|
||||
# and conversios it to an attr set of argments. This allows
|
||||
# and converts it to an attr set of arguments. This allows
|
||||
# the use of "1.0.0.0" or { version = "1.0.0.0"; ... }
|
||||
versionOrArgsToArgs = versionOrArgs:
|
||||
if lib.isAttrs versionOrArgs
|
||||
|
@ -21,7 +21,7 @@ let
|
||||
in
|
||||
pkgs.lib.lists.head (rs ++ [ null ]);
|
||||
|
||||
# If we found a resolver andwe have a resolverSha256 then we should download it.
|
||||
# If we found a resolver and we have a resolverSha256 then we should download it.
|
||||
fetchedResolver =
|
||||
if resolver != null && resolverSha256 != null
|
||||
then pkgs.fetchurl {
|
||||
|
@ -4,7 +4,7 @@
|
||||
{ pkgs, haskellLib }:
|
||||
{ projectNix, sourceRepos, src }:
|
||||
let
|
||||
# Full source including possible relartive paths form the
|
||||
# Full source including possible relative paths form the
|
||||
# project directory.
|
||||
srcRoot =
|
||||
if haskellLib.canCleanSource src
|
||||
|
@ -26,7 +26,7 @@ let
|
||||
inherit src stackYaml resolverSha256;
|
||||
}) resolver fetchedResolver;
|
||||
|
||||
# Filter just the stack yaml file and any reolver yaml file it points to.
|
||||
# Filter just the stack yaml file and any resolver yaml file it points to.
|
||||
maybeCleanedSource =
|
||||
if haskellLib.canCleanSource src
|
||||
then haskellLib.cleanSourceWith {
|
||||
@ -39,7 +39,7 @@ let
|
||||
|
||||
# All repos served via ssh or git protocols are usually private
|
||||
private = url: pkgs.lib.substring 0 4 url != "http";
|
||||
|
||||
|
||||
repos = builtins.fromJSON (builtins.readFile (pkgs.runCommand "stack-repos" {
|
||||
buildInputs = [ nix-tools ];
|
||||
} ''
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Maps of system pkg refenreces from
|
||||
# Maps of system pkg references from
|
||||
# cabal file to nixpkgs pkgs.
|
||||
# See ../docs/dev/pkg-map.md
|
||||
pkgs:
|
||||
@ -94,5 +94,5 @@ pkgs:
|
||||
Crypt32 = null;
|
||||
}
|
||||
# -- os x
|
||||
# NB: these map almost 1:1 to the famework names
|
||||
# NB: these map almost 1:1 to the framework names
|
||||
// pkgs.darwin.apple_sdk.frameworks
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Create a local hackare repo, we can use as a repository in a cabal config
|
||||
# Create a local hackage repo, we can use as a repository in a cabal config
|
||||
#
|
||||
# This will include:
|
||||
# - 01-index.tar.gz (the index file)
|
||||
@ -12,7 +12,7 @@
|
||||
#
|
||||
# We will create a completely unsigned bare repository. Using signing keys within
|
||||
# nix would be pointless as we'd have to hardcode them to produce the same output
|
||||
# reproducably.
|
||||
# reproducibly.
|
||||
#
|
||||
pkgs:
|
||||
{ name, index }:
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
let
|
||||
# it also crucially depends on system, and compiler, both of which need to be resolved to the
|
||||
# current system being targetted.
|
||||
# current system being targeted.
|
||||
hostMap = import ../lib/host-map.nix pkgs.stdenv;
|
||||
cabal = import ../lib/cabal-os-arch-comp.nix;
|
||||
|
||||
|
@ -9,9 +9,9 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
# this has a slightly modified option type. we will *overwrite* any previous
|
||||
# This has a slightly modified option type. We will *overwrite* any previous
|
||||
# setting of nonRelocatablePkgs, instead of merging them. Otherwise you
|
||||
# have no chance of removing packages retroacively. We might improvie this
|
||||
# have no chance of removing packages retroactively. We might improve this
|
||||
# by implementing a logic that would allow +xxx to be added, -xxx to be removed
|
||||
# and if it's not a list of -/+ prefixed strings, be assumed to be overwriting.
|
||||
# This seems ugly.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# This file is for configuration that should be required by every
|
||||
# package set. Hopefully we can keep configuration for particular
|
||||
# pacakge sets out of this repo. Ideally, this file is only used for
|
||||
# package sets out of this repo. Ideally, this file is only used for
|
||||
# fixing things that are broken due to the Nix infrastructure.
|
||||
|
||||
{ pkgs, ... }: {
|
||||
|
@ -67,7 +67,7 @@ in {
|
||||
# in the nixpkgs setup, and properly override the
|
||||
# complier as needed.
|
||||
default = pkgs.buildPackages.haskell-nix.compiler.${config.compiler.nix-name} or (throw ''
|
||||
This version of Nixpkgs does not contain GHC ${config.compiler.version}
|
||||
This version of Nixpkgs does not contain GHC ${config.compiler.version}
|
||||
(or it is not present at attribute '${config.compiler.nix-name})').
|
||||
Either switch to a version of Nixpkgs which does have this version, or use a version
|
||||
of GHC which the current version of Nixpkgs contains.
|
||||
|
@ -226,7 +226,7 @@ in {
|
||||
doExactConfig = false;
|
||||
# We have to set hsSourceDirs or cleanCabalComponent will
|
||||
# include everything (and as a result all the components of
|
||||
# the package will depend on eveything in the package).
|
||||
# the package will depend on everything in the package).
|
||||
# TODO find a better way
|
||||
hsSourceDirs = ["setup-src"];
|
||||
includeDirs = [];
|
||||
|
@ -1,5 +1,5 @@
|
||||
# The plan (that is, a package set description like an LTS set or a
|
||||
# plan.nix (derived from plan.json)) will producde a structure that
|
||||
# plan.nix (derived from plan.json)) will produce a structure that
|
||||
# looks like, which is stored in config.plan.pkg-def:
|
||||
#
|
||||
# { packages = { "package" = { revision = hackageConfigs.$package.$version.revisions.default;
|
||||
@ -16,9 +16,9 @@ with lib;
|
||||
with types;
|
||||
|
||||
let
|
||||
# dealing with str is a bit annoying espectially with `nullOr str` as that apparently defaults to ""
|
||||
# dealing with str is a bit annoying especially with `nullOr str` as that apparently defaults to ""
|
||||
# instead of null :shrug:. This then messes with our option inheritance logic.
|
||||
# Hence we have a uniqueStr type that ensures multiple identially defined options are collapsed
|
||||
# Hence we have a uniqueStr type that ensures multiple identically defined options are collapsed
|
||||
# without raising an error. And a way to fetch default options that will retain `null` if the
|
||||
# option is not defined or "".
|
||||
getDefaultOrNull = def: key: if def ? ${key} && def.${key} != "" then def.${key} else null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Update script to update nix-tools.
|
||||
#
|
||||
# This scipt might still come in handy, but it should now be possible to update
|
||||
# This script might still come in handy, but it should now be possible to update
|
||||
# the nix-tools materialization without it.
|
||||
#
|
||||
# Without this script:
|
||||
@ -8,7 +8,7 @@
|
||||
# 2. run `nix-build -E '(import ./. { checkMaterialization = true; }).pkgs.haskell-nix.nix-tools'`
|
||||
# 3. If it fails apply the fixes from the log (there should be rm, cp and chmod commands)
|
||||
#
|
||||
# To bootstap materialization files for a new compiler (e.g. for ghc 8.8.3)
|
||||
# To bootstrap materialization files for a new compiler (e.g. for ghc 8.8.3)
|
||||
#
|
||||
# nix-build -E 'let h = (import ./. {}).pkgs.haskell-nix; in h.cabal-install-tool { compiler-nix-name = "ghc884"; checkMaterialization = true; inherit (h) cabal-install nix-tools; }'
|
||||
# nix-build -E 'let h = (import ./. {}).pkgs.haskell-nix; in h.nix-tools-set { compiler-nix-name = "ghc884"; checkMaterialization = true; inherit (h) cabal-install nix-tools; }'
|
||||
|
@ -28,14 +28,14 @@ final: prev:
|
||||
];
|
||||
} // {
|
||||
# we can perform testing of cross compiled test-suites by using wine.
|
||||
# Therfore let's enable doCrossCheck here!
|
||||
# Therefore let's enable doCrossCheck here!
|
||||
doCrossCheck = pkgs.stdenv.hostPlatform.isWindows;
|
||||
};
|
||||
in {
|
||||
packages = {
|
||||
# clock 0.7.2 needs to be patche to support cross compilation.
|
||||
# clock 0.7.2 needs to be patched to support cross compilation.
|
||||
clock.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isAarch32 [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
|
||||
# nix calles this package crypto
|
||||
# nix calls this package crypto
|
||||
# cryptonite-openssl.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
|
||||
|
||||
# http-client.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
|
||||
@ -70,4 +70,4 @@ final: prev:
|
||||
)
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ in {
|
||||
ghc-patches = version: let
|
||||
# Returns true iff this derivation's version is strictly older than ver.
|
||||
versionLessThan = ver: builtins.compareVersions ver version == 1;
|
||||
# Returns true iff this derivation's verion is greater than or equal to ver.
|
||||
# Returns true iff this derivation's version is greater than or equal to ver.
|
||||
versionAtLeast = ver: !versionLessThan ver;
|
||||
from = start: final.lib.optional (versionAtLeast start);
|
||||
fromUntil = start: end: final.lib.optional (versionAtLeast start && versionLessThan end);
|
||||
@ -494,7 +494,7 @@ in {
|
||||
# haskell-nix.cabal-install-unchecked.ghcXXX
|
||||
# haskell-nix.nix-tools.ghcXXX
|
||||
# haskell-nix.nix-tools-unchecked.ghcXXX
|
||||
# Using these avoids unecessary calls to mkDerivation.
|
||||
# Using these avoids unnecessary calls to mkDerivation.
|
||||
# For cabal projects we match the versions used to the compiler
|
||||
# selected for the project to avoid the chance of a dependency
|
||||
# another GHC version (particularly useful on macOS where
|
||||
@ -541,7 +541,7 @@ in {
|
||||
# WARN: The `import ../. {}` will prevent
|
||||
# any cross to work, as we will loose
|
||||
# the `config` value.
|
||||
# As such the folloing sadly won't work :(
|
||||
# As such the following sadly won't work :(
|
||||
# haskellPackages = with import ../. {}; {
|
||||
# hpack = null;
|
||||
# hello = (hackage-package {
|
||||
@ -601,7 +601,7 @@ in {
|
||||
# can turn off materialization checks when
|
||||
# building ghc itself (since GHC is a dependency
|
||||
# of the materialization check it would cause
|
||||
# infinite recusion).
|
||||
# infinite recursion).
|
||||
alex-tool = args: tool buildBootstrapper.compilerNixName "alex" ({
|
||||
version = "3.2.4";
|
||||
inherit ghcOverride nix-tools cabal-install index-state;
|
||||
|
@ -29,7 +29,7 @@ let
|
||||
|
||||
ordered = with overlays; [
|
||||
# Hide nixpkgs haskell and haskellPackages from the haskell-nix overlays.
|
||||
# This should prevent us inadvertantly depending on them.
|
||||
# This should prevent us inadvertently depending on them.
|
||||
(_: prev: {
|
||||
haskell = { };
|
||||
haskellPackages = { };
|
||||
|
@ -56,7 +56,7 @@ stdenv.mkDerivation {
|
||||
cp $out/${appdir}/config $HOME/.emscripten
|
||||
export PATH=$PATH:$out/bin
|
||||
|
||||
#export EMCC_DEBUG=2
|
||||
#export EMCC_DEBUG=2
|
||||
${python}/bin/python $src/tests/runner.py test_hello_world
|
||||
echo "--------------- /running test -----------------"
|
||||
'';
|
||||
|
@ -17,13 +17,13 @@ in { haskell-nix = prev.haskell-nix // {
|
||||
packages: .
|
||||
allow-newer: cabal-install:base
|
||||
'';
|
||||
modules = [
|
||||
modules = [
|
||||
{ reinstallableLibGhc = true; }
|
||||
# Version of of cabal-install in hacakge is borken for GHC 8.10.1
|
||||
# Version of of cabal-install in hackage is broken for GHC 8.10.1
|
||||
(lib.optionalAttrs (version == "3.2.0.0") {
|
||||
packages.cabal-install.src = final.haskell-nix.sources.cabal-32 + "/cabal-install";
|
||||
})
|
||||
];
|
||||
];
|
||||
};
|
||||
|
||||
hpack = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
, ... }:
|
||||
# The haskell.nix infrastructure
|
||||
#
|
||||
# for hygenic reasons we'll use haskell-nix as a prefix.
|
||||
# for hygienic reasons we'll use haskell-nix as a prefix.
|
||||
# Using haskell.nix in nix is awkward as I needs to be quoted.
|
||||
final: prev: {
|
||||
haskell-nix = with final.haskell-nix; {
|
||||
@ -234,7 +234,7 @@ final: prev: {
|
||||
'';
|
||||
|
||||
# Some of features of haskell.nix rely on using a hackage index
|
||||
# to calculate a build plan. To maintain stabity for caching and
|
||||
# to calculate a build plan. To maintain stability for caching and
|
||||
# to allow the outputs to be materialized we pin this value here.
|
||||
# If you want to update this value it important to check the
|
||||
# materializations. Turn `checkMaterialization` on below and
|
||||
@ -348,7 +348,7 @@ final: prev: {
|
||||
# stack-to-nix or plan-to-nix to prevent them
|
||||
# from needing network access.
|
||||
# The cache contains only local paths to nix files so that it can
|
||||
# the results of `stack-to-nix` can be imported in restrected eval
|
||||
# the results of `stack-to-nix` can be imported in restricted eval
|
||||
# mode.
|
||||
mkCacheFile = repos:
|
||||
final.buildPackages.pkgs.runCommand "cache-file" {} ''
|
||||
@ -436,8 +436,8 @@ final: prev: {
|
||||
# from hackage. This is useful if you want to build an executable from
|
||||
# a given package.
|
||||
# NB: If no explicit index-state is provided the most recent one from
|
||||
# the index-state-hashes is used. This guarantees reproducability wrt
|
||||
# to the haskell.nix revision. If reproducability beyond haskell.nix
|
||||
# the index-state-hashes is used. This guarantees reproducibility wrt
|
||||
# to the haskell.nix revision. If reproducibility beyond haskell.nix
|
||||
# is required, a specific index-state should be provided!
|
||||
hackage-package =
|
||||
{ name, compiler-nix-name, ... }@args':
|
||||
@ -567,9 +567,9 @@ final: prev: {
|
||||
# `projectFileName = "cabal.project";`
|
||||
# to let it know which to choose (or pick another name). If the
|
||||
# selected file ends in a `.yaml` it is assumed to be for `stackProject`.
|
||||
# If niether `stack.yaml` nor `cabal.project` exist `cabalProject` is
|
||||
# If neither `stack.yaml` nor `cabal.project` exist `cabalProject` is
|
||||
# used (as it will use a default `cabal.project`).
|
||||
project' = { src, projectFileName ? null, ... }@args':
|
||||
project' = { src, projectFileName ? null, ... }@args':
|
||||
let
|
||||
args = { caller = "project'"; } // args';
|
||||
dir = __readDir (src.origSrcSubDir or src);
|
||||
|
@ -1,6 +1,6 @@
|
||||
let
|
||||
# Here we try to figure out which qemu to use based on the host platform.
|
||||
# This guess can be overriden by passing qemuSuffix
|
||||
# This guess can be overridden by passing qemuSuffix
|
||||
qemuByHostPlatform = hostPlatform:
|
||||
# I'd prefer this was a dictionary lookup, with a fall through into abort,
|
||||
# that would make this more readable I guess. I think there is some similar
|
||||
|
@ -12,7 +12,7 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({
|
||||
busybox-sandbox-shell = prev.busybox-sandbox-shell.override { inherit (final) busybox; };
|
||||
|
||||
# we don't want the static output to be split. That just
|
||||
# messes with the z -> libz mapping. We can't have a conditonal
|
||||
# messes with the z -> libz mapping. We can't have a conditional
|
||||
# z -> libz / z -> libz.static mapping without threading the
|
||||
# package configuration in. That seems a bit overkill.
|
||||
zlib = prev.zlib.override { splitStaticOutput = false; };
|
||||
|
@ -5,7 +5,7 @@
|
||||
final: prev:
|
||||
{
|
||||
# on windows we have this habit of putting libraries
|
||||
# into `bin`, wheras on unix it's usually `lib`. For
|
||||
# into `bin`, whereas on unix it's usually `lib`. For
|
||||
# this confuses nix easily. So we'll just move the
|
||||
# .dll's from `bin` into `$out/lib`. Such that they
|
||||
# are trivially found.
|
||||
@ -45,7 +45,7 @@ final: prev:
|
||||
# extra-test-libs = [ pkgs.rocksdb pkgs.openssl.bin pkgs.libffi pkgs.gmp ];
|
||||
} // {
|
||||
# we can perform testing of cross compiled test-suites by using wine.
|
||||
# Therfore let's enable doCrossCheck here!
|
||||
# Therefore let's enable doCrossCheck here!
|
||||
doCrossCheck = pkgs.stdenv.hostPlatform.isWindows;
|
||||
};
|
||||
in {
|
||||
@ -79,9 +79,9 @@ final: prev:
|
||||
# }
|
||||
# else null)) ];
|
||||
|
||||
# clock 0.7.2 needs to be patche to support cross compilation.
|
||||
# clock 0.7.2 needs to be patched to support cross compilation.
|
||||
clock.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: (if version == "0.7.2" then ./patches/clock-0.7.2.patch else null)) ];
|
||||
# nix calles this package crypto
|
||||
# nix calls this package crypto
|
||||
cryptonite-openssl.patches = pkgs.stdenv.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version, revision }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
|
||||
|
||||
# this patch seems to be rather flaky and highly dependent on
|
||||
@ -126,4 +126,4 @@ final: prev:
|
||||
)
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ in pkgs.lib.evalModules {
|
||||
in let pkg-def' = strip-pkg-def pkg-def;
|
||||
# The desugar reason.
|
||||
#
|
||||
# it is quite combersome to write
|
||||
# it is quite cumbersome to write
|
||||
# (hackage: { packages.x.revision = hackage...;
|
||||
# packages.y.revision = import ./foo.nix; })
|
||||
# where we'd rather write:
|
||||
@ -85,7 +85,7 @@ in pkgs.lib.evalModules {
|
||||
|
||||
# Error handlers
|
||||
./modules/error-handler.nix
|
||||
|
||||
|
||||
# Supplies metadata
|
||||
./modules/cabal.nix
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluting
|
||||
# on a machine with e.g. no way to build the Darwin IFDs you need!
|
||||
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
|
||||
# on a machine with e.g. no way to build the Darwin IFDs you need!
|
||||
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
|
||||
, ifdLevel ? 3
|
||||
, checkMaterialization ? false }:
|
||||
|
@ -21,7 +21,7 @@ writeScript "check-closure-size.sh" ''
|
||||
echo "$nt"
|
||||
|
||||
total=$(awk '$2 == "total" { print $1; }' <<< "$nt")
|
||||
|
||||
|
||||
if [ $total -gt ${toString limitMB} ]; then
|
||||
echo "Closure size exceeds limit of ${toString limitMB}MB!"
|
||||
exit 1
|
||||
|
@ -39,7 +39,7 @@ let
|
||||
${ if lib.hasAttr "example" value
|
||||
then ''
|
||||
**Example**:
|
||||
|
||||
|
||||
${builtins.toJSON value.example}
|
||||
''
|
||||
else "**No Example**"
|
||||
|
@ -3,24 +3,24 @@ with builtins;
|
||||
with stdenv.lib;
|
||||
writeShellScriptBin "update-index-state-hashes" ''
|
||||
export PATH="${makeBinPath [ coreutils nix-tools nix curl ]}"
|
||||
|
||||
|
||||
# We'll take the last element from the indexStatesHashes file via nix and get the name.
|
||||
# This is the last timestamp recorded in the file (implicit assumption: the file is
|
||||
# ordered, and nix preserved that order when parsing it into a attributeset).
|
||||
start=${let ls = attrNames (import indexStateHashesPath); in elemAt ls (length ls - 1)}
|
||||
|
||||
|
||||
# The indexStatesHashesPath looks like
|
||||
# {
|
||||
# ...
|
||||
# }
|
||||
# Idea: take everything but drop the last line, and can then just append each new
|
||||
# entry and finally close the file with "}". We'll do this by echoing to STDOUT!
|
||||
|
||||
|
||||
# Old file without the closing curly brace.
|
||||
cat ${indexStateHashesPath} | head -n -1
|
||||
|
||||
|
||||
# Parse the $start date, and now into seconds with the date command. Then walk
|
||||
# them by 86400 (24*60*60) days. We need to format the output with '%.f' as we
|
||||
# them by 86400 (24*60*60) days. We need to format the output with '%.f' as we
|
||||
# don't want fractional values.
|
||||
for d in $(seq -f '%.f' $(date -u +%s -d $start) 86400 $(date -u +%s)) ; do
|
||||
# turn the step date $d into a YYYY-MM-DD string, and generate the truncated
|
||||
@ -35,7 +35,7 @@ writeShellScriptBin "update-index-state-hashes" ''
|
||||
echo " \"''${dt}T00:00:00Z\" = \"''${sha256}\";"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# emit the final closing brace.
|
||||
echo '}'
|
||||
''
|
||||
|
@ -18,7 +18,7 @@ in recurseIntoAttrs {
|
||||
run = stdenv.mkDerivation {
|
||||
name = "buildable-test";
|
||||
|
||||
buildCommand =
|
||||
buildCommand =
|
||||
(concatStrings (mapAttrsToList (name: value: ''
|
||||
printf "checking whether executable runs... " >& 2
|
||||
cat ${haskellLib.check value}
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -63,4 +63,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
buildable = true;
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../.; }
|
||||
} // rec { src = (pkgs.lib).mkDefault ../.; }
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
|
||||
let
|
||||
|
||||
hackage = import ./hackage;
|
||||
|
||||
tarball = {
|
||||
@ -57,10 +57,10 @@ in recurseIntoAttrs {
|
||||
otool -L $exe |grep .dylib
|
||||
'')) + ''
|
||||
touch $out
|
||||
'';
|
||||
'';
|
||||
meta.platforms = platforms.all;
|
||||
passthru = {
|
||||
inherit project;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -73,4 +73,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, config, ... }:
|
||||
url = "http://not-there//package/external-package-demo-0.1.0.0/external-package-demo-0.1.0.0.tar.gz";
|
||||
sha256 = config.sha256;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
inherit compiler-nix-name;
|
||||
name = "pandoc";
|
||||
version = "2.9.2.1";
|
||||
index-state = "2020-05-25T00:00:00Z";
|
||||
index-state = "2020-05-25T00:00:00Z";
|
||||
# Function that returns a sha256 string by looking up the location
|
||||
# and tag in a nested attrset
|
||||
lookupSha256 = { location, tag, ... }:
|
||||
|
@ -47,11 +47,11 @@ writeScript "regen-tests.sh" ''
|
||||
|
||||
cd cabal-simple
|
||||
regen cabal-simple
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
cd cabal-sublib
|
||||
regen cabal-sublib
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
cd with-packages
|
||||
regen test-with-packages
|
||||
|
@ -15,10 +15,10 @@ let
|
||||
|
||||
env = project.hsPkgs.shellFor {};
|
||||
|
||||
# Making this work for cross compilers will be dificult as setup-deps are
|
||||
# Making this work for cross compilers will be difficult as setup-deps are
|
||||
# built for the build platform and the shell will be for the host platform.
|
||||
# We probably need a shell that provides both build and host ghc
|
||||
# and corrisponding package DBs and a way to use them.
|
||||
# and corresponding package DBs and a way to use them.
|
||||
# This problem affects musl as well as the build libraries are linked to glibc.
|
||||
in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
|
||||
then
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -70,4 +70,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
};
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../pkga; }
|
||||
} // rec { src = (pkgs.lib).mkDefault ../pkga; }
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -91,4 +91,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
};
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../pkgb; }
|
||||
} // rec { src = (pkgs.lib).mkDefault ../pkgb; }
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -80,4 +80,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ./.; }) // {
|
||||
cabal-generator = "hpack";
|
||||
}
|
||||
}
|
||||
|
@ -2,19 +2,19 @@ let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
@ -24,16 +24,16 @@ let
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
@ -63,4 +63,4 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
buildable = true;
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../.; }
|
||||
} // rec { src = (pkgs.lib).mkDefault ../.; }
|
||||
|
Loading…
Reference in New Issue
Block a user