dhall-lang / dhall-nix

This repository has moved to https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix
BSD 3-Clause "New" or "Revised" License
89 stars 4 forks source link

Update to dhall > 1.19 #19

Closed Profpatsch closed 5 years ago

Profpatsch commented 5 years ago

Some things have changed in the dhall expression tree:

Additionally, dhall switched to an internal Map module instead of HashMap.Strict.InsOrd.

I haven’t found any instructions on how the dhall.nix files are generated, I used my own overrides to work on this. Probably something with cabal2nix, but its usage is not at all clear to me (and the errors it throws unhelpful).

Gabriella439 commented 5 years ago

@Profpatsch: How were you able to build this? I ran into this same issue: https://github.com/haskell-nix/hnix/issues/493

Profpatsch commented 5 years ago

I built against the last hnix version:

        these = hlib.doJailbreak hsuper.these;

        hnix = hlib.overrideCabal
          (hsuper.hnix.override {
            inherit (hself) these;
          }) (old: {
          src = fetchFromGitHub {
            owner = "haskell-nix";
            repo = "hnix";
            rev = "e7efbb4f0624e86109acd818942c8cd18a7d9d3d";
            sha256 = "0dismb9vl5fxynasc2kv5baqyzp6gpyybmd5p9g1hlcq3p7pfi24";
          };
          buildDepends = old.buildDepends or [] ++ (with hself; [
            dependent-sum prettyprinter (hlib.doJailbreak ref-tf)
          ]);
        });

        dhall-nix = hlib.overrideCabal hsuper.dhall-nix (old: {
          src = fetchFromGitHub {
            owner = "Profpatsch";
            repo = "dhall-nix";
            rev = "update-to-dhall-0.21";
            sha256 = "1kdsbnj681lf65dsdclcrzj4cab1hh0v22n2140386zvwmawyp6r";
          };
          broken = false;
        });
Profpatsch commented 5 years ago

So there might be a few changes we need to take care of once the newest hnix builds.

Profpatsch commented 5 years ago

Here’s a patch that should get current hnix working: https://github.com/haskell-nix/hnix/pull/486

Gabriella439 commented 5 years ago

@Profpatsch: Sorry for the delay, but I had to make a few changes to get the Nix build working because hnix is very picky about its dependencies. I put up a pull request against your branch: https://github.com/Profpatsch/dhall-nix/pull/1

If you merge that into your branch then I think CI should pass or be pretty close.

Profpatsch commented 5 years ago

How did you generate the dependency files?

Gabriella439 commented 5 years ago

@Profpatsch: The old-fashioned way, using cabal2nix. Any time there was a bounds failure I would either disable a test suite or update a package to the latest version

Profpatsch commented 5 years ago

using cabal2nix

How did you invoke cabal2nix? I couldn’t figure it out trying more than five minutes.

Gabriella439 commented 5 years ago
$ cabal2nix cabal://${PACKAGE_NAME} > nix/${PACKAGE_NAME}.nix

I also made a change to automatically apply any overrides found in the ./nix directory by using pkgs.haskell.lib.packagesFromDirectory here:

https://github.com/dhall-lang/dhall-nix/blob/cbb9805e7336e4394c080d549294eae4bfd28787/release.nix#L84