Conversation
This adds a new `haskell.lib.combineInputs` function which encapsulates the logic used by `haskellPackages.shellFor` to compute package dependencies.
879a610 to
223c859
Compare
|
Before having looked into it in detail I can say that I like this very much. I don’t remember the exact details but I remember doing dirty things like applying head to |
|
Glad to hear it! It's not causing any rebuilds and the tests pass, so I'm pretty confident it's equivalent. |
There was a problem hiding this comment.
Great PR, thank you. Although after staring at it for a while I am a bit blurry on the motivation. What is this function useful for besides using it in shellFor? (I know this kinda contradicts my previous comment.)
I left a few comments before I realized you were just pasting code. Feel free to dismiss.
Bonus points for documenting the function in the manual.
| # } | ||
| # ... | ||
| # ] | ||
| cabalDepsForSelected = builtins.map (p: p.getCabalDeps) (builtins.filter (p: p != null) packages); |
There was a problem hiding this comment.
Theoretically could use lib.pipe, not sure if better.
| # | ||
| # isNotSelected lens [ frontend backend common ] | ||
| # => true | ||
| isNotSelected = input: pkgs.lib.all (p: input.outPath or null != p.outPath) packages; |
There was a problem hiding this comment.
I think lib is in scope.
| isNotSelected = input: pkgs.lib.all (p: input.outPath or null != p.outPath) packages; | |
| isNotSelected = input: lib.all (p: input.outPath or null != p.outPath) packages; |
| # `backend`, then zipperCombinedPkgs needs to be careful to filter out | ||
| # `common`, because cabal will end up ignoring that built version, | ||
| # assuming new-style commands. | ||
| zipperCombinedPkgs = vals: pkgs.lib.concatMap (drvList: pkgs.lib.filter isNotSelected drvList) vals; |
There was a problem hiding this comment.
This function name seems weird to me. 😆
|
Uh, @9999years , don't you want this merged anymore? I was just waiting for some reaction on my feedback. Didn't mean to discourage you. |
|
@maralorn I don't have a compelling use-case for this at the moment, but feel free to push it over the line if you're interested in it. |
This adds a new
haskell.lib.combineInputsfunction which encapsulates the logic used byhaskellPackages.shellForto compute package dependencies.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.