-
Notifications
You must be signed in to change notification settings - Fork 842
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
Allow more command-line options to be specified within stack.yaml #846
Comments
@drvink You could make a PR with additional fields you think are good to have in the Some flags present in cabal-install aren't present in stack, which is because we haven't made it a design goal to replicate every functionality. Starting other issues are good for tracking adding these. |
As mentioned in #757, it would be great to have the |
How about having a field called |
@snoyberg @borsboom Are y'all on board with "configure-options"? See also the discussion here: #1341 (comment) I wish there was something better for doing this with snapshot dependencies, but that seems like a rather tricky problem to solve. |
@mgsloan I think you're mis-reading this issue. This one is about taking existing options (e.g., the various build options) and making it possible to set defaults in stack.yaml. Adding additional new options (like configure-options) should be a separate issue. (edit: I see the original request included both, but @drwebb's comment limited the scope and suggested separate issues for new options) |
@drwebb, I think you're working on this issue? |
Discussion about adding |
I'm imagining this looking like: stack-options: --library-profiling |
@mgsloan Could that result in redundant ways to set command line options? E.g. nix:
enable: true vs stack-options: --nix |
Yes. I think the implementation should look like the following:
This may get rather hairy, I know the code for this stuff is surprisingly complicated, due to running in interpreter mode and providing decent error messages. It may actually make sense to use yaml lists for the options. While this looks a little weird, it's better than implementing bash argument parsing:
Alternatively, we could be sure to make it possible to set every CLI option as a stack.yaml option. That seems a bit overkill to me, though. |
Basically, one way or another reifying I don't think people mind learning two sets of options (I certainly don't). It's just confusing when options which affect the build plan aren't available in |
Right, it is certainly an option to just do all the plumbing to get every CLI option available from stack.yaml. One issue is that the options parsing does do some things a little bit fancier than straight parsing - https://github.com/commercialhaskell/stack/blob/master/src/Stack/Options.hs#L84 . In order to support the I think it makes sense to make a distinction between options that we want to be part of the project's configuration (part of the repo), and things that are more like development time configuration (now I'm profiling, now I want coverage info, etc). So, the purpose of this |
In other words, we actually want to discourage people from writing a |
Ideally, this could go in a "local options" file (e.g. |
This thread seems to have stalled. Poke! With the upcoming We've already got this in our templates:
params:
author-email: [email protected]
author-name: Chris Done
category: Web
copyright: 2015 Chris Done
github-username: chrisdone And the nix thing someone already mentioned: nix:
enable: True Why not also:
etc. and call it a day? |
This already exists (though IIRC is undocumented):
@chrisdone, does that work for you for now? |
It does! 👏😄 I'll update the other issue. |
I wonder if we can close this issue. Or are there more options we should add than were done by making basically all build arguments settable? Maybe would be better to have more specific issues than this rather vague one. |
As the original guilty party for filing this issue, I'm OK with it being closed as long as it's now more or less possible to stash arguments in a persisted config somewhere rather than having to specify them on the command line for every build. |
SGTM, lets open issues for specific CLI things that ought to be settable via configuration. |
Unless I'm missing something, it doesn't seem to be able to set defaults within a stack.yaml for things like
--library-profiling
,--haddock
, etc. Furthermore, some flags that were available in cabal install are gone entirely (like--enable-executable-stripping
, just as a random example), and it's not obvious whether there's any workarounds available.The text was updated successfully, but these errors were encountered: