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

Provide a more convenient option for config independent scripts #2486

Closed
harendra-kumar opened this issue Aug 13, 2016 · 3 comments
Closed

Comments

@harendra-kumar
Copy link
Collaborator

Splitting from #1208, quoting from that issue:

A syntactic sugar in the form of a runghc option can also be provided. Though it will not be any
shorter compared to passing -hide-all-packages directly to ghc, it will perhaps be more
intuitive. One won't have to refer to the ghc manual as well as stack manual to know how to
specify ghc options to runghc. For example using --no-implicit-packages along with -- packages is more intuitive than ending the command with a ghc option like this-- -hide-all- packages.

It will be an option like stack runghc --no-implicit-packages --package ... which will automatically pass -hide-all-packages to ghc.

Several names have been used for this e.g. --standalone, --self-contained, --independent, --explicit-packages, --no-implicit-packages etc. I personally find the last one conveying the meaning more precisely but have no objection to others as well.

@harendra-kumar
Copy link
Collaborator Author

In #1957 @mgsloan proposed to make --standalone behavior as default and use stack exec -- runghc for the one off scripts when we do not want to enforce listing of all packages. I like that idea. Especially since it is in line with stack's reproducible results by default philosophy.

Comments, opinions on that?

@kadoban
Copy link
Collaborator

kadoban commented Aug 10, 2017

Seems like this is implemented now with how new script command works. Let me know if I misunderstood.

@kadoban kadoban closed this as completed Aug 10, 2017
@brandon-leapyear
Copy link
Contributor

brandon-leapyear commented May 18, 2018

This is an old work account. Please reference @brandonchinn178 for all future communication


I would actually prefer --no-implicit-packages in addition, for my current use case:

  1. I would like to use the resolver in stack.yaml
  2. I would like to make use of local packages in stack.yaml
  3. I would like to use optparse-applicative to parse command line arguments

The first two mean I'm using runghc instead of script. The third is foiled because -- -hide-all-packages passes -hide-all-packages to the script's arguments as well.

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

3 participants