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

haskellngPackages.idris standard libraries are missing from the derivation #7014

Closed
ocharles opened this issue Mar 26, 2015 · 14 comments
Closed

Comments

@ocharles
Copy link
Contributor

The Idris team specifically want to keep the bounds as they are - I'm not sure how Haskell ng would solve this problem.

@peti
Copy link
Member

peti commented Mar 27, 2015

Well, I guess we could keep the old versions around just so that Idris can compile. It sucks that this is necessary, though. 😲

@ocharles
Copy link
Contributor Author

They are happy to increase the bounds, but my understanding is they want more than just "it compiles", but more "it has been tested and shown to work".

@peti
Copy link
Member

peti commented Mar 27, 2015

Personally, I don't know much about Idris, so take my opinions on this matter with a gain of salt, but I reckon that making it compile is the first step to getting the code tested. If people cannot build Idris with recent version of its dependencies, how are they going to discover whether it works or not?

Anyway, I'll add the missing version of blaze and friends so that we can build the current version in Nix.

@peti peti self-assigned this Mar 27, 2015
@copumpkin
Copy link
Member

Automated tests > fallible humans. Even better are real Idris packages building against a nice Idris builder that uses the Idris package 😄

I think @puffnfresh was working on such a thing at some point.

peti added a commit to NixOS/cabal2nix that referenced this issue Mar 31, 2015
@peti peti closed this as completed in 6644bca Mar 31, 2015
peti added a commit to NixOS/cabal2nix that referenced this issue Apr 2, 2015
@falsifian
Copy link
Contributor

Now Idris builds but doesn't work properly

$ result/bin/idris
Can't find import Builtins
Can't find import Prelude

(I'm at b3f76d6.)

FWIW, Idris installed using cabal-install works.

@falsifian falsifian reopened this Apr 5, 2015
@puffnfresh
Copy link
Contributor

https://github.com/idris-hackers/idrispkgs

@falsifian I had that problem upgrading Idris in that repo recently. No idea what changed in the build process to make that happen 😭

@puffnfresh
Copy link
Contributor

I know the problem though: for some reason the Haskell/Cabal + Nix build doesn't copy across the library directories which are meant to go into share/x86_64-linux-ghc-7.8.4/idris-0.9.17. Some directories do get copied over, such as idrisdoc and rts. It's just not the libraries.

😿

@peti
Copy link
Member

peti commented Apr 8, 2015

Is it possible that Idris can't deal with being installed by cabal copy && cabal register rather than cabal install? Maybe they have some custom Setup.hs code that doesn't work in that case?

@peti peti changed the title haskellngPackages.idris is broken haskellngPackages.idris standard libraries are missing from the derivation Apr 8, 2015
@falsifian
Copy link
Contributor

Their https://github.com/idris-lang/Idris-dev/blob/master/Setup.hs seems to have generalized code intended to handle both cabal install and cabal copy.

Attempting to ping @david-christiansen (random contributor to Idris's Setup.hs, but GitHub isn't auto-completing it) --- nix-specific stuff aside, does this problem of libraries not being copied over look familiar?

@puffnfresh
Copy link
Contributor

I did a diff between the versions of Setup.hs:

@@ -57,6 +57,13 @@ usesGMP flags =
     Just False -> False
     Nothing -> True

+execOnly :: S.ConfigFlags -> Bool
+execOnly flags =
+  case lookup (FlagName "execonly") (S.configConfigurationsFlags flags) of
+    Just True -> True
+    Just False -> False
+    Nothing -> True
+
 isRelease :: S.ConfigFlags -> Bool
 isRelease flags =
     case lookup (FlagName "release") (S.configConfigurationsFlags flags) of
 @@ -106,7 +113,7 @@ generateVersionModule verbosity dir release = do
                                   "gitHash :: String\n" ++
                                   if release
                                     then "gitHash = \"\"\n"
-                                    else "gitHash = \"-git:" ++ h ++ "\"\n"
+                                    else "gitHash = \"git:" ++ h ++ "\"\n"

 -- Generate a module that contains the lib path for a freestanding Idris
 generateTargetModule verbosity dir targetDir = do
 @@ -176,7 +183,7 @@ getVersion args flags = do
       let buildinfo = (emptyBuildInfo { cppOptions = ["-DVERSION="++hash] }) :: BuildInfo
       return (Just buildinfo, [])

-idrisBuild _ flags _ local = do
+idrisBuild _ flags _ local = unless (execOnly (configFlags local)) $ do
       buildStdLib
       buildRTS
    where
 @@ -199,7 +206,7 @@ idrisBuild _ flags _ local = do
 -- -----------------------------------------------------------------------------
 -- Copy/Install

-idrisInstall verbosity copy pkg local = do
+idrisInstall verbosity copy pkg local = unless (execOnly (configFlags local)) $ do
       installStdLib
       installRTS
    where

So a condition for installing the stdlib has been added. This must have broken the Nix build somehow.

@puffnfresh
Copy link
Contributor

@david-christiansen should that condition for Nothing be False instead of True?

@puffnfresh
Copy link
Contributor

Success!

$ /nix/store/ibd81ivwxwswwz7y1z43vgv5zb16pq7w-haskell-idris-ghc7.8.4-0.9.17-shared/bin/idris  
     ____    __     _                                          
    /  _/___/ /____(_)____                                     
    / // __  / ___/ / ___/     Version 0.9.17-git:PRE
  _/ // /_/ / /  / (__  )      http://www.idris-lang.org/      
 /___/\__,_/_/  /_/____/       Type :? for help               

Idris is free software with ABSOLUTELY NO WARRANTY.            
For details type :warranty.
Idris>

@falsifian
Copy link
Contributor

Awesome; thanks! So does Haskellng get updated all at once to hackage latest whenever someone runs a script?

@peti
Copy link
Member

peti commented Apr 14, 2015

@falsifian, I regularly update the Haskell NG package set. Once the Idris team releases a new version with the fix, we'll have it shortly after.

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

No branches or pull requests

5 participants