-
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
Setup-info configurability #5031
Setup-info configurability #5031
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
stack
decides where to resolves it's tooling locations, for the initial purpose of usingstack
offline or behind a firewall.Stack 2 broke the previous behavior of the
setup-info
field - 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-locations
yaml config for remote locations, and usingsetup-info
for inline configuration only.Also, as the
--stack-setup-yaml
CmdArg has been deprecated for 3 years, it is now removed, in favor of--setup-info-yaml
#2647Design decisions:
stack-setup-2.yaml
is added to thesetup-info-locations
only if no locations were specified (either in the cmd args or in the config yaml)PR considerations:
setup-info
, command line args,setup-info-locations
and the default location, with missing / invalid locations to check that no unwanted accesses are made.Relevant issues:
stack setup
should not fail if it couldn't download default stack-setup-yamlSetupInfo
Consider if other order of combination is more appropriate for the monoids on config typesstack setup --stack-setup-yaml
optionthough.