nix: Base overridden packages on correct package versions
Previously we would use whatever version was in nixpkgs yet this may not be the version which the patch is supposed to be applied against.
Fixes #1 (closed).
Merge request reports
Activity
@vaibhavsagar indeed. The problem is I don't know of a convenient way to do this. Do you have any suggestions?
added 1 commit
- 1996de3e - nix: Base overridden packages on correct package versions
@bgamari my preferred approach is to store the information in a
.json
file and use a bash script to update it, see here for example. This can be run as follows:$ ./updater versions.json
to get an updated
all-cabal-hashes
.Edited by Vaibhav Sagaradded 1 commit
- de2bab6d - Update cabal-hashes and add script to ease future updates
added 1 commit
- ef208584 - Update cabal-hashes and add script to ease future updates
added 2 commits
So this is a bit tricky as we don't have any easy way to ensure that the packages are called with the necessary native dependency derivations (e.g.
zlib
). We could override theversion
andsrc
attributes, but this seems exceedingly hacky and the nix logic for fetching specific package sources from Hackage is not easily available.Edited by Ben GamariFor the record, here is the problem with the current approach in a nut-shell:
# test.nix let nixpkgs = import <nixpkgs> {}; haskellPackages = nixpkgs.haskellPackages.override (old: { overrides = self: super: { zlib = super.callHackage "zlib" "0.6.2" {}; }; }); in haskellPackages
You will find that
nix build -f test.nix zlib
fails with an infinite recursion sincecallHackage
tries to passhaskellPackges.zlib
to satisfy thezlib
argument of the derivation produced bycabal2nix
. However, the argument is supposed to benixpkgs.zlib
.Edited by Ben Gamariadded 7 commits
- baeedd62 - Update cabal-hashes and add script to ease future updates
- e53f97d1 - nix: Fix infinite recursion
- 4b38c9cc - Some changes from vaibhavsagar
- b3bf1f8c - nix: Base overridden packages on correct package versions
- 418a98dc - Try something
- 01507bb1 - Another approach
- d63c861c - Revert buildHaskellPackages change
Toggle commit list