Issues with the cabal template
Ptival opened this issue ยท 8 comments
I'm trying to copy the templates into a real (yet simple) project, but they seem quite weird.
Is it normal that they complain about the cabal index being 19000 days old? (I'm assuming timestamp 0?)
Is it normal that when you run cabal update
you get:
newParallelJobControl: not a sensible number of jobs: 0
CallStack (from HasCallStack):
error, called at ./Distribution/Client/JobControl.hs:101:3 in main:Distribution.Client.JobControl
And for some reason when I run hie for my project, it wants Cabal 3.2.0.0, but the installed one is 3.0.1.0.
I've tried:
pkg-def-extras = [
(hackage: {
packages = {
"Cabal" = (((hackage.Cabal)."3.2.0.0").revisions).default;
};
})
];
but that seemed to do nothing.
Any idea how I can get the right Cabal lib for my cabal?
I guess you're trying the haskell.nix Cabal template? Yeah the templates are a bit special in order to get Cabal 3.2.0.0 in the environment. To get this to work I had to put this in the cabal file: https://github.com/Infinisil/all-hies/blob/b8fb659620b99b4a393922abaa03a1695e2ca64d/templates/haskell.nix-cabal/all-hies-template.cabal#L19-L21
but this is also necessary: https://github.com/Infinisil/all-hies/blob/b8fb659620b99b4a393922abaa03a1695e2ca64d/templates/haskell.nix-cabal/default.nix#L33-L36
If you know of a better way let me know, because this is not very nice!
Regarding the cabal update
, not sure why it fails, but you don't need to run that command at all, since all dependencies are specified with Nix. To "update" the index you'd update haskell.nix here: https://github.com/Infinisil/all-hies/blob/b8fb659620b99b4a393922abaa03a1695e2ca64d/templates/haskell.nix-cabal/default.nix#L2-L5
And the message about too old of an index shouldn't trigger if you use exactDeps
like here: https://github.com/Infinisil/all-hies/blob/b8fb659620b99b4a393922abaa03a1695e2ca64d/templates/haskell.nix-cabal/default.nix#L41
Thanks this helped!
And with this new setup, should we be calling raw hie
? (since there does not seem to be a hie-wrapper)
I keep getting segmentation faults.
There should be a hie-wrapper
too (an alias to just hie
), or does that not work?
Segmentation faults for what?
It's hard to know given the multi-threaded nature of what's going on...
Here's one log for instance:
http://paste.awesom.eu/lwO3
The GHC panic is probably meaningful?
As for hie-wrapper
, when I go in haskell.nix-cabal
, I don't get it in my PATH (only hie
).
Ah! I must have lost the hie-wrapper
link change when I was rebasing the PR. I just pushed 09ba836 to fix this, hie-wrapper should be available again with that.
I'm afraid I have no idea about the segfault. Does it not happen in the template project? If it doesn't, you could bisect between the template and your own project to figure out the problem. I'd try deleting caches as well (~/.cache/cabal-helper
and ~/.cabal
)
I should have news soon, ping me again if I don't follow up in the next couple days!
(Note: I had tried deleting .cache/cabal-helper, but not .cabal, and I was also seeing segfaults in HLS, so I'm thinking there might have been trouble in my .cabal)
My remaining trouble went away with purging .cabal
.