Skip to content

Document how to specify build flags for dependencies #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ysangkok opened this issue Sep 24, 2019 · 2 comments
Closed

Document how to specify build flags for dependencies #372

ysangkok opened this issue Sep 24, 2019 · 2 comments

Comments

@ysangkok
Copy link

I tried - secp256k1-haskell:+ecdh >= 0.1.5 but it didn't work. The flag to be set is ecdh. I used this syntax because it was mentioned in https://docs.haskellstack.org/en/latest/GUIDE/#cabal-flag-management that you use minus to remove a flag. So I assumed that enabling a flag would be +.

The error from hpack is:

/home/travis/build/centromere/cacophony/package.yaml: Error while parsing $.library.dependencies[10] - invalid dependency "secp256k1-haskell:+ecdh >= 0.1.5"
@sol
Copy link
Owner

sol commented May 1, 2020

Hey! Sorry for the late reply and thanks for using hpack!

I think this is a limitation that we can't address in hpack.

.cabal files (and as a consequence package.yaml) does not support flags for dependencies.

However, stack allows you to specify flags for dependencies in stack.yaml. Here is a related stack overflow question: https://stackoverflow.com/questions/23523869/is-there-any-way-to-define-flags-for-cabal-dependencies

I hope this helps.

@sol
Copy link
Owner

sol commented May 1, 2020

I'm closing this issue. If you still have questions regarding stack and flags, please consult the relevant stack support channels.

For anything related to hpack, feel free to open a new issue in the future.

@sol sol closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants