fpco/stackage-install

--only-dependencies

DanBurton opened this issue · 5 comments

Installing only dependencies is my main use case for this tool, and I'd love to see it work.

$ stk install --only-dependencies
cabal: unrecognized 'fetch' option `--only-dependencies'
stackage-install: readProcess: cabal "fetch" "--dry-run" "--only-dependencies" (exit 1): failed
$ cabal --version
cabal-install version 1.20.0.3

(I tried this on Windows with minghc-7.8.4.)

This seems like a more general problem. Passing -j also doesn't work. I guess the problem is that everything is passed to cabal fetch instead of cabal install.

Looking at the code the arguments are passed to cabal fetch as well as to cabal install. I think there needs to be some way to specify arguments that are passed to only one of them.

Sorry about that, I had it (mostly) right the first time. I've added a fix and pushed to Hackage, together with the following explanation in the README:

The output from cabal install --dry-run doesn't actually give us information on which packages need to be downloaded, only the packages to be installed. This will be different in the case of local packages. Unfortunately, cabal fetch won't work for us either, since it accepts different arguments see #2. The compromise we have now is to just continue working in the presence of errors during download, though a more robust solution would be to check if one of the arguments refers to a local package.

Can you confirm that it works now?

I confirm that it's working. (Looks like I can't close the issue as I didn't create it)

Cool, thanks for checking so quickly!