-
-
Notifications
You must be signed in to change notification settings - Fork 157
hackage2nix: add excluded-packages config option #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Spaces instead of tabs, as used everywhere.
I'm currently experimenting with this in Nixpkgs and I'm confused about something: When I remove a package that is used by others, then in some cases hackage2nix / cabal2nix behave differently than in others:
Two random examples. I excluded "caldims" = callPackage
({ mkDerivation, base, containers, directory, haskell98, mtl
, parsec, readline
}:
mkDerivation {
pname = "caldims";
version = "0.1.0";
sha256 = "0mlgxghah8mw0v17rywfj190kmc4jajpmjpgkpgfxdqzw8djyph0";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base containers directory haskell98 mtl parsec readline
];
executableHaskellDepends = [
base containers directory haskell98 mtl parsec readline
];
description = "Calculation tool and library supporting units";
license = "GPL";
hydraPlatforms = lib.platforms.none;
mainProgram = "caldims";
broken = true;
}) {haskell98 = null;}; haskell98 is passed as "accelerate-fft" = callPackage
({ mkDerivation, accelerate, accelerate-llvm
, accelerate-llvm-native, accelerate-llvm-ptx, base, bytestring
, carray, containers, cuda, cufft, fft, file-embed, hashable
, hedgehog, lens-accelerate, mtl, tasty, tasty-hedgehog
, unordered-containers
}:
mkDerivation {
pname = "accelerate-fft";
version = "1.3.0.0";
sha256 = "1a7cwzbs8r3rvaymrq2kfx83lqb3i7wz0gmz3ppz59f40rxn974x";
libraryHaskellDepends = [
accelerate accelerate-llvm accelerate-llvm-native
accelerate-llvm-ptx base bytestring carray containers cuda cufft
fft file-embed hashable lens-accelerate mtl unordered-containers
];
testHaskellDepends = [
accelerate accelerate-llvm-native accelerate-llvm-ptx base hedgehog
tasty tasty-hedgehog
];
description = "FFT using the Accelerate library";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
broken = true;
}) {lens-accelerate = null;};
Why is that? @sternenseemann any insight? |
I would need to investigate, too. Possible that this is stateful somehow. I've never really touched hackaeg2nix, but do know that it uses STM, so may be tricky behavior involved. |
So it seems like |
c3bc025
to
30a1431
Compare
30a1431
to
8f8f952
Compare
The first approach wasn't working well: Initially, I removed the excluded package from the hackage db at the very beginning. But this would lead to unexpected results later: Cabal would miss some dependencies, and thus toggle flags in a different way. This would also affect packages that were not broken, right now. For example The new approach is different: Now, I'm just writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
def :: Doc | ||
def | Set.member name $ excludedPackages config = doubleQuotes (text attr) <+> equals <+> text "null" | ||
| otherwise = hang (doubleQuotes (text attr) <+> equals <+> text "callPackage") 2 (parens (pPrint drv)) <+> (braces overrides) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it a bit confusing to define def as https://hackage-content.haskell.org/package/data-default-0.8.0.1/docs/Data-Default.html#v:def is a very widespread binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had binding
at first, but this would shadow something else already in scope.
I went with def
, because the list of these is called defs
(see a few lines down).
I could maybe just do definition
? (I assumed that's what defs
means...)
This adds a config option
excluded-packages
, which can be used in Nixpkgs to remove a big chunk of old, broken packages.WIP PR in Nixpkgs at NixOS/nixpkgs#441204.