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

Combine stack-info-yaml argument and config.yaml #2982

Closed
ndmitchell opened this issue Feb 5, 2017 · 12 comments · Fixed by #5031
Closed

Combine stack-info-yaml argument and config.yaml #2982

ndmitchell opened this issue Feb 5, 2017 · 12 comments · Fixed by #5031

Comments

@ndmitchell
Copy link
Contributor

There are two config files that Stack uses for the global URL settings, namely config.yaml (typically in $STACK_ROOT) and the arguments passed to stack-setup-yaml. The typical reason to modify either seems to be that you want to make Stack always hit a local mirror (either for caching, reproducibility, or due to network blocks). If you want to modify one, you probably want to modify the other. They are both set in different ways, sourced from different places, and have different non-overlapping subsets of information. Combining them into one would simplify lives for people who need to modify these things.

@ndmitchell
Copy link
Contributor Author

Note that the stack-setup-yaml file is far more convenient (passed on the command line, able to be set in stack.yaml) so would be my preference of the model to follow.

@decentral1se
Copy link
Member

I'd love when Stack could run totally offline. I'm following the Stack list thread and would like to see this all being made easier. So, those two files are described as:

  • stack-setup.yaml (default): Stack's dependencies.
  • config.yaml (no default): User's global configuration

Could we see an example of the options you need from both files without sensitive info?

@ndmitchell
Copy link
Contributor Author

For stack-setup.yaml I take the default, delete 90%+ of it, and then rewrite http://... to http://myinternalserver/...`.

For config.yaml I take https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#package-indices and https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#urls, slap them together, and do the same http:// trick.

To make it easy, you'd really want to just set "for http:// read http://mylocalserver/ or C:/mylocalcache/, and once, rather than a few 100 times over two files.

@no-more-secrets
Copy link

(+1)

This should make it easier to configure stack to work in environments where local servers are required.

@ndmitchell
Copy link
Contributor Author

I've set up a fully worked example at https://github.com/ndmitchell/offline-stack#readme which is tested to ensure it works. I suggest using that as a template.

@philipcraig
Copy link

Great setup @ndmitchell

@jonathankochems
Copy link

(+1) This would really help getting stack into work environments where local mirroring of packages are required.

@Blaisorblade
Copy link
Collaborator

Blaisorblade commented Nov 17, 2017

“Using Stack offline” would also probably help with bad connections (#3088, just closed as duplicate), and with people behind firewalls that block S3 (I forget which is the issue, should also be merged here).

@Blaisorblade
Copy link
Collaborator

BTW, beyhond the topic of this issue, it’d be great to support mirroring with a less cumbersome procedure if possible, or at least to integrate or link to instructions from the Stack docs. Not sure if this is the correct issue to track all that, sorry if I got this wrong (should look at all this more closely if I get time).

@AleXoundOS
Copy link

@Blaisorblade, try https://github.com/AleXoundOS/haskell-stack-mirror-script
It's not so cumbersome you may think. But sure this could be done more easily.

@no-more-secrets
Copy link

@AleXoundOS Thank you for this, it sounds like what we need. One question -- will it also download GHC, so that when we run stack-setup on a host with no GHC it can automatically download/build it from the local server? Or is there another way to do that?

@AleXoundOS
Copy link

@dpacbach, yes it mirrors all executables required for stack setup to operate.
(but don't forget to supply custom url to the tweaked setup-info-yaml file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants