When running stack sdist
in my project directory, the stack.yaml
file isn't included in the tarball (this seems to be expected).
Consequently, when I upload the tarball to hackage, then stack install mypackage
it complains about missing dependencies (extra-deps
) which I specified in the stack.yaml
file.
$ stack install pandoc-placetable
Run from outside a project, using implicit global project config
Using resolver: lts-5.17 from implicit global project's config file: ~/.stack/global-project/stack.yaml
While constructing the BuildPlan the following exceptions were encountered:
-- Failure when adding dependencies:
spreadsheet: needed (>=0.1.3 && <0.1.4), not present in build plan (latest applicable is 0.1.3.4)
needed for package: pandoc-placetable-0.4
-- While attempting to add dependency,
Could not find package spreadsheet in known packages
Recommended action: try adding the following to your extra-deps in /Users/maurobieg/.stack/global-project/stack.yaml
- spreadsheet-0.1.3.4
Or what's the recommended way to make a hackage package stack
-installable if it has further hackage dependencies?
Update: I just added extra-source-files: stack.yaml
to the cabal file and the stack.yaml
is indeed included in the tarbal of the newly published version. Nevertheless, stack install pandoc-placetable-0.4.1
still comes up with the same error.
I could also just tell people who don't want to install cabal-install
on their system to clone from GitHub, then build with stack
. Is that the recommended approach for tiny packages? Or should I ask them to include the dependency of pandoc-placetable
(i.e. spreadsheet
) in their global stack.yaml
? Smells like polluting a global file...
extra-source-files: stack.yaml
) in the thread you linked work? I would expect it to. Hackage package are not meant to be 'stack-installable' (stack doesn't do anything but call other programs which do all the work, so 'stack-installable' is just 'cabal-installable'), or you are meant to get thestack.yaml
from your resolver (remember, package maintainers will likely want to support multiple compile version and will have multiplestack.yaml
). – user2407038extra-source-files
doesn't help, see my update. – mb21lts
comes along, even if my dependencies and code don't change at all, right? (please correct me if I'm wrong and take it as feedback about what information I gathered as a casual haskell dev) – mb21