cabbage icon indicating copy to clipboard operation
cabbage copied to clipboard

Adding build-depends from executable section

Open codygman opened this issue 10 years ago • 3 comments

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.

codygman avatar Feb 21 '15 21:02 codygman

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 avatar Feb 21 '15 23:02 acowley

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.

acowley avatar Feb 24 '15 22:02 acowley

Alright cool, I should be able to try it tonight. On Feb 24, 2015 4:25 PM, "Anthony Cowley" [email protected] 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.

codygman avatar Feb 24 '15 22:02 codygman