acowley / cabbage

A tool for caching cabal builds in a Nix store
33 stars 1 forks source link

Adding build-depends from executable section #1

Open codygman opened 9 years ago

codygman commented 9 years ago

I'm trying to run the demos from acowley/Frames.

cd ~/sources/Frames
cabbage
nix-shell --pure -p haskellngPackages.cabal-install haskellngPackages.ghc
cabal repl
*Frames> :l demo/Main.hs

demo/Main.hs:6:8:
    Could not find module `Lens.Family'
    It is a member of the hidden package `lens-family-core-1.2.0'.
    Perhaps you need to add `lens-family-core' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

demo/Main.hs:7:18:
    Could not find module `ListT'
    It is a member of the hidden package `list-t-0.4.3'.
    Perhaps you need to add `list-t' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
Failed, modules loaded: none.

I don't think this is the main aim of cabbage, but I bet it would be a useful use case and something not hard to work around... but could be wrong.

acowley commented 9 years ago

This will require that the -a flag be passed to cabbage so that it gathers dependencies for all build targets. However, there were other issues with parsing of .cabal files that are now fixed. So, cabbage -a in the Frames directory should get you to a working state.

I'm verifying these fixes right now, and will comment again when it's ready to roll.

acowley commented 9 years ago

Okay, I've updated cabbage and added a cabbage.config file to the Frames repository to tell cabbage to build the dependencies guarded by the demos flag. You will have to remove the current shell.nix so that cabbage can generate a new one, but then the usual cabbage setup should get things going. That is, cabbage && nix-shell --run 'sh $setup'.

I've tested that on OS X with nix 1.9, let me know how it goes if you give it a shot.

codygman commented 9 years ago

Alright cool, I should be able to try it tonight. On Feb 24, 2015 4:25 PM, "Anthony Cowley" notifications@github.com wrote:

Okay, I've updated cabbage and added a cabbage.config file to the Frames repository to tell cabbage to build the dependencies guarded by the demos flag. You will have to remove the current shell.nix so that cabbage can generate a new one, but then the usual cabbage setup should get things going. That is, cabbage && nix-shell --run 'sh $setup'.

I've tested that on OS X with nix 1.9, let me know how it goes if you give it a shot.

— Reply to this email directly or view it on GitHub https://github.com/acowley/cabbage/issues/1#issuecomment-75860271.