Skip to content
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

Add haskell-ide-engine. #32947

Merged
merged 1 commit into from Dec 29, 2017
Merged

Add haskell-ide-engine. #32947

merged 1 commit into from Dec 29, 2017

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Dec 21, 2017

@shlevy shlevy requested a review from peti December 21, 2017 19:38
@shlevy
Copy link
Member Author

shlevy commented Dec 21, 2017

@Fresheyeball @imalsogreg Can you test and see if this fits the bill of your bounty?

@Fresheyeball
Copy link

@shlevy While I love you forever for putting hie into nixpkgs. That was not the issue with the bounty. This is the issue with the bounty: haskell/haskell-ide-engine#357

@shlevy
Copy link
Member Author

shlevy commented Dec 21, 2017

@Fresheyeball Yes, but if you pop haskell-ide-engine from the same package set as your package into your nix-shell env I believe this should work.

@Fresheyeball
Copy link

@shlevy ok, let me test.

peti
peti previously requested changes Dec 21, 2017
Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'd be happy if we can avoid checking the patch files into our repo, though. Is that possible?

@@ -71,4 +71,12 @@ self: super: {
# https://github.com/aristidb/aws/issues/238
aws = doJailbreak super.aws;

# There's no 8.2 testsuite
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to configuration-ghc-8.2.x.nix seem to be orthogonal to the addition of the HIE package set. Can you please submit those fixes separately (or commit them directly) to take them out of this PR for easier reviewing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# There's no 8.2 testsuite
ghc-exactprint = dontCheck super.ghc-exactprint;

# Missing FlexibleContexts in test suite
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is upstream aware of this issue? If they are, do you have a link to the upstream ticket so that we can see the current state of this bug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a ticket, thanks.

# Missing FlexibleContexts in test suite
monad-memo = dontCheck super.monad-memo;

haddock-api = super.haddock-api.override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this override specific to GHC 8.2.2? It looks like it might belong into configuration-nix.nix or configuration-common.nix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I confused myself about the order of overrides, I didn't want to overwrite the old versions uses in 7.10 and 7.8. Will fix.

@@ -0,0 +1,2 @@
args@{ pkgs, stdenv, callPackage }: self:
(import ./hackage-packages.nix args self) // (import ./hie-packages.nix args self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reverse the order of that set update to make sure that no entry in hie-packages can ever replace an entry of the same name in hackage-packages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,46 @@
diff -Naur haddock-library-1.4.4-orig/haddock-library.cabal haddock-library-1.4.4/haddock-library.cabal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those patch files maybe available for download from somewhere so that we don't have to check them into our repository?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one isn't available elsewhere. I should probably open an issue upstream, this is only needed because install doesn't work right yet with sublibraries.

@@ -0,0 +1,23 @@
commit ae0fb7a79a8912cf7a40bee418db239a7188805c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Can this file be downloaded from somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from a PR, I'll fetch it

@@ -0,0 +1,40 @@
diff --git a/test/HaRePluginSpec.hs b/test/HaRePluginSpec.hs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Can this file be downloaded from somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround, not a real fix, and doesn't exist anywhere yet.

@@ -71,4 +71,12 @@ self: super: {
# https://github.com/aristidb/aws/issues/238
aws = doJailbreak super.aws;

# There's no 8.2 testsuite
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# There's no 8.2 testsuite
ghc-exactprint = dontCheck super.ghc-exactprint;

# Missing FlexibleContexts in test suite
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a ticket, thanks.

# Missing FlexibleContexts in test suite
monad-memo = dontCheck super.monad-memo;

haddock-api = super.haddock-api.override
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I confused myself about the order of overrides, I didn't want to overwrite the old versions uses in 7.10 and 7.8. Will fix.

HaRe = self.HaRe_hie;
in
{ # This isn't really hie-specific, should probably go in cabal2nix
haddock-library_1_4_4 = callPackage
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peti What's the right way to add this to hackage-packages.nix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add it to the extra-packages section in pkgs/development/haskell-modules/configuration-hackage2nix.yaml. Then it will appear in the main package set within a couple of days (i.e. whenever I think of merging haskell-updates into master).

@@ -0,0 +1,2 @@
args@{ pkgs, stdenv, callPackage }: self:
(import ./hackage-packages.nix args self) // (import ./hie-packages.nix args self)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,46 @@
diff -Naur haddock-library-1.4.4-orig/haddock-library.cabal haddock-library-1.4.4/haddock-library.cabal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one isn't available elsewhere. I should probably open an issue upstream, this is only needed because install doesn't work right yet with sublibraries.

@@ -0,0 +1,23 @@
commit ae0fb7a79a8912cf7a40bee418db239a7188805c
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from a PR, I'll fetch it

@@ -0,0 +1,40 @@
diff --git a/test/HaRePluginSpec.hs b/test/HaRePluginSpec.hs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround, not a real fix, and doesn't exist anywhere yet.

@shlevy shlevy dismissed peti’s stale review December 22, 2017 15:14

Fixed fixable comments.

@shlevy shlevy requested a review from peti December 22, 2017 15:14
@shlevy
Copy link
Member Author

shlevy commented Dec 22, 2017

@peti good now?

@shlevy
Copy link
Member Author

shlevy commented Dec 23, 2017

This is now on top of #32993 to avoid the need to patch haddock-library

@domenkozar
Copy link
Member

@shlevy are hie-packages.nix hand-crafted?

@shlevy
Copy link
Member Author

shlevy commented Dec 24, 2017

@domenkozar Yes, though the bulk of it could be scripted pretty easily if updates become obnoxious

@vcunat
Copy link
Member

vcunat commented Dec 26, 2017

Add to the next haskell-update iteration to avoid double re-building (and re-checking)?

@shlevy
Copy link
Member Author

shlevy commented Dec 26, 2017

@vcunat I think that applies more to #32993 (which this PR is on top of) than this, but yes.

@vcunat
Copy link
Member

vcunat commented Dec 26, 2017

Right, I didn't notice a commit was from a different PR.

@peti peti self-assigned this Dec 28, 2017
Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Please feel free to merge. I have added one more minor nit that you may want to address beforhand.

# https://github.com/haskell/cabal/issues/4969
haddock-library_1_4_4 = dontHaddock
(super.haddock-library_1_4_4.override
{ # The 'attoparsec' haddock-library depends on is its own
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue is fixed in 40a3d77. cabal2nix-1.7.1 no longer generates the bogus dependency.

@michalrus
Copy link
Member

Silly question: will this handle Cabal@Nix projects, too? 😻 I.e. the Nix (not NixOS) part in haskell/haskell-ide-engine#357.

@shlevy
Copy link
Member Author

shlevy commented Dec 29, 2017

@michalrus I don't really understand what you mean by Cabal@Nix projects, but the point of this PR was to address that issue 😄 . The idea is that your nix-shell (or nix-buffer, or whatever) env will include haskell-ide-engine from the same package set as your actual project, so you know it matches.

@shlevy shlevy merged commit 961907d into NixOS:master Dec 29, 2017
@michalrus
Copy link
Member

Pure Cabal projects with deps managed by Nix. =]

Awesome, so it should just work. ♥

Thank you! ♥ ♥

Finally I can get rid of Intero and those hacks, which are ±useless, cf. michalrus/intero-nix-shim#7.

@peti
Copy link
Member

peti commented Dec 30, 2017

haskell-ide-engine does not compile because the following dependency fails: https://hydra.nixos.org/build/66889657

@imalsogreg
Copy link
Contributor

@shlevy I'm seeing

...
building path(s) ‘/nix/store/gbi2cwqamac15insqhb8yzl338bwmzk0-haddock-api-2.18.1’, ‘/nix/store/gwq9pbhfq9z5349zyakb2bn7x5pcjf80-haddock-api-2.18.1-data’, ‘/nix/store/vcj4h08c41yasfdhxh4i92as1r8jmal0-haddock-api-2.18.1-doc’
setupCompilerEnvironmentPhase
Build with /nix/store/3b1axvsyr53f4f5nihvpxv3p4hskb3j7-ghc-8.2.2.
ln: failed to create symbolic link '/nix/store/gbi2cwqamac15insqhb8yzl338bwmzk0-haddock-api-2.18.1/lib/links/libHShaddock-library-1.4.4-BXedb9tEAJEKpUW5xu3aRK-attoparsec-ghc8.2.2.dylib': File exists
ln: failed to create symbolic link '/nix/store/gbi2cwqamac15insqhb8yzl338bwmzk0-haddock-api-2.18.1/lib/links/libHShaddock-library-1.4.4-G8iPfxLjJ1KJncaQAcQooZ-ghc8.2.2.dylib': File exists
builder for ‘/nix/store/zjq2bjsnvn6mg50izlnav0mkwjg6m93y-haddock-api-2.18.1.drv’ failed with exit code 1
building path(s) ‘/nix/store/9wcrbw3w1dgmy0g209jxs3adfykmi2fm-happy-1.19.8’, ‘/nix/store/x7adjlzcz42dhmzw60ixf9m7s84lwjvy-happy-1.19.8-doc’
cannot build derivation ‘/nix/store/ksb034msgmaq1pcbayij0vw4ny0gmdhl-hie-haddock-0.1.0.0.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/8jw9zx2l5id8lfgcg563w54mv8dvgzk0-haskell-ide-engine-0.1.0.0.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/8jw9zx2l5id8lfgcg563w54mv8dvgzk0-haskell-ide-engine-0.1.0.0.drv’ failed

(nix-env -f ~/nixpkgs -iA haskellPackages.haskell-ide-engine -j1) on macos.

@shlevy
Copy link
Member Author

shlevy commented Jan 1, 2018

@peti This works as of 89e882f . Testing on latest master now.

@shlevy
Copy link
Member Author

shlevy commented Jan 1, 2018

@Ericson2314 any idea about the issue @imalsogreg is seeing? Seems to have something to do with the dynamic loading stuff on darwin.

@shlevy
Copy link
Member Author

shlevy commented Jan 1, 2018

@peti Ah, this is due to the lts bump. Will take a look soon.

@Ericson2314
Copy link
Member

@shelvy I think that's a Darwin impurity from previous runs.

@shlevy
Copy link
Member Author

shlevy commented Jan 1, 2018

@Ericson2314 ? What impure dir is being referenced there?

@Ericson2314
Copy link
Member

@shlevy this sounds to be true, but I swear this hit this when working on the darwin dynamic linking stuff. The previous attempt earlier in the build (say preConfigure) would but a a bunch of symlinks in there to avoid using as many RPATHs`. If the first build failed then on the second attempt it would fail because for some reason $out wasn't cleaned out and the symlinks would still be there.

@shlevy
Copy link
Member Author

shlevy commented Jan 2, 2018

@Ericson2314 That would be a huge bug in nix if true...

@shlevy
Copy link
Member Author

shlevy commented Jan 2, 2018

@imalsogreg I think it should be fixed in #33333

@shlevy
Copy link
Member Author

shlevy commented Jan 2, 2018

(but there's still the hoogle issue to fix 😄 )

@imalsogreg
Copy link
Contributor

@shlevy @Ericson2314 Looking at the error message from cabal trying to solve version constraints, I tried (a) patching hoogle 5.0.15 to accept haskell-src-exts_1_19_1 and (b) dropping the nixpkgs override that sets haskell-src-exts to 1.20.1.

This worked on my ubuntu machine. But the patch to hoogle introduces some ugly CPP to allow the newest hoogle to support both haskell-src-exts versions. So I'm wondering, is there another way to support hie-hoogle here?

@shlevy
Copy link
Member Author

shlevy commented Jan 2, 2018

@imalsogreg I'll fix that side of things in a later PR.

@imalsogreg
Copy link
Contributor

@shlevy making sure I understand: I should not try to get the hoogle patch (which loosens its haskell-src-exts deps to include 1.19.1) merged?

@shlevy
Copy link
Member Author

shlevy commented Jan 3, 2018

Oh, if you can get it merged upstream that'd also be good.

@shlevy
Copy link
Member Author

shlevy commented Jan 3, 2018

@imalsogreg should be fixed in 707cfbf

@peti
Copy link
Member

peti commented Jan 18, 2018

@shlevy, according to https://hydra.nixos.org/job/nixpkgs/haskell-updates/haskellPackages.haskell-ide-engine.x86_64-linux/all, the package hasn't seen a successful build yet, apparently because the test suite assumes network access. Would you mind taking a look at that issue?

@shlevy
Copy link
Member Author

shlevy commented Jan 18, 2018

f12f2ed

@michalrus
Copy link
Member

michalrus commented Jan 22, 2018

Hmm, I can’t build it on current unstable, 5402412:

Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package ghc-mod-core (ghc-mod-core-5.9.0.0) requires haskell-src-exts-1.19.1-GkJUFo8Rp3b1KlAdoTXU6c
      package hlint (hlint-2.0.15-DnfSXCOnlvhJh25E4Cb1Bg) requires haskell-src-exts-1.20.1-835K5nW7Qg0K3DUFrUYhiW
      package haskell-src-exts-util (haskell-src-exts-util-0.2.1.2-4UhAxVuyQajDfxD9gJGXOC) requires haskell-src-exts-1.20.1-835K5nW7Qg0K3DUFrUYhiW

*** abort because of serious configure-time warning from Cabal
builder for ‘/nix/store/bkry8lqkj605av0ybmi1qismb42h5j4w-ghc-mod-core-5.9.0.0.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/mk2i2g7lgg4f7lwpf0m1jbr2idv282f8-haskell-ide-engine-0.1.0.0.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/mk2i2g7lgg4f7lwpf0m1jbr2idv282f8-haskell-ide-engine-0.1.0.0.drv’ failed

@michalrus
Copy link
Member

@shlevy ^

@shlevy
Copy link
Member Author

shlevy commented Jan 24, 2018

I'll work on this but I'm not sure when I'll have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants