Closed mgttlinger closed 6 years ago
Ok, so it requires htoml-megaparsec-2.0.0.1
but the nix build chooses to use htoml-megaparsec-1.1.0.1
The unstable
channel has the correct version of the dependency but it is not obvious to me how to switch the build to unstable.
Thanks for raising! Yup, htoml-megaparsec-2.0.0.1
is the required version. It is specified in the extra-deps
of the stack.yaml file, but I remember something about nix not using that. Curiously enough it worked without a hitch on CI and on my linux machine. I'll have to talk to my more nix-knowledged friends to understand how it chooses its versions.
By the way, feel free to chime in if you have opinions about pinning the nix version or any other ideas that would make this more robust.
I don't think there is a way to do that in your current build setup.
To elaborate on how it chooses the version:
Nix generally has one version in the channel that is the version and given that the names of the specific version derivations might differ cabal2nix
uses the standard version and ignores the version constraints.
I apologize for my lack of nix knowledge. I didn't use cabal2nix
. Here's how you could help me:
nix-build
?Funnily enough my nix-build seems to use htoml-megaparsec-2.0.0.0
.
You do use cabal2Nix
: https://github.com/2mol/pboy/blob/master/pboy.nix#L8
nix-build
(at least the interesting part of it).nixos-18.03
stable channel and I would guess you use the unstable
one. You can check that with nix-channel --list
(You might need to run that with sudo
depending if you have those channels user specific or global).Oh, oops, sorry for the misinformation, that's what I get for taking credit for my friend's work :)
Yes, turns out I am using the unstable channel! I'm surprised that was the default.
What you can do in the meantime is check out the commit just before I updated to that new version, so 01737076826ca8f6fb997666e78f5baf4fca7145
I think many people use the unstable channel to have the bleeding edge of versions.
I think I will just build with stack --nix
until the stable channel advances.
It will work now, if you want to test it, you can either pull the latest dev branch and try a nix-build
, or do
nix-env -if https://github.com/2mol/pboy/tarball/dev
Let me know if it works for you. Cheers.
Ok, so master
obviously still fails to build with nix but I tested your changes in dev
and they build and install successfully.
So your fix is basically to pull a different nix package tree for your build?
Great to hear! Yes, so basically it fixes the nixpkgs
to be a specific commit in NixOS/nixpkgs
.
I'll close this as soon as I merge dev into master then. Thanks for testing!
You're welcome. Thanks for fixing!
fixed by e56c0076ff2adad8ed34cdf5a9e029b5e65fbb2b
The current master 36e76b4 fails to compile with nix
I suspect that a wrong version of
htoml-megaparsec
gets used but it is not clear to me which is the intended version.