fix(nix): use nixpkgs pgbackrest instead of a from-source build - #2267
Draft
hunleyd wants to merge 6 commits into
Draft
fix(nix): use nixpkgs pgbackrest instead of a from-source build#2267hunleyd wants to merge 6 commits into
hunleyd wants to merge 6 commits into
Conversation
nix/packages/default.nix's pg-backrest output was a raw passthrough to nixpkgs.legacyPackages.pgbackrest, so the AMI and multigres Docker images got whatever version nixpkgs-unstable happened to have pinned, with no control over optional build features. Add nix/packages/pgbackrest.nix, a from-scratch meson/ninja build pinned to pgBackRest 2.58.0 (latest stable), mirroring the wal-g.nix pattern of an explicit, version-pinned source build. libzstd is forced enabled (not left on meson's "auto" detection) and libssh2/SFTP is disabled since only S3 is needed for now; S3/GCS/Azure support itself isn't meson-gated so nothing else changes there. Registers the new derivation in nix/packages/default.nix and adds it to the enumerated build-check list in nix/checks.nix (mirroring wal-g-2) so CI verifies it builds. No changes needed in ansible/tasks/setup-pgbackrest.yml or Dockerfile-multigres: both consume the pg-backrest flake output by name and continue to get a pgbackrest binary in $out/bin.
PostgreSQL Extension Dependency Analysis: PR #2267
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2267
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
hunleyd
marked this pull request as ready for review
July 12, 2026 23:45
brainrake
requested changes
Jul 13, 2026
Collaborator
There was a problem hiding this comment.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pg/pgbackrest/package.nix
- Latest pgbackrest 2.58.0 is in nixpkgs. Use this please.
- If not good and need eg. different build options, lease override nixpkgs package instead of copying it verbatim, unless there is a blocker. Lower maintenance burden.
- Add pgbackrest src repo as a non-flake input to the flake. This way hashes are managed using default tools in the lockfile instead of manually.
Collaborator
|
If we need to update nixpkgs, lets prioritize that, it needs to be done in any case. Doing the chores is preferable to deep special casing. Special casing will only make it more difficult to stay up to date, which we need to do anyway to bring in stack wide security updates. |
nixpkgs already tracks pgbackrest releases directly and carries 2.58.0 on current nixos-unstable, so the from-scratch meson build added in this PR duplicated a recipe nixpkgs already maintains. Per review feedback, drop nix/packages/pgbackrest.nix and go back to the legacyPackages passthrough for pg-backrest, and bump the nixpkgs flake input so that passthrough resolves to 2.58.0 now rather than waiting for the monthly update-flake-lock automation.
… add The monthly update-flake-lock.yml automation hit the same nixpkgs-jump breakage independently (confirmed by Marton in Slack), so it's being tracked and fixed there instead of bundled into this PR. Reverting flake.lock to develop's current nixpkgs pin unblocks nix-eval CI here; pg-backrest still resolves via the plain nixpkgs.legacyPackages passthrough and will pick up 2.58.0 whenever that separate nixpkgs bump lands.
hunleyd
enabled auto-merge
July 13, 2026 16:47
hunleyd
marked this pull request as draft
July 13, 2026 17:05
auto-merge was automatically disabled
July 13, 2026 17:05
Pull request was converted to draft
…e-nix-pkg-for-pgbackrest
Contributor
Author
This comment has been minimized.
This comment has been minimized.
pg-backrest only ships on Linux AMIs/images (ansible/tasks/setup-pgbackrest.yml, Dockerfile-multigres); it doesn't need a darwin CI build. Move it into the existing pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) block instead of the unconditional check list.
…nix-pkg-for-pgbackrest * origin/develop: (36 commits) Lots of bootstrap script clean ups (#2326) ci: Fix nix-build PUSH_TO_CACHE (#2345) ci/nix-install-ephemeral: Drop sticky disk config (#2346) chore: bump postgres_release to cut fresh AMIs (includes #2334) (#2349) fix(multigres): stop base config data_directory from overriding pooler data dir (#2344) fix(cron): remove unnecessary TRIGGER grant on cron.job_run_details from postgres (#2334) chore: enable extension version restriction (warn) and cut AMIs (#2315) feat(nix): add site-env packages for rolling instance updates (#2283) ci: resolve package install sha from a flake input override (#2327) fix(multigres): remove dangling wal-g include from postgresql.conf (#2338) fix: Allow test CI pipelines to use old Int CA access. For staging only (#2330) chore(nix): remove maintainers field from package definitions (#2280) chore: bump multigres to b713432 (#2323) ci: Use arm-native-runner for kvm builds on aarch64-linux (#2319) Whole lot of ansible clean up (#2272) fix(ansible): drop no-op zpool loop item from zswap task (#2322) ci: Fix dockerhub-release-matrix matrix generation (#2320) chore: bump pgctld (#2318) fix(ansible): skip zswap params the kernel does not expose (#2321) feat(docker): add Dockerfile-supabase base image and rewrite Dockerfile-multigres as layered image (#2160) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg-backrestto the Linux-only CI build-check list innix/checks.nix— verifies thepg-backrestflake output builds, catching a break at CI time instead of first surfacing during an AMI build.pg-backrestpackage itself (nix/packages/default.nix, a plain passthrough ofnixpkgs.legacyPackages.<system>.pgbackrest) already landed ondevelopindependently via Update nixpkgs #1714 — this PR does not change it.nix/packages/pgbackrest.nix) to pin an exact version and mesonFlags; that was reverted in favor of the nixpkgs passthrough, so no from-source recipe remains.ansible/tasks/setup-pgbackrest.ymlinstalls vianix profile install github:supabase/postgres/{{ git_commit_sha }}#pg-backrest, locked to the exact postgres repo commit.Dockerfile-multigresconsumes the same flake output by name.flake.lockupdate automation that ci: fix update-flake-lock workflow (app token + update-flake-lock action) #2281 (PSQL-1388) is fixing, and is tracked separately in MUL-129 — informational only, not a merge blocker for this PR, since this diff makes noflake.lockchange.nix-eval / evalis a required check that evaluates thechecksoutput this PR addspg-backrestto. If a future nixpkgs bump ever breaks pgbackrest at eval time (not just build time), that shows up asnix-evalgoing red on an unrelated PR — this repo has hit that failure mode once already (seec261fda8, this branch's own revert of a nixpkgs bump for the same reason).Resolves INDATA-520, using the plain nixpkgs passthrough rather than a from-source build.
Test plan
nix build .#pg-backrestsucceedsnix build .#checks.<linux-system>.pg-backrestsucceeds