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

Warns users about non-ghcup channels #1230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

qxrein
Copy link

@qxrein qxrein commented Feb 21, 2025

RESOLVES: #1225
example output

~: cabal run ghcup -- debug-info
Configuration is affected by the following files:
- cabal.project
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.9.yaml as file /home/qxrein/.ghcup/cache/ghcup-0.0.9.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--  0     0    0     0    0     0      0      0 --:--:-- --:--  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ Warn  ] Warning: The channel DefaultChannel uses a non-ghcup URL: URI {uriScheme = Scheme {schemeBS = "https"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "raw.githubusercontent.com"}, authorityPort = Nothing}), uriPath = "/haskell/ghcup-metadata/master/ghcup-0.0.9.yaml", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}
[ Warn  ] Warning: The channel StackChannel uses a non-ghcup URL: URI {uriScheme = Scheme {schemeBS = "https"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "raw.githubusercontent.com"}, authorityPort = Nothing}), uriPath = "/commercialhaskell/stackage-content/master/stack/stack-setup-2.yaml", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}
[ Warn  ] Warning: The channel CrossChannel uses a non-ghcup URL: URI {uriScheme = Scheme {schemeBS = "https"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "raw.githubusercontent.com"}, authorityPort = Nothing}), uriPath = "/haskell/ghcup-metadata/master/ghcup-cross-0.0.9.yaml", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}
[ Warn  ] Warning: The channel PrereleasesChannel uses a non-ghcup URL: URI {uriScheme = Scheme {schemeBS = "https"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "raw.githubusercontent.com"}, authorityPort = Nothing}), uriPath = "/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.9.yaml", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}
[ Warn  ] Warning: The channel VanillaChannel uses a non-ghcup URL: URI {uriScheme = Scheme {schemeBS = "https"}, uriAuthority = Just (Authority {authorityUserInfo = Nothing, authorityHost = Host {hostBS = "raw.githubusercontent.com"}, authorityPort = Nothing}), uriPath = "/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.9.yaml", uriQuery = Query {queryPairs = []}, uriFragment = Nothing}
===== Main ======
Architecture:  x86_64
Platform:      Linux UnknownLinux, 25.05
GHCup Version: v0.1.40.0-49-gc07d28ea

===== Directories ======
base:    /home/qxrein/.ghcup
bin:     /home/qxrein/.ghcup/bin
GHCs:    /home/qxrein/.ghcup/ghc
cache:   /home/qxrein/.ghcup/cache
logs:    /home/qxrein/.ghcup/logs
config:  /home/qxrein/.ghcup
db:      /home/qxrein/.ghcup/db
temp:    /home/qxrein/.ghcup/tmp

===== Metadata ======
default:     https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.9.yaml
stack:       https://raw.githubusercontent.com/commercialhaskell/stackage-content/master/stack/stack-setup-2.yaml
cross:       https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-cross-0.0.9.yaml
prereleases: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.9.yaml
vanilla:     https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.9.yaml

@dfordivam
Copy link
Collaborator

@qxrein Thanks for the PR!
But I am afraid the solution implemented is not correct.
The urls being used by the ghcup via channelURL are in fact all official ghcup channels (they are hosted at haskell/ghcup-metadata repo)

In addition to using these official channels, the user could also provide (via ghcup config or command line options) a path to metadata file which does not have the "https://raw.githubusercontent.com/haskell/ghcup-metadata/" prefix. in this scenario we should warn users.

Also you may want to join the matrix chat (https://matrix.to/#/#ghcup:matrix.org) for more casual discussions on ghcup related dev

@qxrein
Copy link
Author

qxrein commented Feb 22, 2025

ok

@qxrein
Copy link
Author

qxrein commented Feb 22, 2025

this is working after introducing a random temporary channel to lib/GHCup/Version.hs.

~: cabal run ghcup -- debug-info
Configuration is affected by the following files:
- cabal.project
[ Warn  ] Warning: The channel StackChannel uses a non-official URL: https://raw.githubusercontent.com/commercialhaskell/stackage-content/master/stack/stack-setup-2.yaml
[ Warn  ] Warning: The channel TemporaryChannel uses a non-official URL: https://qxrein.com/custom-metadata/temporary.yaml
===== Main ======
Architecture:  x86_64
Platform:      Linux UnknownLinux, 25.05
GHCup Version: v0.1.40.0-50-g105f4be9

===== Directories ======
base:    /home/qxrein/.ghcup
bin:     /home/qxrein/.ghcup/bin
GHCs:    /home/qxrein/.ghcup/ghc
cache:   /home/qxrein/.ghcup/cache
logs:    /home/qxrein/.ghcup/logs
config:  /home/qxrein/.ghcup
db:      /home/qxrein/.ghcup/db
temp:    /home/qxrein/.ghcup/tmp

===== Metadata ======
default:     https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.9.yaml
stack:       https://raw.githubusercontent.com/commercialhaskell/stackage-content/master/stack/stack-setup-2.yaml
cross:       https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-cross-0.0.9.yaml
prereleases: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.9.yaml
vanilla:     https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.9.yaml
temporary:   https://qxrein.com/custom-metadata/temporary.yaml

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

Successfully merging this pull request may close these issues.

Warn users about non-ghcup channels
2 participants