From 09526c85558417de609ced98460392460b025b98 Mon Sep 17 00:00:00 2001 From: "John A. Lotoski" <39752197+johnalotoski@users.noreply.github.com> Date: Sun, 30 Aug 2020 19:08:25 -0400 Subject: [PATCH] Spelling, typo and whitespace fixes (#833) * Spelling and typo fixes in doc and code comments * Trailing whitespace or whitespace only truncation * readTheDocs formatting corrections --- builder/comp-builder.nix | 6 +++--- builder/default.nix | 4 ++-- builder/haddock-builder.nix | 2 +- builder/make-config-files.nix | 14 +++++++------- changelog.md | 4 ++-- ci.nix | 4 ++-- compiler/ghc/configured-src.nix | 4 ++-- compiler/ghc/default.nix | 16 ++++++++-------- compiler/ghcjs/ghcjs.nix | 4 ++-- docs/adding-new-ghc.md | 4 ++-- docs/architecture.md | 2 +- docs/dev/dev-architecture.md | 2 +- docs/dev/installing-nix-tools.md | 2 ++ docs/dev/manually-generating-nix-expressions.md | 2 +- docs/motivation.md | 4 ++-- docs/troubleshooting.md | 4 ++-- .../building-package-from-stackage-hackage.md | 4 ++-- docs/tutorials/clean-git.md | 4 ++-- docs/tutorials/development.md | 8 +++++--- docs/tutorials/hackage-stackage.md | 4 ++-- docs/tutorials/materialization.md | 10 +++++----- docs/tutorials/pkg-map.md | 5 +++-- docs/tutorials/source-repository-hashes.md | 2 +- lib/cabal-project-parser.nix | 2 +- lib/call-cabal-project-to-nix.nix | 10 +++++----- lib/clean-cabal-component.nix | 4 ++-- lib/clean-source-haskell.nix | 2 +- lib/clean-source-with.nix | 6 +++--- lib/default.nix | 2 +- lib/fetch-resolver.nix | 2 +- lib/import-and-filter-project.nix | 2 +- lib/stack-cache-generator.nix | 4 ++-- lib/system-nixpkgs-map.nix | 4 ++-- mk-local-hackage-repo/default.nix | 4 ++-- modules/cabal.nix | 2 +- modules/component-driver.nix | 4 ++-- modules/configuration-nix.nix | 2 +- modules/hackage.nix | 2 +- modules/package.nix | 2 +- modules/plan.nix | 6 +++--- nix-tools/regenerate.nix | 4 ++-- overlays/armv6l-linux.nix | 8 ++++---- overlays/bootstrap.nix | 8 ++++---- overlays/default.nix | 2 +- overlays/emscripten/default.nix | 2 +- overlays/hackage-quirks.nix | 6 +++--- overlays/haskell.nix | 14 +++++++------- overlays/linux-cross.nix | 2 +- overlays/musl.nix | 2 +- overlays/windows.nix | 10 +++++----- package-set.nix | 4 ++-- release.nix | 4 ++-- scripts/check-closure-size.nix | 2 +- scripts/options-doc.nix | 2 +- scripts/update-index-state-hashes.nix | 12 ++++++------ test/buildable/default.nix | 2 +- test/builder-haddock/.plan.nix/test-haddock.nix | 14 +++++++------- test/builder-haddock/test-haddock.nix | 12 ++++++------ test/extra-hackage/default.nix | 8 ++++---- ...d8bbfcf570019a7faa4a0f59b2ea96743932105e7.nix | 14 +++++++------- test/lookup-sha256/default.nix | 2 +- test/regen.nix | 4 ++-- test/shell-for-setup-deps/default.nix | 4 ++-- test/shell-for/.plan.nix/pkga.nix | 14 +++++++------- test/shell-for/.plan.nix/pkgb.nix | 14 +++++++------- test/stack-simple/stack-simple.nix | 14 +++++++------- .../.plan.nix/test-with-packages.nix | 14 +++++++------- 67 files changed, 189 insertions(+), 184 deletions(-) diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index 4d7bfe29..934a8680 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -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 ..." diff --git a/builder/default.nix b/builder/default.nix index 16b8b0fe..74b720f0 100644 --- a/builder/default.nix +++ b/builder/default.nix @@ -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; diff --git a/builder/haddock-builder.nix b/builder/haddock-builder.nix index dccdbacc..e582d935 100644 --- a/builder/haddock-builder.nix +++ b/builder/haddock-builder.nix @@ -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; diff --git a/builder/make-config-files.nix b/builder/make-config-files.nix index 172d5ef8..bb62bc9d 100644 --- a/builder/make-config-files.nix +++ b/builder/make-config-files.nix @@ -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. diff --git a/changelog.md b/changelog.md index aa96e159..5671e901 100644 --- a/changelog.md +++ b/changelog.md @@ -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` diff --git a/ci.nix b/ci.nix index cdc94155..5b74cbe7 100644 --- a/ci.nix +++ b/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. diff --git a/compiler/ghc/configured-src.nix b/compiler/ghc/configured-src.nix index 08bdfb2a..cc288b8e 100644 --- a/compiler/ghc/configured-src.nix +++ b/compiler/ghc/configured-src.nix @@ -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"; -}) \ No newline at end of file +}) diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 7ab1fc2a..5fbfea41 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -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; -}) \ No newline at end of file +}) diff --git a/compiler/ghcjs/ghcjs.nix b/compiler/ghcjs/ghcjs.nix index 90be7ce8..21f89b0f 100644 --- a/compiler/ghcjs/ghcjs.nix +++ b/compiler/ghcjs/ghcjs.nix @@ -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 \ No newline at end of file +in booted-ghcjs diff --git a/docs/adding-new-ghc.md b/docs/adding-new-ghc.md index 25137d57..6e0e29ea 100644 --- a/docs/adding-new-ghc.md +++ b/docs/adding-new-ghc.md @@ -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` diff --git a/docs/architecture.md b/docs/architecture.md index e0a793dc..a56ebdf7 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -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 diff --git a/docs/dev/dev-architecture.md b/docs/dev/dev-architecture.md index f3bd95b2..db99a544 100644 --- a/docs/dev/dev-architecture.md +++ b/docs/dev/dev-architecture.md @@ -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 diff --git a/docs/dev/installing-nix-tools.md b/docs/dev/installing-nix-tools.md index 11caa8a9..4036b24f 100644 --- a/docs/dev/installing-nix-tools.md +++ b/docs/dev/installing-nix-tools.md @@ -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 diff --git a/docs/dev/manually-generating-nix-expressions.md b/docs/dev/manually-generating-nix-expressions.md index ca3cb8f6..deee84ab 100644 --- a/docs/dev/manually-generating-nix-expressions.md +++ b/docs/dev/manually-generating-nix-expressions.md @@ -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 diff --git a/docs/motivation.md b/docs/motivation.md index 65a81192..c500b128 100644 --- a/docs/motivation.md +++ b/docs/motivation.md @@ -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: diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 1ce5de1c..dcce2c1d 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -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`. diff --git a/docs/tutorials/building-package-from-stackage-hackage.md b/docs/tutorials/building-package-from-stackage-hackage.md index 9e2e3995..ff6623a3 100644 --- a/docs/tutorials/building-package-from-stackage-hackage.md +++ b/docs/tutorials/building-package-from-stackage-hackage.md @@ -20,7 +20,7 @@ you could run: nix build '(with import (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 (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 diff --git a/docs/tutorials/clean-git.md b/docs/tutorials/clean-git.md index 3ed265d2..8442fdc6 100644 --- a/docs/tutorials/clean-git.md +++ b/docs/tutorials/clean-git.md @@ -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: diff --git a/docs/tutorials/development.md b/docs/tutorials/development.md index e5b2b05a..041eae98 100644 --- a/docs/tutorials/development.md +++ b/docs/tutorials/development.md @@ -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 diff --git a/docs/tutorials/hackage-stackage.md b/docs/tutorials/hackage-stackage.md index 007faa9e..aabab62b 100644 --- a/docs/tutorials/hackage-stackage.md +++ b/docs/tutorials/hackage-stackage.md @@ -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; diff --git a/docs/tutorials/materialization.md b/docs/tutorials/materialization.md index c3a20722..e310b501 100644 --- a/docs/tutorials/materialization.md +++ b/docs/tutorials/materialization.md @@ -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 diff --git a/docs/tutorials/pkg-map.md b/docs/tutorials/pkg-map.md index 2ccd4c13..0f784661 100644 --- a/docs/tutorials/pkg-map.md +++ b/docs/tutorials/pkg-map.md @@ -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) diff --git a/docs/tutorials/source-repository-hashes.md b/docs/tutorials/source-repository-hashes.md index 4d717993..27bc2b1d 100644 --- a/docs/tutorials/source-repository-hashes.md +++ b/docs/tutorials/source-repository-hashes.md @@ -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. diff --git a/lib/cabal-project-parser.nix b/lib/cabal-project-parser.nix index 2f6ead4ad..f96b6597 100644 --- a/lib/cabal-project-parser.nix +++ b/lib/cabal-project-parser.nix @@ -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; diff --git a/lib/call-cabal-project-to-nix.nix b/lib/call-cabal-project-to-nix.nix index e696b1e7..18af5098 100644 --- a/lib/call-cabal-project-to-nix.nix +++ b/lib/call-cabal-project-to-nix.nix @@ -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; diff --git a/lib/clean-cabal-component.nix b/lib/clean-cabal-component.nix index 410e96ec..5dc6488a 100644 --- a/lib/clean-cabal-component.nix +++ b/lib/clean-cabal-component.nix @@ -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); - } \ No newline at end of file + } diff --git a/lib/clean-source-haskell.nix b/lib/clean-source-haskell.nix index 1f9c9d49..fd161e00 100644 --- a/lib/clean-source-haskell.nix +++ b/lib/clean-source-haskell.nix @@ -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". diff --git a/lib/clean-source-with.nix b/lib/clean-source-with.nix index 6cc2e9f2..5f1a8256 100644 --- a/lib/clean-source-with.nix +++ b/lib/clean-source-with.nix @@ -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)); -} \ No newline at end of file +} diff --git a/lib/default.nix b/lib/default.nix index 05cbd15e..6c23fdaa 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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 diff --git a/lib/fetch-resolver.nix b/lib/fetch-resolver.nix index 4718d956..31a58a7d 100644 --- a/lib/fetch-resolver.nix +++ b/lib/fetch-resolver.nix @@ -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 { diff --git a/lib/import-and-filter-project.nix b/lib/import-and-filter-project.nix index 34152906..7bd8e7e9 100644 --- a/lib/import-and-filter-project.nix +++ b/lib/import-and-filter-project.nix @@ -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 diff --git a/lib/stack-cache-generator.nix b/lib/stack-cache-generator.nix index 6d4664ee..a8d3c2fc 100644 --- a/lib/stack-cache-generator.nix +++ b/lib/stack-cache-generator.nix @@ -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 ]; } '' diff --git a/lib/system-nixpkgs-map.nix b/lib/system-nixpkgs-map.nix index de01f123..beb0955e 100644 --- a/lib/system-nixpkgs-map.nix +++ b/lib/system-nixpkgs-map.nix @@ -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 diff --git a/mk-local-hackage-repo/default.nix b/mk-local-hackage-repo/default.nix index 7b7651b9..1c6007c1 100644 --- a/mk-local-hackage-repo/default.nix +++ b/mk-local-hackage-repo/default.nix @@ -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 }: diff --git a/modules/cabal.nix b/modules/cabal.nix index a2613eca..4c7e9d89 100644 --- a/modules/cabal.nix +++ b/modules/cabal.nix @@ -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; diff --git a/modules/component-driver.nix b/modules/component-driver.nix index 11851d09..ae29e112 100644 --- a/modules/component-driver.nix +++ b/modules/component-driver.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. diff --git a/modules/configuration-nix.nix b/modules/configuration-nix.nix index 9b62f124..d3755505 100644 --- a/modules/configuration-nix.nix +++ b/modules/configuration-nix.nix @@ -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, ... }: { diff --git a/modules/hackage.nix b/modules/hackage.nix index b398765b..b31134ec 100644 --- a/modules/hackage.nix +++ b/modules/hackage.nix @@ -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. diff --git a/modules/package.nix b/modules/package.nix index f4d380c4..e85e5410 100644 --- a/modules/package.nix +++ b/modules/package.nix @@ -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 = []; diff --git a/modules/plan.nix b/modules/plan.nix index 952894df..c24e6950 100644 --- a/modules/plan.nix +++ b/modules/plan.nix @@ -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; diff --git a/nix-tools/regenerate.nix b/nix-tools/regenerate.nix index f376a0c7..f9575f6d 100644 --- a/nix-tools/regenerate.nix +++ b/nix-tools/regenerate.nix @@ -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; }' diff --git a/overlays/armv6l-linux.nix b/overlays/armv6l-linux.nix index daeed3c7..80e4ad86 100644 --- a/overlays/armv6l-linux.nix +++ b/overlays/armv6l-linux.nix @@ -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: ) ]; }); -} \ No newline at end of file +} diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 406f433f..64448fde 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -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; diff --git a/overlays/default.nix b/overlays/default.nix index e631aea9..7a8b63c9 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -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 = { }; diff --git a/overlays/emscripten/default.nix b/overlays/emscripten/default.nix index a781d51f..e9c0aa87 100644 --- a/overlays/emscripten/default.nix +++ b/overlays/emscripten/default.nix @@ -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 -----------------" ''; diff --git a/overlays/hackage-quirks.nix b/overlays/hackage-quirks.nix index 3ab2095f..0509dd39 100644 --- a/overlays/hackage-quirks.nix +++ b/overlays/hackage-quirks.nix @@ -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 = { diff --git a/overlays/haskell.nix b/overlays/haskell.nix index 063cbadd..d0108202 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -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); diff --git a/overlays/linux-cross.nix b/overlays/linux-cross.nix index ee5d5d76..c1c92115 100644 --- a/overlays/linux-cross.nix +++ b/overlays/linux-cross.nix @@ -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 diff --git a/overlays/musl.nix b/overlays/musl.nix index bcb3d903..d1f6adec 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -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; }; diff --git a/overlays/windows.nix b/overlays/windows.nix index 2f6f17fc..d26275e6 100644 --- a/overlays/windows.nix +++ b/overlays/windows.nix @@ -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: ) ]; }); -} \ No newline at end of file +} diff --git a/package-set.nix b/package-set.nix index 78a365e3..4e09e32f 100644 --- a/package-set.nix +++ b/package-set.nix @@ -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 diff --git a/release.nix b/release.nix index 331a2888..5052c938 100644 --- a/release.nix +++ b/release.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 }: diff --git a/scripts/check-closure-size.nix b/scripts/check-closure-size.nix index bf87f2cc..7bdae064 100644 --- a/scripts/check-closure-size.nix +++ b/scripts/check-closure-size.nix @@ -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 diff --git a/scripts/options-doc.nix b/scripts/options-doc.nix index 3c90070e..475bdad2 100644 --- a/scripts/options-doc.nix +++ b/scripts/options-doc.nix @@ -39,7 +39,7 @@ let ${ if lib.hasAttr "example" value then '' **Example**: - + ${builtins.toJSON value.example} '' else "**No Example**" diff --git a/scripts/update-index-state-hashes.nix b/scripts/update-index-state-hashes.nix index 0bf241fd..e26780f6 100644 --- a/scripts/update-index-state-hashes.nix +++ b/scripts/update-index-state-hashes.nix @@ -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 '}' '' diff --git a/test/buildable/default.nix b/test/buildable/default.nix index 268f2b27..5c65fb0a 100644 --- a/test/buildable/default.nix +++ b/test/buildable/default.nix @@ -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} diff --git a/test/builder-haddock/.plan.nix/test-haddock.nix b/test/builder-haddock/.plan.nix/test-haddock.nix index e4a2455c..2abb412d 100644 --- a/test/builder-haddock/.plan.nix/test-haddock.nix +++ b/test/builder-haddock/.plan.nix/test-haddock.nix @@ -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 ../.; } \ No newline at end of file + } // rec { src = (pkgs.lib).mkDefault ../.; } diff --git a/test/builder-haddock/test-haddock.nix b/test/builder-haddock/test-haddock.nix index e977da61..86a15c07 100644 --- a/test/builder-haddock/test-haddock.nix +++ b/test/builder-haddock/test-haddock.nix @@ -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. ''; diff --git a/test/extra-hackage/default.nix b/test/extra-hackage/default.nix index 8ae85d13..6665754f 100644 --- a/test/extra-hackage/default.nix +++ b/test/extra-hackage/default.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; - }; + }; }; } diff --git a/test/extra-hackage/hackage/hackage/external-package-demo-0.1.0.0-r0-3230db0813f2b468afb3ff7d8bbfcf570019a7faa4a0f59b2ea96743932105e7.nix b/test/extra-hackage/hackage/hackage/external-package-demo-0.1.0.0-r0-3230db0813f2b468afb3ff7d8bbfcf570019a7faa4a0f59b2ea96743932105e7.nix index bf46e066..a063e491 100644 --- a/test/extra-hackage/hackage/hackage/external-package-demo-0.1.0.0-r0-3230db0813f2b468afb3ff7d8bbfcf570019a7faa4a0f59b2ea96743932105e7.nix +++ b/test/extra-hackage/hackage/hackage/external-package-demo-0.1.0.0-r0-3230db0813f2b468afb3ff7d8bbfcf570019a7faa4a0f59b2ea96743932105e7.nix @@ -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; }); - } \ No newline at end of file + } diff --git a/test/lookup-sha256/default.nix b/test/lookup-sha256/default.nix index e0019b80..d942adbc 100644 --- a/test/lookup-sha256/default.nix +++ b/test/lookup-sha256/default.nix @@ -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, ... }: diff --git a/test/regen.nix b/test/regen.nix index aa0af8e1..07f3f941 100644 --- a/test/regen.nix +++ b/test/regen.nix @@ -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 diff --git a/test/shell-for-setup-deps/default.nix b/test/shell-for-setup-deps/default.nix index 0b1f7b26..030aa553 100644 --- a/test/shell-for-setup-deps/default.nix +++ b/test/shell-for-setup-deps/default.nix @@ -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 diff --git a/test/shell-for/.plan.nix/pkga.nix b/test/shell-for/.plan.nix/pkga.nix index 350ac128..9370eb54 100644 --- a/test/shell-for/.plan.nix/pkga.nix +++ b/test/shell-for/.plan.nix/pkga.nix @@ -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; } \ No newline at end of file + } // rec { src = (pkgs.lib).mkDefault ../pkga; } diff --git a/test/shell-for/.plan.nix/pkgb.nix b/test/shell-for/.plan.nix/pkgb.nix index 45c4a008..2058cecc 100644 --- a/test/shell-for/.plan.nix/pkgb.nix +++ b/test/shell-for/.plan.nix/pkgb.nix @@ -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; } \ No newline at end of file + } // rec { src = (pkgs.lib).mkDefault ../pkgb; } diff --git a/test/stack-simple/stack-simple.nix b/test/stack-simple/stack-simple.nix index 964f527d..d0cc5fdb 100644 --- a/test/stack-simple/stack-simple.nix +++ b/test/stack-simple/stack-simple.nix @@ -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"; - } \ No newline at end of file + } diff --git a/test/with-packages/.plan.nix/test-with-packages.nix b/test/with-packages/.plan.nix/test-with-packages.nix index 2937fd2a..5857a035 100644 --- a/test/with-packages/.plan.nix/test-with-packages.nix +++ b/test/with-packages/.plan.nix/test-with-packages.nix @@ -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 ../.; } \ No newline at end of file + } // rec { src = (pkgs.lib).mkDefault ../.; }