diff --git a/CHANGELOG.md b/CHANGELOG.md index d28852f..be44902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,49 @@ +## 4.0.0 + +* Make sure the `psqueues` Haskell package gets the `fingertree-psqueue` dep + depending on what version of `psqueues` you're compiling. + + Added in [#39](https://github.com/cdepillabout/stacklock2nix/pull/39). + +* Change stacklock2nix's handling of Stack's `git` dependencies. + + A `git` dependency looks like the following in `stack.yaml`: + + ```yaml + extra-deps: + - git: "https://github.com/haskell-servant/servant-cassava" + commit: "f76308b42b9f93a6641c70847cec8ecafbad3abc" + ``` + + Up until now, stacklock2nix would download Stack's `git` dependencies using + Nix's `builtins.fetchGit` function. + + By default, this function doesn't clone the full repository, but only the + history of the default branch. This is a problem if you try to specify a + commit that is not a parent of the default branch. This may happen if + you're developing new functionality in a feature branch that hasn't yet + been merged into `master`. + + stacklock2nix has been changed to additionally specify the `allRefs = true` + argument to `builtins.fetchGit`. This causes the full Git repository to be + downloaded, even commits that aren't ancestors of the default branch. + + Added in [#39](https://github.com/cdepillabout/stacklock2nix/pull/39). + Thanks to [@isomorpheme](https://github.com/isomorpheme) for reporting this + and coming up with the fix. + + It is possible this causes increased download times, especially for repos + that are very big. + + You may be able to work around this by using Stack's functionality for + downloading given URLs, in order to download a tarball of a repository + (without any of the Git history).: + + ```yaml + extra-deps: + - url: "https://github.com/haskell-servant/servant-cassava/archive/f76308b42b9f93a6641c70847cec8ecafbad3abc.tar.gz" + ``` + ## 3.0.5 * Make sure the `digest` Haskell package gets the system `zlib` as an argument. diff --git a/nix/build-support/stacklock2nix/cabal2nixArgsForPkg.nix b/nix/build-support/stacklock2nix/cabal2nixArgsForPkg.nix index a04978a..05056a8 100644 --- a/nix/build-support/stacklock2nix/cabal2nixArgsForPkg.nix +++ b/nix/build-support/stacklock2nix/cabal2nixArgsForPkg.nix @@ -92,8 +92,13 @@ cabal2nixArgsOverrides { "pango" = ver: { pango = pkgs.pango; }; - # The PSQueue and fingertree-psqueue packages are used in benchmarks, but they are not on Stackage. - "psqueues" = ver: { fingertree-psqueue = null; PSQueue = null; }; + "psqueues" = ver: + if pkgs.lib.versionAtLeast ver "0.2.8.0" then + # The PSQueue package is used in benchmarks, but it is not on Stackage. + { PSQueue = null; } + else + # The PSQueue and fingertree-psqueue packages are used in benchmarks, but they are not on Stackage. + { fingertree-psqueue = null; PSQueue = null; }; "saltine" = ver: { libsodium = pkgs.libsodium; }; diff --git a/nix/build-support/stacklock2nix/default.nix b/nix/build-support/stacklock2nix/default.nix index b13f246..116ca11 100644 --- a/nix/build-support/stacklock2nix/default.nix +++ b/nix/build-support/stacklock2nix/default.nix @@ -380,6 +380,7 @@ let url = haskPkgLock.git; name = srcName; rev = haskPkgLock.commit; + allRefs = true; }; src = if haskPkgLock ? "subdir" then