GrammaticalFramework / GF

Archive of monolithic GF repository until 2018-07-25
http://www.grammaticalframework.org/
Other
189 stars 51 forks source link

GF as additional source in Cabal sandbox gives error about sdist #26

Open johnjcamilleri opened 6 years ago

johnjcamilleri commented 6 years ago

I use a Cabal sandbox for my project, which requires the PGF library. I want to use my local copy of the GF repo, not the release from Hackage. So I do the following:

$ cabal sandbox init
$ cabal sandbox add-source path/to/GF
$ cabal install GF

This works. But now I'm not able to install anything else from Hackage into my sandbox:

$ cabal install text
setup: Error: Use `make sdist` to create the source distribution file

This message comes from Setup.hs:190. I try make sdist in the GF repo, but get:

Unable to "darcs dist" here.
You need to be in a repository directory to run this command.

Which makes sense this is no longer a darcs repository. I also tried replacing line 190 with this:

sdistError _ _ _ _ = return ()

But then I get this:

$ cabal install text
Warning: Could not list sources of the package 'gf'.
Warning: Exception was:
/var/folders/j9/5l774vxs023cxbhq548sg8g80000gn/T/cabal-list-sources.-32306/cabal-sdist-list-sources:
openFile: does not exist (No such file or directory)
Resolving dependencies...
All the requested packages are already installed:
text-1.2.3.0
Use --reinstall if you want to reinstall anyway.

Which I think means that the cabal install command worked, even if some error was thrown from GF's setup.

Cleanest solution

If I temporarily remove the sandbox source when installing the package, it works:

$ cabal sandbox remove-source path/to/GF
$ cabal install text
$ cabal sandbox add-source path/to/GF

This is probably a remnant of the darcs-to-git conversion. It would be great if this was fixed, but at least if someone else has the same problem then maybe this will help them.