Setup-info configurability#5031
Setup-info configurability#5031snoyberg merged 14 commits intocommercialhaskell:masterfrom NightRa:feature/setup-info
Conversation
snoyberg
left a comment
There was a problem hiding this comment.
A few comments about the design, but overall this looks good, thank you!
doc/yaml_configuration.md
Outdated
| If you need to **replace** it, use the `stack --setup-info-yaml` command-line | ||
| argument instead. The default setup metadata is in | ||
| [stack-setup-2.yaml](https://github.com/commercialhaskell/stackage-content/raw/master/stack/stack-setup-2.yaml). | ||
| Note that specifying this config *does not* the default `stack-setup-2.yaml` from being consulted as a fallback. |
There was a problem hiding this comment.
I think there's a typo in this sentence, I'm not sure how it's supposed to read.
src/Stack/Options/ConfigParser.hs
Outdated
| <*> many ( | ||
| strOption | ||
| ( long "setup-info-yaml" | ||
| <> help "Alternate URL or absolute path for stack dependencies" |
There was a problem hiding this comment.
I would think a relative path would be even more convenient and recommended, so that the YAML file can be included in a repo and the code will work on multiple machines. Any underlying reason for preferring absolute paths?
…yaml as top level CmdArg
…efault if none specified.
|
@snoyberg There are 2 outstanding issues which are out-of-scope for the current PR and should be handled seperately:
|
|
Also, feel free to re-arrange the change-log, I had no clue which sections the changes should be in. |
|
Thanks! |
This PR comes to fix various issues related to how
stackdecides where to resolves it's tooling locations, for the initial purpose of usingstackoffline or behind a firewall.Stack 2 broke the previous behavior of the
setup-infofield - which now does not overwrite the default location. #2983, #2913This existing breakage allowed for a backwards-compatible implementation of the wanted behavior - via the
setup-info-locationsyaml config for remote locations, and usingsetup-infofor inline configuration only.Also, as the
--stack-setup-yamlCmdArg has been deprecated for 3 years, it is now removed, in favor of--setup-info-yaml#2647Design decisions:
stack-setup-2.yamlis added to thesetup-info-locationsonly if no locations were specified (either in the cmd args or in the config yaml)PR considerations:
setup-info, command line args,setup-info-locationsand the default location, with missing / invalid locations to check that no unwanted accesses are made.Relevant issues:
stack setupshould not fail if it couldn't download default stack-setup-yamlSetupInfoConsider if other order of combination is more appropriate for the monoids on config typesstack setup --stack-setup-yamloptionthough.