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

Cabal file improvements #105

Merged
merged 5 commits into from
Feb 7, 2024
Merged

Cabal file improvements #105

merged 5 commits into from
Feb 7, 2024

Conversation

sellout
Copy link
Member

@sellout sellout commented Jan 31, 2024

This takes advantage of some newer features (e.g., source-repository-package can now list multiple subdirs) and makes some other improvements.

There is unfortunately still a lot of duplication. Cabal 3.8 supports multiple public libraries in a package, which can help a bit, but cabal2nix doesn’t yet handle that (NixOS/cabal2nix#448). Alternatively, something like hpack-dhall would help a lot, but in general, I’ve tried to avoid any preprocessing in order to get Cabal to build things outside of Nix.

It’s probably easiest to review this PR commit-by-commit.

Cabal 3.8 allows multiple subdirs to be pulled from the some repository.
This shares common build options across various targets, to make it easier to be
consistent (e.g., this caught a number of warnings because `-Wall` hadn’t been
applied to all targets. It also helps highlight the difference between otherwise
similar targets.

Unfortunately, you can’t share stanzas between cabal files, so the `defaults`
stanza is duplicated in every package. We’ll need something like
[hpack-dhall](https://github.com/cabalism/hpack-dhall) to fix that.
This has been around since 2.0, and adopting it is long overdue. This mostly
doesn’t change bounds, but bumps the lower bound on `base` to eliminate some
that we don’t actually support.
@sellout sellout merged commit 69516c0 into master Feb 7, 2024
242 checks passed
@sellout sellout deleted the cabal-file-improvements branch February 7, 2024 05:35
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.

1 participant