-
-
Notifications
You must be signed in to change notification settings - Fork 389
ghcide often fails to build project under nixos, where cabal succeeds. #922
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
Comments
I have run into the first error and it's because you have built a package against a different version of glibc than the one you are currently using. This can arise because cabal doesn't take the glibc version into account when creating the package hash (because it's not nix). You need to ensure that the same glibc version is used to build ghc, ghcide and all your packages. The second error is usually because you have a GHC version mismatch between the ghcide version and your project version. |
Thanks for the quick reply!
So throwing away my
I wonder how this can happen. It worked just the other day and everything is and was ghc 8.6.5 … |
@maralorn If you are getting your ghcide from haskell.nix and ghc form normal nixpkgs then the glibc version could be different which will cause carnage. Without further information about the second issue it is impossible to debug. On my branch ghcide prints out the options that it is using which would be useful to provide but the master version doesn't so not sure we can make progress. |
Well this sounds like all my problems stem from the same source. ghcide not being installed the same way as the rest. Maybe the best idea would be to find a nixpkgs overlay which succesfully unbreaks the ghcide build there, like I did for obelisk. |
Okay, with my overlay to just compile ghcide with the normal nixpkgs infrastructure it works. So (to make this issue really off-topic). What do you think about me upstreaming that overlay so that we have a working ghcide in nixpkgs? |
Is there an issue installing ghcide from |
Yes, at least according to my sampling there was never a time when let
overrides = ghc: _: {
haddock-library = pkgs.haskell.lib.dontCheck
(ghc.callHackage "haddock-library" "1.8.0" { });
haskell-lsp = ghc.callHackage "haskell-lsp" "0.19.0.0" { };
haskell-lsp-types = ghc.callHackage "haskell-lsp-types" "0.19.0.0" { };
regex-posix = ghc.callHackage "regex-posix" "0.96.0.0" { };
test-framework = pkgs.haskell.lib.dontCheck
(ghc.callHackage "test-framework" "0.8.2.0" { });
regex-base = ghc.callHackage "regex-base" "0.94.0.0" { };
regex-tdfa = ghc.callHackage "regex-tdfa" "1.3.1.0" { };
shake =
pkgs.haskell.lib.dontCheck (ghc.callHackage "shake" "0.18.4" { });
hie-bios = pkgs.haskell.lib.dontCheck (ghc.callHackageDirect {
pkg = "hie-bios";
ver = "0.4.0";
sha256 = "19lpg9ymd9656cy17vna8wr1hvzfal94gpm2d3xpnw1d5qr37z7x";
} { });
ghcide = pkgs.haskell.lib.dontCheck (ghc.callHackageDirect {
pkg = "ghcide";
ver = "0.1.0";
sha256 = "0vwaaqb74dzsvx5xdfkzbi8zzvbd5w9l1wdhl3rhvi8ibnrchgfs";
} { });
};
in (haskellPackages.override { inherit overrides; }).ghcide But I will have a look at fixing it in nixpkgs. |
Just a quick takeaway for this issue. When the documentation says that you need to compile I’d advise against using Compiling Dear people from the future finding this issue: Please note, that those overrides are working as of now for |
Just a heads-up:
away from working. (Or better add it to your Note that it‘s the version for ghc 8.6.5. Which is the current ghc on nixpkgs stable. nixpkgs-unstable is broken right now, but the fix for ghcide is already merged there. So there you can get a @mpickering Would you think a PR explaining the caveats and install instructions comparing ghcide-nix and plain nixpkgs in the README is a good idea? |
@maralorn Sounds like a good idea to me. It is much easier to run into these obscure problems with NixOS than other operating systems. |
Ghcide really should be installed via a `shell.nix` along with the project because it needs to be build with the same version of GHC and share the same glibc etc. see: https://github.com/digital-asset/ghcide/issues/538
Thanks for sharing the fix! This was driving me nuts. I was getting ready to nerd rage table flip. |
So I am not sure if this is a bug report or just a question. My setup is the following:
Now running 'cabal build' works completely fine using all dependencies as provided by the nix-shell. It just needs to compile my project.
Running
ghcide
I got various different problems like linking problems which I sometimes can solve by throwing away the cabal cache or other desperate (and terribly stateful) measures like that.As a matter of fact my error message changed while writing this bug report and I don‘t know why. /o\
So error 1:
error 2:
Since the exact solution to my problems are probably out of scope I have two concrete questions:
What are the general reasons that
cabal build
works just fine butghcide
fails to build the dependencies? Shouldn‘t the hie-bios setup lead to them doing exactly the same?(I fear this is actually a bit out of scope here.) I often get error messages from
ghcide
which say(use -v for more information)
. Any chance to actually do that? Passing it toghcide
does obviously not work.Thank you so much for ghcide, I love programing with it. That‘s why I get so desperate when it doesn‘t work …
The text was updated successfully, but these errors were encountered: