Skip to content

NixSupport: fall back to default postgresql-binary / text-builder - #2874

Open
mpscholten wants to merge 3 commits into
masterfrom
nixpkgs/hasql-versioned-attr-fallback
Open

mpscholten wants to merge 3 commits into
masterfrom
nixpkgs/hasql-versioned-attr-fallback

Conversation

@mpscholten

Copy link
Copy Markdown
Member

Why

The upcoming nixpkgs haskell-updates merge — NixOS/nixpkgs#521260, "haskellPackages: stackage LTS 24.38 -> Nightly 2026-09-13; ghc: 9.10.3 -> 9.12.5-rc3", merged into staging on 2026-11-13 and currently riding NixOS/nixpkgs#588926 towards master — makes postgresql-binary 0.15.0.1 and text-builder 1.0.0.5 the defaults of the Haskell package set.

As a consequence its configuration-hackage2nix/main.yaml drops the text-builder < 1 extra-package entry and moves postgresql-binary < 0.14 to < 0.15. The versioned attributes NixSupport/hasql.nix forces no longer exist, and evaluating IHP against that snapshot fails:

error: attribute 'text-builder_1_0_0_5' missing
at NixSupport/hasql.nix:20:20

What

Use the versioned attribute only when the snapshot still provides it, falling back to the default otherwise. Both paths resolve to the versions hasql 2.0.1.0 (postgresql-binary >=0.15 && <0.16) and postgresql-simple-postgresql-types (text-builder >=1.0.0.5 && <1.1) require, so this is a no-op on the currently pinned nixpkgs and unblocks the next nix flake update.

Verification

nix eval of .#packages.aarch64-darwin.default.drvPath and of every attribute in .#checks.aarch64-darwin succeeds against both:

  • the pinned nixpkgs 387118a (nixpkgs-unstable, 2026-10-18) — unchanged derivation paths
  • nixpkgs staging-next f3a7f2c, which carries the merge — previously failed on the missing attribute

Not covered here: an actual build against the new snapshot. The merge also brings http-client-tls 0.4.0, resource-pool 0.5.1.0, random 1.3.1, wai-app-static 3.2.1 and QuickCheck 2.16.0.0, whose effects only show up at compile time. Those belong to the later nixpkgs bump, which should also consider moving pkgs.ghc off the explicit haskell.packages.ghc9124 pin: after the merge the nixpkgs default becomes GHC 9.12 (ghc9125), and only the default package set is served by cache.nixos.org.

🤖 Generated with Claude Code

The upcoming haskell-updates merge (NixOS/nixpkgs#521260, stackage
LTS 24.38 -> Nightly 2026-09-13) makes postgresql-binary 0.15.0.1 and
text-builder 1.0.0.5 the defaults of the Haskell package set. Its
main.yaml drops the `text-builder < 1` extra-package entry and moves
`postgresql-binary < 0.14` to `< 0.15`, so the versioned attributes
this overlay forces (`text-builder_1_0_0_5`,
`postgresql-binary_0_15_0_1`) no longer exist and evaluation fails
with `attribute 'text-builder_1_0_0_5' missing`.

Use the versioned attribute only when the snapshot still provides it
and fall back to the default otherwise. Both resolve to the versions
hasql 2.0.1.0 and postgresql-simple-postgresql-types require, so this
is a no-op on the currently pinned nixpkgs while unblocking the next
nixpkgs bump.

Verified with `nix eval .#packages.aarch64-darwin.default.drvPath` and
`.#checks.aarch64-darwin` against both the pinned nixpkgs (387118a) and
nixpkgs staging-next (f3a7f2c), which carries the merge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T13:30:45.198201Z ef5b791 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

`status426` is defined in Network.HTTP.Types.Status, but the umbrella
module Network.HTTP.Types only re-exports everything since http-types
0.12.5 ("Export everything from Network.HTTP.Types"). The pinned
nixpkgs ships 0.12.4, so registering this spec in the test suite
(e3bdd07) left master red:

    error: [GHC-88464]
      Variable not in scope: status426

`mkStatus` is exported by the umbrella module in 0.12.4 as well, so
build the status value directly and stay independent of the http-types
version. The upcoming stackage bump ships 0.12.6, where either spelling
would work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mpscholten

Copy link
Copy Markdown
Member Author

CI on the first push failed in checks.aarch64-darwin.default (and, from the same derivation, in core-size), but not because of this PR: master has been red since fe7326b (2026-11-08, run 42490049391).

error: [GHC-88464]
  Variable not in scope: status426

ihp/Test/Test/ServerSpec.hs uses status426, which is defined in Network.HTTP.Types.Status but not re-exported by the umbrella module Network.HTTP.Types until http-types 0.12.5 ("Export everything from Network.HTTP.Types"). The pinned nixpkgs ships 0.12.4, so the spec stopped compiling when it was registered in the test suite in e3bdd07.

c111ad2 builds the status with mkStatus 426 "Upgrade Required" instead; mkStatus is exported by the umbrella module in 0.12.4 too, so this is independent of the http-types version. Worth noting for the topic of this PR: the upcoming stackage bump ships http-types 0.12.6, where the original spelling would have worked as well.

master landed the same ServerSpec fix in #2875, so the only conflict was
this branch's extra comment on the 'mkStatus' line. Resolved to master's
wording — its commit message already explains why 'status426' can't be
used — which leaves this branch carrying only the hasql.nix change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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