cdepillabout / nix-reverse-deps-of-haskell-package

Find or build all reverse dependencies of a Haskell package using Nix
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

Jailbreaking #6

Closed idontgetoutmuch closed 4 years ago

idontgetoutmuch commented 4 years ago

The reason most packages are breaking is because of upper bounds restrictions. I've tried jailbreaking in various ways but to no avail.

  allReverseDepsEnv =
    buildEnv {
      name = "all-reverse-dependencies-of-${reverseDepsOf}-env";
      # paths = reverseDepsList;
      # paths = [ (nixpkgs.haskell.lib.doJailbreak (builtins.head reverseDepsList))
      #           (nixpkgs.haskell.lib.doJailbreak (builtins.head (builtins.tail reverseDepsList))) ];
      paths = [ (haskell.lib.doJailbreak haskellPackages.splitmix) ];
      # paths = [ haskellPackages.splitmix ];
      # paths = [ nixpkgs.haskell.lib.doJailbreak (builtins.head reverseDepsList) ];
    };
idontgetoutmuch commented 4 years ago

OTOH this seems to be working (I bodged the version number):

paths = builtins.map haskell.lib.dontHaddock (builtins.map haskell.lib.dontCheck reverseDepsList);
idontgetoutmuch commented 4 years ago

Spoke too soon - it seems that QuickCheck is getting built with tests :( and at the moment this does not fail but sits there doing nothing. I am guessing I need to somehow get a fixed point but my nix-fu is not good enough to do this.

idontgetoutmuch commented 4 years ago
cinimod`: it's going to be a bit harder than that, because each of those reverse deps is going to pull its dependencies from the package set, not from the list so even if quickcheck built from that list isn't tested, if anything in there depends on QuickCheck, nix will build another quickcheck that will be
idontgetoutmuch commented 4 years ago
<blackriversoftwa> cinimod`: It's been a while since I used the nixpkgs
         haskell infrastructure, but you probably need to apply an
         overlay to the package set and override the haskell stdenv to
         set dontCheck and dontHaddock true
<blackriversoftwa> trying to do it per package and also for dependencies would
         be very tricky
<cinimod`> blackriversoftwa: agreed but I somehow thought nix would find the
       fixed point for me                           [16:13]
<blackriversoftwa> cinimod`: yes if you made an overlay for the
         haskellPackages set (not an overlay for nixpkgs, you need to
         apply an overlay to haskellPackages specifically) that
         overrode every package                     [16:14]
<blackriversoftwa> cinimod`: but easier to just do an overlay that overwrites
         the build options all of them start with
<clever> you can use a haskell overlay to mutate the mkDerivation function
                                        [16:15]
<clever> which every haskell package uses

<blackriversoftwa> clever: thanks that is what I was trying to remember cc
         cinimod`
* cinimod` goes to ponder "you can use a haskell overlay to mutate the
  mkDerivation function"                            [16:16]
<clever> cinimod`:
     https://github.com/input-output-hk/cardano-sl/blob/2.0.0/nix/overlays/debug.nix
                                        [16:18]
<clever> cinimod`:
     https://github.com/input-output-hk/cardano-sl/blob/2.0.0/nix/overlays/dont-check.nix
                                        [16:19]
<clever> cinimod`: multiple overlays can stack in a sane manner, and other
     examples exist in the same dir

<blackriversoftwa> clever: can you post a reminder of how to apply overlays to
         e.g. haskellPackages rather than to the global pkgs?
                                        [16:21]
<clever> blackriversoftwa:
     https://github.com/input-output-hk/cardano-sl/blob/2.0.0/nix/haskell-packages.nix#L32-L41
<clever> blackriversoftwa: cardaniPkgsBase in this context, can just be
     replaced with pkgs.haskellPackages                 [16:22]
<cinimod`> clever blackriversoftwa: I already have one Haskell overlay

<clever> cinimod`: the example i linked shows how to apply many at once
<blackriversoftwa> the .extend is the bit I was missing             [16:23]
<clever> pkgs.extend and pkgs.linuxPackages.extend also exist
<cinimod`> :thumbsup:
cdepillabout commented 4 years ago

@idontgetoutmuch I'm having a little bit of trouble figuring out what you are trying to accomplish.

Are you trying to turn off haddocks and tests for all the derivations in the Haskell package set?

There's an example in the nixpkgs manual that explains how to do something similar, in the section entitled "How to build with profiling enabled":

https://nixos.org/nixpkgs/manual/#miscellaneous-topics

Instead of setting enableLibraryProfiling = true, you'd probably use doCheck = false and doHaddock = false.

If you can't figure out how to get this working with your own code, let me know and I'll try to come up with a simple example.

idontgetoutmuch commented 4 years ago

@cdepillabout apologies for not being clearer - I think I was sidetracked by the suggestion of using overlays. What you pointed me at was exactly what I needed. I now have a list of packages that will be broken by our proposal.

cdepillabout commented 4 years ago

@idontgetoutmuch Glad you got it working, and good luck with the random improvements!