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 build: Issues with flags #1995

Closed
harendra-kumar opened this issue Apr 4, 2016 · 2 comments
Closed

stack build: Issues with flags #1995

harendra-kumar opened this issue Apr 4, 2016 · 2 comments
Milestone

Comments

@harendra-kumar
Copy link
Collaborator

I wasted precious minutes trying to debug what's wrong when I made a mistake in defining and using a flag. The mistake I made was to put a ':' in the flag stanza of the cabal file, like this:

flag native:

When I ran stack build --flag unicode-transforms:native it just said:

These flags are used without having been defined: native

This is likely to be a cabal issue.

But what's strange is that with this mistake stack allows me to put any random name as a package name in stack.yaml flags section and on the command line flag spec without noticing anything wrong. E.g.

cueball:/vol/hosts/cueball/workspace/projects/unicode-transforms$ cat stack.yaml
flags:
    hahaha:
        native: true

extra-package-dbs: []
packages:
- '.'
extra-deps:
- data-list-sequences-0.1
resolver: lts-5.8

cueball:/vol/hosts/cueball/workspace/projects/unicode-transforms$ stack build --flag xxx:native 
These flags are used without having been defined: native
@mgsloan
Copy link
Contributor

mgsloan commented Apr 5, 2016

The stack part of this issue is fairly related to #1521

Looks like there is a check in the code but it may be broken:

checkFlagsUsed boptsCli lps extraDeps snapshot = do

@mgsloan mgsloan added this to the P2: Should milestone Apr 5, 2016
@mgsloan
Copy link
Contributor

mgsloan commented Mar 18, 2017

Hmm, can no longer reproduce this:

mgsloan@computer:~/fpco/test-stack/issue1995/unicode-transforms$ stack build --flag hrrm:native
Invalid flag specification:
- Package 'hrrm' not found (specified on command line)
- Package 'hahaha' not found (specified in stack.yaml)

Closing!

@mgsloan mgsloan closed this as completed Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants