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

Use the latest cabal spec in the interactive package init #8978

Closed

Conversation

Kleidukos
Copy link
Member

@Kleidukos Kleidukos commented May 29, 2023

See #8977

This PR updates the version of the Cabal spec that is suggested by default to users when initialising a project interactively. We now use the latest version (3.4).

QA Notes

Initialising a project with cabal init should prompt the user to use the 3.4 spec by default instead of the 3.0.


Please include the following checklist in your PR:

Bonus points for added automated tests!

@andreabedini
Copy link
Collaborator

andreabedini commented May 29, 2023

Just a nitpick, cabal init initialises a package, not a project ☺️ also 👍

@Kleidukos Kleidukos changed the title Use the latest cabal spec in the interactive project init Use the latest cabal spec in the interactive package init May 29, 2023
@Kleidukos Kleidukos force-pushed the hecate-8977-cabal-init-use-3.4 branch from 506d377 to 13b11f0 Compare May 29, 2023 15:19
@Kleidukos Kleidukos force-pushed the hecate-8977-cabal-init-use-3.4 branch from 13b11f0 to 8ffe059 Compare May 29, 2023 15:19
@ulysses4ever
Copy link
Collaborator

I'm confused: is it latest or 3.4? Or are they the same somehow? Non-interactive already does the right thing, i think, so just reuse maybe?

@Kleidukos
Copy link
Member Author

latest and 3.4 are the same from what I see

@ulysses4ever
Copy link
Collaborator

It'd still be better to default to the current version of cabal-install imo. Also, it's weird that interactive and non interactive don't do the same.

@ulysses4ever
Copy link
Collaborator

One reason why I think it's better to explicitly set latest is because one day 3.4 will no longer be the latest and then we'll have to decide what to do with the version again (e.g. when to bump it). The whole point of setting it to latest always (as discussed in #8616) is that it allows us to avoid this unnecessary decision process.

@ulysses4ever
Copy link
Collaborator

@gbaz suggests that we lag one version behind the latest. @fgaz notices that as soon as Cabal spec version is an Enum and Bounded, it should be as simple as to change the default to pred maxBound (instead of the current version, which hard-codes 3.4 or whatever it hard-codes).

This ideally balances my desire to forget about maintenance of this constant forever and some caution about latest being too new for some users.

@ulysses4ever
Copy link
Collaborator

Also, let's make sure that -i and -n default to the same thing.

@gbaz
Copy link
Collaborator

gbaz commented Jul 9, 2023

The broader issue I note is that we haven't updated the init parser to even display or parse or let people choose cabal spec versions 3.6 or 3.8.

In general it seems that when we bump the spec, we forget to also fix the init system -- maybe there's a way to drive init directly off the datatype so this is less possible?

@Mikolaj
Copy link
Member

Mikolaj commented Sep 4, 2023

@Kleidukos: what's the best course of action with this one? Open new tickets for all the related proposals and merge this one as is or re-evaluate and perhaps fit more into a single PR (in which case, please mark this a draft and remove the needs-review label)?

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kleidukos any news here? I'd be happier if defaultCabalVersion wasn't hardcoded as it's now and was simply pred maxBound (or pred $ pred maxBound). But the current version is an obvious improvement, I think.

@@ -306,7 +306,7 @@ cabalVersionPrompt flags = getCabalVersion flags $ do
parseCabalVersion "2.4" = CabalSpecV2_4
parseCabalVersion "3.0" = CabalSpecV3_0
parseCabalVersion "3.4" = CabalSpecV3_4
parseCabalVersion _ = defaultCabalVersion -- 2.4
parseCabalVersion _ = defaultCabalVersion -- 3.4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment looks like it's doomed to fall behind. Why don't we kill it, and anyone should be able to look up the definition of defautCabalVersion themselves?

@ulysses4ever
Copy link
Collaborator

@mergify rebase

Copy link
Contributor

mergify bot commented Jan 7, 2024

rebase

☑️ Nothing to do

  • -conflict [📌 rebase requirement]
  • -closed [📌 rebase requirement]

@ulysses4ever
Copy link
Collaborator

@mergify refresh

Copy link
Contributor

mergify bot commented Jan 7, 2024

refresh

✅ Pull request refreshed

@ulysses4ever
Copy link
Collaborator

On a cabal meeting, we discussed that a more flexible policy may be needed to ensure smooth coordination with HLS, see #10457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Testing Approved
Development

Successfully merging this pull request may close these issues.

6 participants