Skip to content

Standardize default extensions #1644

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

Merged
merged 4 commits into from
Jul 31, 2020

Conversation

seagreen
Copy link
Contributor

Standardize all components on the same default-extensions.

Use ones from parser-typechecker:lib because they're a superset of the default-extensions in unison-core.

(I don't think the particular extensions are too important, the goal was just to get each component of the repo using the same ones. Which ones those are can always be changed later.)

Use cabal common stanzas (https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas) so that the extensions only have to be listed once per cabal file. Add a note to each common stanza suggesting to keep them in sync.

Bump the cabal-version within the cabal files to 2.2 in order to get access to common stanzas.

Then remove the now redundant extensions from the haskell files.

@@ -1,8 +1,8 @@
cabal-version: 2.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be >= 2.2 in each case? Or what happens if you have a version that's too new?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So there's a story here!

To get common stanzas we have to specify at least 2.2. But changed this field in two ways:

  1. It has to be at the top of the cabal file (easy enough)

  2. It has to be an exact version, not a range.

You can find more documentation on it here: https://cabal.readthedocs.io/en/latest/cabal-package.html#pkg-field-cabal-version

My understanding is that later versions of cabal-the-library will still work.

All that the cabal-version field is identifying is which version of the spec this particular cabal file complies with, but later versions of cabal-the-library can still read older versions of cabal-the-spec-for-cabal-files.

I checked, and I think that's borne out by my current setup:

$ stack exec -- cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, great!

@aryairani aryairani merged commit e77cce9 into unisonweb:trunk Jul 31, 2020
@aryairani
Copy link
Contributor

Now that https://fgaz.me/posts/2019-11-14-cabal-multiple-libraries/, maybe it can all be in one cabal file, with one default-extensions: section?

@aryairani aryairani mentioned this pull request Aug 17, 2020
@seagreen
Copy link
Contributor Author

Perhaps. Support for multiple libraries in a package is janky in stack (eg commercialhaskell/stack#5318). But it's worth considering. I'll bring it up on: #779

@pchiusano pchiusano mentioned this pull request May 11, 2021
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.

2 participants