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

OwnSource setting lost after ghcup config add-release-channel #708

Closed
ksqsf opened this issue Dec 11, 2022 · 2 comments
Closed

OwnSource setting lost after ghcup config add-release-channel #708

ksqsf opened this issue Dec 11, 2022 · 2 comments

Comments

@ksqsf
Copy link
Contributor

ksqsf commented Dec 11, 2022

Suppose I have the following config,

url-source:
  OwnSource: xxx

Then run the following command,

ghcup config add-release-channel yyy

Now the OwnSource entry disappears,

url-source:
  AddSource:
  - Right: yyy

Consequently, the "main" source will not be xxx, but the default one.

@ksqsf
Copy link
Contributor Author

ksqsf commented Dec 11, 2022

doConfig (defaultUserSettings { uUrlSource = Just $ AddSource (xs <> [Right uri]) })

It seems that add-release-channel just adds the new release channel to the default config.

Just to be sure: is this intentional? If so, please close this issue. :-)

@hasufell
Copy link
Member

It's a recent feature. I'm willing to make it more robust. PRs also welcome.

The type is here:

ghcup-hs/lib/GHCup/Types.hs

Lines 290 to 294 in 8234589

data URLSource = GHCupURL
| OwnSource [Either GHCupInfo URI] -- ^ complete source list
| OwnSpec GHCupInfo
| AddSource [Either GHCupInfo URI] -- ^ merge with GHCupURL
deriving (GHC.Generic, Show)

So OwnSource accepts a list and we could just append to it. OwnSpec could be turned into OwnSource. I've just kept it for backwards compatibility in fact.

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

No branches or pull requests

2 participants