- Fix build failure when using
all-cabal-nixesand the last package in the list is a duplicate. The derivation would fail with exit code 1 due to a shell scripting issue. #70 Thanks @Mr-Andersen!
-
Handle
splitmix >= 0.1.3.2no longer having atestu01test suite. Starting in splitmix-0.1.3.2, the testu01 test suite was removed and moved to a separate package. #72 -
Add
dontCheckforinteger-logarithms. The test suite requires a version of QuickCheck that is not in Stackage LTS-24. #72
-
Mark several additional packages as
dontCheckinsuggestedOverlaydue to circular dependencies in their test suites:call-stackoptparse-applicativeprettyprinter-ansi-terminaltastytemporary
-
Change
regex-tdfato fully disable tests (previously only ran a subset). #69 -
Fix
test-frameworkto only require thelibxmlsystem dependency for versions before 0.8.2.2. Newer versions no longer need this dependency. #69
-
Adds
all-cabal-nixesargument to stacklock2nix. This gives an improvement on initial build time when using stacklock2nix with a shared cache.The
all-cabal-nixesargument can be used like the following:stacklock2nix { stackYaml = ./stack.yaml; all-cabal-nixes = fetchFromGitHub { owner = "all-cabal-nixes"; repo = "all-cabal-nixes"; rev = "c37e66df270014a18ed11527db55928a4a2ae5d4"; sha256 = "sha256-QcAhW8yFGwj7L1LWbvjdSQ2bTDeQ+1DVeC+/jS4gJA4="; }; }
This greatly reduces the amount of IFD needed for building packages from Hackage.
See the PR adding this feature for more information: #65
- Adds
os-stringandghc-internalto list of GHC boot libraries. This is required for usingstacklock2nixwith >= GHC-9.10. Added in #64. Thanks to @Mr-Andersen!
Starting from this version of stacklock2nix, it will only be usable with Nixpkgs >= 24.05!
Big changes:
-
Fixes the construction of
newPkgSet. See here for more information.One big implication of this change is that Nixpkgs before the referenced commit will not be able to be used with stacklock2nix anymore. So this version of stacklock2nix will only work with Nixpkgs after that commit (so around
>= nixos-24.05)!Fixed in #62. Thanks to @Mr-Andersen!
-
Correctly passes
all-cabal-hashestonewPkgSet. Fixed in #62. Thanks to @Mr-Andersen for reporting this.
A few other small changes:
-
Expose some additional
passthruvalues on Haskell derivations generated by stacklock2nix.All Haskell derivations generated with
stacklock2nixnow have apassthru.stacklock2nixkey, which is an attrset filled with the following keys. All keys have aBoolvalue:is-local-pkg: Is this a local package defined instack.yaml?is-extra-dep: Is this anextra-depdefined instack.yaml?is-hackage-dep: Is this a dep from Hackage?is-git-dep: Is this a dep from Git?is-url-dep: Is this a dep from a URL?
This can be used in your own overlays. For instance, if you want to apply an overlay to the Haskell package set produced by stacklock2nix that disables tests ONLY for local Haskell packages, you could write the overlay like the following:
hfinal: hprev: lib.mapAttrs ( name: drv: if lib.attrByPath [ "passthru" "stacklock2nix" "is-local-pkg" ] false drv then modifierFunc drv else drv ) hprev
Added in #63
See the tests in that PR for some more examples of how you might want to use this.
-
Expose some additional
passthruvalues on the Haskell dev shell generated by stacklock2nix.The dev shells generated with
stacklock2nixnow have apassthru.stacklock2nixkey, which is an attrset filled with the following keys and values:dev-shell-pkg-set: The Haskell package set used to generate this dev shell. This is mainly useful in conjunction with thedevShellPkgSetModifier, in order to inspect the final package set produced after applyingdevShellPkgSetModifier.shell-for-args: The passed toshellForin order to produce the dev shell. This is an attrset.
-
Mark some additional packages as
dontCheckinsuggestedOverlay:- cborg
- lifted-base
- serialise
- servant-cassava
Implemented in #62
-
Pass
nullas thepgp-wordlistargument toprettyprinter.pgp-wordlistis a test dep, but it is not in stackage.Implemented in #62
(Tests for
prettyprinterwere disabled insuggestedOverlayin #59)
-
Add a new
devShellPkgSetModifierfor giving the user a hook to modify the Haskell package set used to generate the development shell. See here for documentation. Added in #59. -
Add a new
devShellArgsModifierfor giving the user a hook to modify the arguments passed toshellForwhen generating the development shell. See here for documentation. Added in #59. Heavily inspired by #57. Thanks @haruki7049! -
Various additions to the suggestedOverlay.nix file to get more Haskell packages building by default:
- mark
binary-searchasdontCheck - mark
haskoin-coreasdontCheck - mark
hedisasdontCheck - mark
http-clientasdontCheck - mark
http-client-opensslasdontCheck - mark
http-client-tlsasdontCheck - mark
http-conduitasdontCheck - mark
js-queryasdontCheck - mark
prettyprinterasdontCheck - mark
servant-openapi3asdontCheck - mark
servant-rate-limitasdontCheck - mark
wai-rate-limit-redisasdontCheck
Added in #59.
- mark
-
Add build depend on system
tzdatapackage for the Haskelltzandtzdatapackages innix/build-support/stacklock2nix/suggestedOverlay.nix. Fixed in #52. -
Make sure Haskell packages specified as Git repos in the
stack.yamlfile check out all submodules when fetching their source. Fixed in #53. Thanks to @isomorpheme for reporting this. -
Change handling of subdirs for
gitextra-deps.stacklock2nixinternally callscabal2nixto generate Nix expressions for Haskell packages. In previous versions ofstacklock2nix, the actualsubdirfor agitextra-dep would be copied to the Nix store, and thencabal2nixwould be run on it.This has been fixed to instead call
cabalni2xon the full Git repo, but pass the--subpathto specify the sub package. This likely works better where sub paths contain soft links to other paths in the Git repo.It is unlikely this change will cause any problems for any current users of
stacklock2nix.Fixed in #46 and #56. Thanks to @isomorpheme
-
Make
stacklock2nix'sfromYAMLfunction more reliable.stacklock2nixinternally uses theremarshaltool for converting from thestack.yamlfile to a JSON, in order to read it with Nix.Recent versions of
remarshal(>= 0.17.0) changed functionality to fail at runtime more often. An new flag is needed on the command line to fall back to the old functionality.Fixed in #55. Thanks to @Mr-Andersen
-
Fix a bug where
stacklock2nixwould throw an error if there were no localpackagesdefined in the inputstack.yamlfile.This PR also makes
stacklock2nixuse a default package of"."if the top-levelpackageskey is missing from thestack.yamlfile. This matchesstack's behavior.Fixed in #50. Thanks @chris-martin for reporting this.
-
Download
.cabalfile revisions from the public Casa instance instead of Hackage.We believe this change shouldn't affect any end users, but we now depend on https://casa.stackage.org instead of Hackage. If Casa ends up having signficantly worse uptime than Hackage, then users may be affected when trying to use stacklock2nix. Please let us know if this ends up affecting you.
-
Make sure the
psqueuesHaskell package gets thefingertree-psqueuedep depending on what version ofpsqueuesyou're compiling.Added in #39.
-
Change stacklock2nix's handling of Stack's
gitdependencies.A
gitdependency looks like the following instack.yaml:extra-deps: - git: "https://github.com/haskell-servant/servant-cassava" commit: "f76308b42b9f93a6641c70847cec8ecafbad3abc"
Up until now, stacklock2nix would download Stack's
gitdependencies using Nix'sbuiltins.fetchGitfunction.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 = trueargument tobuiltins.fetchGit. This causes the full Git repository to be downloaded, even commits that aren't ancestors of the default branch.Added in #39. Thanks to @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).:
extra-deps: - url: "https://github.com/haskell-servant/servant-cassava/archive/f76308b42b9f93a6641c70847cec8ecafbad3abc.tar.gz"
-
Make sure the
digestHaskell package gets the systemzlibas an argument.Added in #35.
- Remove
dontCheckoverride forhaskelineinnix/build-support/stacklock2nix/suggestedOverlay.nix.haskelineis a GHC boot package, so it is not built as a separate Nix derivation. It is distributed with GHC, so it is set tonullin the Nixpkgs pkg set.
-
A few additional overrides added to
nix/build-support/stacklock2nix/suggestedOverlay.nixto fix some breakages in test suites caused by QuickCheck-2.14.3. QuickCheck-2.14.3 is included in LTS-20.24, so you'll likely need these fixes if you are using LTS-20.24 or later.Added in #31.
-
Fix override with splitmix argument,
testu01.Added in #28.
-
A few additional overrides added to
nix/build-support/stacklock2nix/suggestedOverlay.nixto fix some common problems on Darwin.Added in #28.
-
Fix override with unordered-containers argument,
nothunks.Added in #26.
-
Add some additional filters to the default
localPkgFilterargument.Now most files from Haskell.gitignore are filtered out by default.
While this is technically a breaking change, this shouldn't negatively affect most users.
Added in #24.
-
Fixes a bug in the implementation of the new
localPkgFilterargument added in v2.0.0. This bug is not a correctness problem (so if you accidentally use v2.0.0, you should not get incorrectly built Haskell packages). The bug is just that files will get pulled into the Nix store that you may expect to be filtered out.See #23 for the details.
-
(WARNING: There is a bug in the implementation of this new
localPkgFilterfeature. You are recommended to use v2.0.1 instead of v2.0.0!)Add a
localPkgFilterargument tostacklock2nix. This can be used to filter the sources of local Haskell packages.Here's an example of how you might use it:
stacklock2nix { stackYaml = ./stack.yaml; localPkgFilter = defaultLocalPkgFilter: pkgName: path: type: if pkgName == "my-example-haskell-lib" && baseNameOf path == "extra-file" then false else defaultLocalPkgFilter path type; }
This is an example of filtering out a file called
extra-filefrom the input source of the Haskell packagemy-example-haskell-lib.This is a major version bump because if you don't specify the
localPkgFilterargument tostacklock2nix, it defaults to using a filter that filters out the.stack-work/directory, as well as directories likedist-newstyle. It also passes input files through thelib.cleanSourceFilterfunction, which filters out.git/, as well as a few other types of files.While this is technically a major version bump, most users won't be negatively affected by this change. It is quite likely this won't affect most people.
Added in #22.
-
Add
all-cabal-hashesas an output fromstacklock2nix. This can be used as in the "advanced" example:final: prev: { my-example-haskell-stacklock = final.stacklock2nix { stackYaml = ../stack.yaml; all-cabal-hashes = final.fetchFromGitHub { owner = "commercialhaskell"; repo = "all-cabal-hashes"; rev = "9ab160f48cb535719783bc43c0fbf33e6d52fa99"; sha256 = "sha256-Hz/xaCoxe4cJBH3h/KIfjzsrEyD915YEVEK8HFR7nO4="; }; }; my-example-haskell-pkg-set = final.haskell.packages.ghc924.override (oldAttrs: { inherit (final.my-example-haskell-stacklock) all-cabal-hashes; ...
Added in #19.
-
Make sure that
stacklock2nixwill work if the inputall-cabal-hashesargument is a directory (instead of a tarball).Passing
all-cabal-hashesas a directory will make the initial build process a little faster (although shouldn't affect future rebuilds).You can easily pass
all-cabal-hashesas a directory by pulling it down withfetchFromGitHublike the following:final: prev: { my-stacklock2nix-proj = final.stacklock2nix { stackYaml = ./stack.yaml; ... all-cabal-hashes = final.fetchFromGitHub { owner = "commercialhaskell"; repo = "all-cabal-hashes"; rev = "9ab160f48cb535719783bc43c0fbf33e6d52fa99"; sha256 = "sha256-Hz/xaCoxe4cJBH3h/KIfjzsrEyD915YEVEK8HFR7nO4="; }; }; }
-
Added two new attributes to the attribute set returned from a call to
stacklock2nix:newPkgSetandnewPkgSetDevShell. These two values are similar to the existingpkgSetanddevShellattributes. WhereaspkgSetanddevShelltake thebaseHaskellPkgSetargument and overlay it with package overrides created from yourstack.yamlfile,newPkgSetandnewPkgSetDevShellare a completely new package set, containing only packages from yourstack.yaml.The effect of this is that
pkgSetwill contain packages that are in Nixpkgs, but not in Stackage. For instance, when usingpkgSet, you should be able to access the packagepkgSet.termonadbecause it is available on Hackage (and in Nixpkgs), even though it is not in any Stackage resolver.However,
newPkgSetwill only contain packages in yourstack.yamlfile. For instance, you'll never be able to accessnewPkgSet.termonadornewPkgSet.spago, because they will likely never be available on Stackage.In general, in your own projects, should you use
pkgSetornewPkgSet?For building your own projects, most of the time
pkgSetandnewPkgSetshould be similar.newPkgSetmay be slightly safer, since there is almost no chance you accidentally use a Haskell package outside of yourstack.yaml.pkgSetmay be slightly more convenient depending on what you're trying to do.
-
This is the 1.0 release of
stacklock2nix. I've testedstacklock2nixon building a few real-world Haskell projects, and it has worked well.stacklock2nixis ready to be widely used. -
There have been a some overrides added to
nix/build-support/stacklock2nix/suggestedOverlay.nixsince the 0.2.0 release, but no API changes tostacklock2nixitself. This would normally be a patch-release (to 0.2.1), but I instead wanted to release version 1.0.
-
Add a
callPackageargument tostacklock2nixso that users can easily statically-compile Haskell packages.This could be used like the following:
my-haskell-stacklock = final.stacklock2nix { stackYaml = ./stack.yaml; baseHaskellPkgSet = final.pkgsStatic.haskell.packages.ghc924; callPackage = final.pkgsStatic.callPackage; ... };
-
Make sure
githubtypes ofextra-depsinstack.yamlare handled correctly. Previous version did not handlegithubdeps correctly when they had no subdirs.extra-depsinstack.yamllike the following will now work:extra-deps: - github: "cdepillabout/pretty-simple" commit: "d8ef1b3c2d913a05515b2d1c4fec0b52d2744434"
- Initial release.