-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
haskellPackages: unbreak bson and mongoDB #122428
Conversation
cc @peti |
@@ -1898,4 +1898,19 @@ EOT | |||
}) | |||
]; | |||
|
|||
bson = overrideCabal super.bson (drv: { | |||
# We replace 'network' by 'network-bsd' because cabal2nix cannot correctly that pick up. |
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.
# We replace 'network' by 'network-bsd' because cabal2nix cannot correctly that pick up. | |
# We replace 'network' by 'network-bsd' because cabal2nix cannot correctly pick that up. |
How is it possible that the cabal file does not declare the correct package name? |
@maralorn https://github.com/mongodb-haskell/bson/blob/d8e70185fb34a9e92aa98f17bf6a8c6bc1dc651d/bson.cabal#L40-L45 have a look here, a flag is used to choose between two packages and it looks like |
Oh I just noticed that this flag is on by default: https://github.com/mongodb-haskell/bson/blob/d8e70185fb34a9e92aa98f17bf6a8c6bc1dc651d/bson.cabal#L28 Maybe if I just set the flag differently, |
|
Yes but that doesn't fix the dependencies. I'd want to set this flag when |
https://github.com/NixOS/cabal2nix/blob/e18310f2eae5d2d7b73512b0b75396224fbf76ca/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs#L83 Does it need to be added in here? |
We could also just apply this patch instead: aske/bson@288cfac |
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 think this should go into configure-nix.nix
. I don't think we'll get rid of this in the near future since it'd require us to implement some generation-time configuration mechanism for hackage2nix
.
bson = overrideCabal super.bson (drv: { | ||
# We replace 'network' by 'network-bsd' because cabal2nix cannot correctly that pick up. | ||
libraryHaskellDepends = with pkgs.haskellPackages; [ | ||
base | ||
binary | ||
bytestring | ||
cryptohash-md5 | ||
data-binary-ieee754 | ||
mtl | ||
network-bsd # network-bsd AND NOT network | ||
text | ||
time | ||
]; | ||
}); |
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.
This should be much simpler and not require us to maintain a list of dependencies
bson = overrideCabal super.bson (drv: { | |
# We replace 'network' by 'network-bsd' because cabal2nix cannot correctly that pick up. | |
libraryHaskellDepends = with pkgs.haskellPackages; [ | |
base | |
binary | |
bytestring | |
cryptohash-md5 | |
data-binary-ieee754 | |
mtl | |
network-bsd # network-bsd AND NOT network | |
text | |
time | |
]; | |
}); | |
bson = appendConfigureFlag (super.bson.override { network = self.network-bsd; }) "-f-_old_network"; |
This won't work I'm afraid since the patch is only applied after we already resolve the dependencies. We should ask upstream to release a new version or update the cabal file on hackage though. |
@sternenseemann I already made this: mongodb-haskell/bson#26 |
@sternenseemann what can we do in the meantime? |
Done in 978f8b381f2eb0900d27b0e6ae52e919695b8fc6. |
@sternenseemann |
Yeah, it is! We've reworked how this works in haskellPackages, so it does evaluate again and we'll do an automatic sweep to make it being built by hydra again. |
Motivation for this change
Unbreaking
bson
andmongoDB
.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Questions:
network
/network-bsd
dependency flag is not picked up correctly. Is this the correct place to fix it?network
bynetwork-bsd
than to re-enumerate all the dependencies and omitnetwork
?