pgbuild
GitHub Actions workflows that build PostgreSQL and its dependencies for the
pgAdmin build farm, on both Windows and macOS. A few build tools are packaged
alongside them, being Meson, Ninja, pkgconf, winflexbison and diffutils on
Windows and Meson and Ninja on macOS; most of those are downloaded as pre-built
utilities rather than compiled here.
This repository began life as dpage/winpgbuild,
which built the Windows side only, and its history is preserved here. The macOS
builds replace a set of Jenkins jobs that pgAdmin is retiring as it moves its
build farm onto GitHub Actions.
Licence
The build scripts and workflows in this repository are released under the
PostgreSQL licence; see LICENSE.
That licence covers this repository only. The release assets these
workflows publish are builds of third-party software, each of which carries its
own upstream licence, and redistributing them means complying with those rather
than with the licence above. Every package records its upstream licence in
manifest.json, as a licence URL pointing at the canonical
licence text and an spdx_license expression naming it.
Build status
These are the workflows that run on a schedule, so these are the badges that
mean anything.
| Workflow |
Status |
| Build All (Windows) |
|
| Build All (macOS) |
|
Nothing else here carries a badge, deliberately. Every other workflow is
called rather than run in its own right, and GitHub attributes a
workflow_call run to the caller, so their badges show either "no status" or,
worse, a stale green from whenever somebody last dispatched one by hand.
Either way it says nothing about last night's build. manifest.yml, which
supplies the versions to all of them, has no trigger but workflow_call at
all, so its badge could never be anything but grey.
The two above cover the lot: when a package fails, its orchestrator goes red.
What gets built
The Windows side builds more than pgAdmin itself needs, on the principle that
if we are building PostgreSQL's dependencies anyway then the results may as
well be available to anyone else who wants them. macOS is expected to catch
up, so a "not yet built" below is a gap rather than a decision.
PostgreSQL
Complete builds, linked against everything below rather than against
whatever the build machine happened to have.
Libraries
The dependencies PostgreSQL links, built here so that the result is the
same everywhere and does not vary with the machine.
Build tools
Needed to run the builds rather than shipped by them, and mostly repackaged
pre-built utilities rather than compiled here. Windows packages all of them
because it has none of them to hand; macOS takes from the runner those whose
version makes no difference to the output, and packages Meson, whose version
does, with Ninja beside it because Meson has no other backend. winflexbison is
the exception to the catch-up: it is a Windows port of flex and bison, so there
is nothing to port on macOS.
Bundles
One archive carrying the libraries together, for anyone who would rather
fetch a single file than assemble one.
The two bundles do not hold quite the same thing. The Windows one carries the
build tools as well as the libraries, because unpacking it is how a Windows
machine acquires a Meson, a Ninja and a pkgconf at all; the macOS one carries
libraries only, for the reason given below.
"system" means the copy in macOS itself, in /usr/lib, which PostgreSQL links
directly, and it is a claim about that one package rather than about the
platform: what macOS provides is not always the same library by another name.
libiconv was listed as system until gettext proved otherwise, macOS shipping an
iconv of its own that is not GNU libiconv, and gettext needing the GNU one to
link libtextstyle. It is built here now like anything else. zlib is still
genuinely the system copy, nothing so far having shown it to be anything but.
"system" does not mean Homebrew. Nothing here depends on Homebrew being
installed, deliberately: the point of publishing these builds is that they work
for somebody using MacPorts or Fink, or nothing at all. The macOS PostgreSQL
build goes further and puts its own include directories ahead of Homebrew's, so
that a runner image which happens to ship Homebrew copies of zstd and lz4
cannot quietly get them compiled in.
"Homebrew" in the build tools table is the other half of that same policy
rather than a contradiction of it, and what separates the two is whether the
software ends up inside a release asset. A library does, since anybody linking
against these builds gets whatever we linked, so it has to come from a source
we control. A build tool does not: it is used during the build and then thrown
away, and which pkgconf or diffutils the runner happened to provide makes no
difference to what anyone downloads. Taking those from Homebrew on the runner
therefore costs a consumer on MacPorts, on Fink or on nothing at all precisely
nothing, whereas taking a library from it would cost them the build.
Meson is the tool held to the library standard, not because it ships but
because it generates PostgreSQL's build system, so which Meson generated a
build is part of what makes that build reproducible; that is why its version is
pinned in manifest.json like a library's and built here rather than taken from
the runner. Ninja is built alongside it only because Meson has no other backend.
Neither is used by anything in this repository today, the macOS PostgreSQL build
being configured with ./configure rather than Meson; they are published so
that a pinned Meson is to hand if that changes, and for anyone else who wants
one. That is also why the macOS dependency bundle leaves them out: it is the set
of libraries in one archive, and mixing tooling into it would blur the line the
rest of this section draws.
ICU is the one that had to be built before it could be used: the macOS
PostgreSQL build was configured --without-icu whilst there was no ICU of ours
to link, and now that icu-macos.yml builds one it configures --with-icu
against that, rather than against whatever the machine happens to have.
Layout
GitHub does not support subdirectories under .github/workflows/, so the
platform lives in the filename rather than in a directory. Every leaf workflow
is named <package>-<platform>.yml, giving openssl-windows.yml,
openssl-macos.yml and so on, and each platform has its own orchestrator.
| Workflow |
What it does |
build-all.yml |
Convenience dispatcher; starts both orchestrators and returns |
build-all-windows.yml |
Windows DAG, calling the 19 Windows leaves in dependency order |
build-all-macos.yml |
macOS DAG, calling the 14 macOS leaves in dependency order |
manifest.yml |
Reusable workflow that reads pinned versions out of manifest.json |
<package>-windows.yml |
One Windows package |
<package>-macos.yml |
One macOS package, built for both architectures |
The macOS builds install into /opt/pgbuild/<package>, and the resulting
binaries carry absolute install_name references into that prefix; anything
that relocates them into an application bundle will need to rewrite those.
Reusable workflow limits