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

Add support for mirrors wrt #357 #700

Merged
merged 2 commits into from
Jan 11, 2023
Merged

Add support for mirrors wrt #357 #700

merged 2 commits into from
Jan 11, 2023

Conversation

hasufell
Copy link
Member

@hasufell hasufell commented Dec 3, 2022

@PhotonQuantum ...this might resolve the need for you to modify the metadata file itself. But you will have to replicate the path components. The mirror support allows to

  1. replace the host component
  2. specify a path prefix

E.g. when we have https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml and the following mirror config:

mirrors:
  "raw.githubusercontent.com":
    authority:
      host: "mirror.sjtu.edu.cn"
    pathPrefix: "ghcup/yaml"

then the resulting url will be https://mirror.sjtu.edu.cn/ghcup/yaml/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml

The current hosts are:

  • github.com (for stack and some older HLS versions)
  • raw.githubusercontent.com (for the yaml metadata)
  • downloads.haskell.org (for everything else)

@PhotonQuantum
Copy link

Looks good! btw will the installer script use this config? We'd like to enable our users to use the mirror when installing ghcup itself.

@hasufell
Copy link
Member Author

hasufell commented Dec 4, 2022

Looks good! btw will the installer script use this config? We'd like to enable our users to use the mirror when installing ghcup itself.

Right now not, but this could be made an option via an env var, e.g.

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | GHCUP_MIRROR=sjtu sh

But first, the directory structure needs to match so we can test this out.

@hasufell
Copy link
Member Author

@PhotonQuantum can we give it a test?

@PhotonQuantum
Copy link

@PhotonQuantum can we give it a test?

I'm willing to help, but this requires some significant modifications to our codebase, and I'm occupied these days.

I'll have some time available next month and we may start testing this design then. Sorry for the inconvenience!

@hasufell hasufell added this to the 0.1.19.0 milestone Jan 3, 2023
@hasufell
Copy link
Member Author

I'm going to merge this for now. If there are issues, please raise them in a new ticket.

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

Successfully merging this pull request may close these issues.

2 participants