Skip to content
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

stack_snapshot ignores the cabal flags defined in the snapshot #1152

Open
thufschmitt opened this issue Nov 20, 2019 · 4 comments
Open

stack_snapshot ignores the cabal flags defined in the snapshot #1152

thufschmitt opened this issue Nov 20, 2019 · 4 comments
Labels
blocked Blocked on an usptream ticket P3 minor: not priorized type: feature request

Comments

@thufschmitt
Copy link
Contributor

Describe the bug

Stack snapshots can define custom cabal flags for building certain packages. The stack_snapshot rule ignores them.

To Reproduce

From the rules_haskell repository

  1. Add cassava to the packages argument of stack_snapshot in the WORKSPACE
  2. Build it with bazel build @hackage//:cassava

The build will fail with

Setup.hs: Encountered missing dependencies:
bytestring >=0.9.2 && <0.10.4, text-short ==0.1.*

Now add flags = { "cassava": ["-bytestring--LT-0_10_4"], }, to the arguments of stack_snapshot and build it again. The build will succeed

Expected behavior

Cassava should be built with the correct flag out of the box because it is specified in the snapshot file

Environment

/cc @mboes

@mboes
Copy link
Member

mboes commented Nov 20, 2019

@aherrmann I'm at a loss as to how to resolve this. Stack doesn't expose enough metadata. We'd need
to add new subcommands to stack ls to expose this information, or augment the new JSON output. Any other ideas?

@aherrmann
Copy link
Member

Yes, it seems this requires more output from stack ls dependencies --json. This makes me wonder, if this becomes available, should stack_snapshot still accept Cabal flags, or should users specify those in custom stack snapshot files?

@mboes
Copy link
Member

mboes commented Nov 20, 2019

Using a custom snapshot file may well be cleaner. Best to keep as much Stack configuration in Stack specific files, rather than have that split between Stack specific files and the WORKSPACE file.

@aherrmann
Copy link
Member

Upstream feature request about exposing the needed metadata: commercialhaskell/stack#5372

@aherrmann aherrmann added blocked Blocked on an usptream ticket P3 minor: not priorized type: feature request and removed type: bug labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on an usptream ticket P3 minor: not priorized type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants