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

hpack: 0.36.1 -> 0.37.0 #364979

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

Conversation

9999years
Copy link
Contributor

The latest version of Haskell's hpack is 0.37.0. Increasingly .cabal files begin with a comment that causes Nixpkgs' hpack to reject them entirely:

-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack
$ hpack
shellwords.cabal was generated with a newer version of hpack, please upgrade and try again.

Unfortunately, hpack's --force option does not override this error; you need to remove the .cabal file in question manually, which can be annoying in repositories with many package.yaml files.

Using the latest version of hpack, which is provided by Nixpkgs but not set as the default for unclear reasons. hpack ==0.36.1 is listed as a constraint in
pkgs/development/configuration-hackage2nix/stackage.yaml, but pkgs/development/haskell-modules/configuration-common.nix makes sure to set hpack = self.hpack_0_37_0 for Stack itself.

See: pkgs/test/haskell/upstreamStackHpackVersion/default.nix

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

The latest version of Haskell's `hpack` is 0.37.0. Increasingly `.cabal`
files begin with a comment that causes Nixpkgs' `hpack` to reject them
entirely:

```
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack
```

```
$ hpack
shellwords.cabal was generated with a newer version of hpack, please upgrade and try again.
```

Unfortunately, `hpack`'s `--force` option does not override this error;
you need to remove the `.cabal` file in question manually, which can be
annoying in repositories with many `package.yaml` files.

Using the latest version of `hpack`, which is provided by Nixpkgs but
not set as the default for unclear reasons. `hpack ==0.36.1` is listed
as a constraint in
`pkgs/development/configuration-hackage2nix/stackage.yaml`, but
`pkgs/development/haskell-modules/configuration-common.nix` makes sure
to set `hpack = self.hpack_0_37_0` for Stack itself.

See: pkgs/test/haskell/upstreamStackHpackVersion/default.nix
then
haskellPackages.hpack_0_37_0
else
lib.warn "`hpack` is newer than `hpack_0_37_0`. Please remove the override in Nixpkgs: ${builtins.toPath ./package.nix}" haskellPackages.hpack;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a warning here in case hpack gets updated past 0.37.0 without us noticing.

@9999years
Copy link
Contributor Author

@sternenseemann Do you know why hpack is pinned to 0.36.1? I'm not super clear on the hackage2nix machinery so there might be some context I'm missing.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 13, 2024
@sternenseemann
Copy link
Member

We inherit the hpack version from Stackage which restricts hpack to a specific version range that doesn't cause brakage according to PVP. hpack's library only has few reverse dependencies so we can probably use the latest version by default to begin with, e.g.:

# Drop restrictions on some tools where we always want the latest version.
sed -r \
-e '/ cabal2nix /d' \
-e '/ distribution-nixpkgs /d' \
-e '/ jailbreak-cabal /d' \
-e '/ language-nix /d' \
-e '/ hackage-db /d' \
-e '/ cabal-install /d' \
-e '/ cabal-install-solver /d' \
-e '/ lsp /d' \
-e '/ lsp-types /d' \
-e '/ lsp-test /d' \
-e '/ hie-bios /d' \
-e '/ ShellCheck /d' \
-e '/ Agda /d' \
-e '/ stack /d' \
< "${tmpfile_new}" >> $stackage_config

@9999years
Copy link
Contributor Author

@sternenseemann Thanks! It looks like hpack has been upgraded to 0.37 in the latest Stackage LTS ("LTS 23.0 for ghc-9.8.4, published 4 days ago"). Should I run maintainers/scripts/haskell/update-stackage.sh and open a PR to haskell-updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: clean-up 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants