Skip to content

hadolint, at upstream commit 1d901b9, for linux amd64 and arm64: a static GPL-3 binary with its source offer - #82

Merged
closer-claudio merged 1 commit into
mainfrom
claudio/20261115-hadolint
Nov 16, 2026
Merged

closer-claudio merged 1 commit into
mainfrom
claudio/20261115-hadolint

Conversation

@closer-claudio

@closer-claudio closer-claudio commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Why

A consumer's differential needs hadolint as an oracle at one exact commit of upstream's master, 1d901b9. No release carries it: the last one, 2.15.1, is 51 commits behind and differs in the JSON formatter and eight rules, so a differential against it would report upstream's own history as the consumer's defects.

🛠️ What

  • The recipe (hadolint/): the way upstream builds its own static release, in an alpine container with GHC 9.10.2 and cabal, --enable-executable-static. build.sh starts the container, in-container.sh runs in it, smoke.sh runs the result.
  • Its inputs, and how each is held:
    • the image by digest (hadolint/versions.env);
    • the source, GHC and cabal-install in pins.yaml, GHC's tarballs through the release manager's PGP signature;
    • every alpine package the container holds once the build's own are installed (76, the same on both architectures), the linker and the assembler as much as the libraries, compared with hadolint/apk.lock: the build stops when alpine has moved one;
    • the Haskell dependencies by cabal.project.freeze and an index-state of our own (upstream commits neither); the build freezes again and stops if the plan differs.
  • What is in the binary, measured: the link writes its map, every archive and object it names is asked of apk, and the set has to be hadolint/apk-linked's: musl-dev, gmp-static, gcc (its start files) and libgcc-static. zlib, libstdc++ and ncurses are installed and the linker takes nothing from them.
  • Native build groups (.justfile, ci.yaml, release.yaml): GHC compiles for the machine it runs on, so native_groups are built on a runner of each linux architecture, for that runner's platform alone. just build-matrix gives the workflows objects (tools, runner, name) where it gave strings.
  • What a GPL-3 static binary owes, in the archive:
    • LICENSE (GPL-3) and COPYING.LESSER (LGPL-3, for GMP, linked in through GHC's integers);
    • NOTICES, from the build's own plan: the libraries the executable depends on, to the end (of a package cabal builds whole, the libraries' dependencies alone: a Setup's are not linked), each with the licence files at the top of its source archive or of GHC's release; and the texts kept in hadolint/licenses by version for what those do not carry: musl, gcc's runtime exception, the libffi GHC links into its runtime, the xxHash that hashable compiles into itself;
    • SOURCE, the offer of the corresponding source: hadolint at the commit, GHC's source archive, each Hackage package, each alpine package with the commit of aports that built it, and this recipe.
  • README.md, hadolint/README.md, the release notes' source section, and the sentences of the workflows and the README that said every tool is cross-compiled by one host with no container.

🧪 How

  • V: on both architectures the archive is the same bytes built twice in one job (just rebuild, in the build legs), and the same sha256 in two attempts of this run: amd64 b09dd7dd…, arm64 15491a25….
  • V: the build's own line, both legs, both attempts: "in the binary: 21 packages of GHC's, 97 of Hackage's, and of alpine's: gcc-15.2.0-r5 gmp-static-6.3.0-r4 libgcc-static-15.2.0-r5 musl-dev-1.2.6-r3".
  • V: the link-map check, shown failing: with apk-linked naming zlib-static and not libgcc-static, both legs stopped on the difference (run 43806200271, an earlier cut of this change); the list is now what was measured.
  • V: the smoke test, in the build legs: Haskell Dockerfile Linter 2.15.1, the JSON report of DL3006, the three files beside the binary, the xxHash part, and neither NOTICES nor SOURCE naming cabal-doctest, which only xml-conduit's Setup uses.
  • V: libffi is in the binary: nm of the unstripped binary has ffi_call, and GHC 9.10.2 carries libffi 3.4.6 (libffi-tarballs/libffi-3.4.6.tar.gz in its source archive, read from the archive's listing, as are the twenty libraries and the runtime the offer attributes to it).
  • V: just do lint default green here; CI's lint job, with the converge lane my sandbox cannot run, green.

📝 Notes

  • The binary prints the version of upstream's last release, which is not the pin; the README says so.
  • "The same bytes at another time" holds for as long as alpine serves the locked packages. Alpine keeps one version of a package, so a build at an old tag stops when one has moved, and says which.
  • A licence carried only inside a source file (xxHash's, in a header of hashable) is found by reading, not by the build; the README says so.
  • LGPL-3 section 4 is met by its 4(d)(0): the library's source and the application's "object code and/or source code ... needed for reproducing the Combined Work". Nothing in this organisation links the binary; tests run it.
  • cabal-install signs its SHA256SUMS with a detached signature and no tarball, which no verify: method reads, so its two pins are download.
  • A leg takes about fifteen minutes for its two builds; the build job's timeout goes from 30 to 60 minutes.
  • Not in just test: the verify legs would each pay for a compiler's build. The recipe runs the smoke test on what it built.

@closer-claudio
closer-claudio force-pushed the claudio/20261115-hadolint branch from eac1150 to 2121b97 Compare November 16, 2026 03:28
@closer-claudio closer-claudio changed the title hadolint, built from its pinned commit, for linux amd64 and arm64 hadolint, at upstream commit 1d901b9, for linux amd64 and arm64: a static GPL-3 binary with its source offer Nov 16, 2026
@closer-claudio
closer-claudio force-pushed the claudio/20261115-hadolint branch 2 times, most recently from 11bd0d8 to fe3a887 Compare November 16, 2026 06:01
@closer-claudio

Copy link
Copy Markdown
Contributor Author

Reviewed at fe3a887

@closer-claudio
closer-claudio marked this pull request as ready for review November 16, 2026 06:23
A consumer's differential needs hadolint as an oracle at one exact
commit of upstream's master (1d901b9), which no release carries: the
last one, 2.15.1, is 51 commits behind and differs in the JSON
formatter and eight rules. So it is built here, for linux alone, the
way upstream builds its own static release: in an alpine container,
GHC 9.10.2 and cabal, `--enable-executable-static`.

Its inputs, and how each is held. The image by digest
(hadolint/versions.env). The source, GHC and cabal-install in
pins.yaml, GHC's tarballs through the release manager's PGP signature;
cabal-install signs its SHA256SUMS with a detached signature, which no
verify method reads, so it is `download`. The alpine packages are
installed into the image at whatever alpine serves, the linker and the
assembler as much as the libraries, so every package the container
then holds (76, the same on both architectures) is compared with
hadolint/apk.lock and the build stops when one moved. Alpine keeps one
version of a package: a build at an old tag stops then, and says which.
The Haskell dependencies by a freeze file and an index-state of our
own, since upstream commits neither and resolves on the day of the
build; the build freezes again and stops if the plan differs.

Which alpine packages are in the binary is measured, not listed: the
link writes its map, every archive and object the map names is asked
of apk, and the set has to be hadolint/apk-linked's: musl-dev,
gmp-static, gcc (its start files) and libgcc-static. zlib and libstdc++
are installed and the linker takes nothing from them; ncurses neither.

GHC compiles for the machine it runs on. The build groups gain a
second kind, native_groups: a group of it is built on a runner of each
linux architecture, for that runner's platform alone, and
`just build-matrix` gives the workflows objects (tools, runner, name)
where it gave strings. `just hadolint` passes over every platform that
is not the host's linux one.

The binary is GPL-3 and statically linked, so the archive is a GPL
work and carries what that asks:
- LICENSE (GPL-3) and COPYING.LESSER (LGPL-3): GMP is linked in through
  GHC's integers, and the LGPL's section 4 is met by its 4(d)(0), the
  library's source and the application's "object code and/or source
  code ... needed for reproducing the Combined Work";
- NOTICES, from the build's own plan: the libraries the executable
  depends on, to the end, each with the licence files at the top of its
  source archive (Hackage) or of GHC's release. Of a package cabal
  builds whole, the libraries' dependencies alone are followed: its
  Setup's are not linked (xml-conduit's asks for Cabal and
  cabal-doctest). And the texts kept in hadolint/licenses by version
  for what those files do not carry: musl, gcc's runtime exception, the
  libffi GHC links into its runtime, and xxHash, which GHC's runtime
  and hashable each compile into themselves from a header that carries
  its terms. A package with no
  licence file, or a version with no text, stops the build. A licence
  carried only inside a source file is found by reading, as that one
  was, not by the build;
- SOURCE, the offer of the corresponding source, in the archive so that
  one passed on without its release page still carries it: hadolint at
  the commit, GHC's source archive (its libraries and its libffi are in
  it: read from the archive's listing), each Hackage package, each
  alpine package with the commit of aports that built it (from apk's
  own database), and this recipe.

hadolint/smoke.sh runs the binary on a fixed Dockerfile, requires the
JSON report of DL3006, the three files beside it, the xxHash part, and
that neither file names cabal-doctest. It runs where the binary is
built, in the recipe, and on the published archive in the release's
smoke legs; `just test` does not pay for a compiler's build.

The sentences of the workflows and of the README that said every tool
is cross-compiled by one host, with no container, say the exception.

Measured in CI: on both architectures the archive is the same bytes
built twice in one job (`just rebuild`), and the same bytes in a
second, separate run of the same commit, the same day. At another
time it is the same bytes for as long as alpine serves the locked
packages, and the build stops when it does not. A leg takes about
fifteen minutes for its two builds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: closer-claudio <claudio@farcloser.world>
@closer-claudio
closer-claudio force-pushed the claudio/20261115-hadolint branch from fe3a887 to 2d7d421 Compare November 16, 2026 06:54
@closer-claudio

Copy link
Copy Markdown
Contributor Author

Reviewed at 2d7d421

1 similar comment
@closer-claudio

Copy link
Copy Markdown
Contributor Author

Reviewed at 2d7d421

@closer-claudio
closer-claudio merged commit c59fa56 into main Nov 16, 2026
27 checks passed
@closer-claudio
closer-claudio deleted the claudio/20261115-hadolint branch November 16, 2026 08:28
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.

2 participants