8000 next: fix sharp FTBFS — glib dep + surface glib paths to native build (unblock #240 cascade) by bryan-minimal · Pull Request #242 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

next: fix sharp FTBFS — glib dep + surface glib paths to native build (unblock #240 cascade) - #242

Merged
bryan-minimal merged 6 commits into
mainfrom
fix-next-glib-build-dep
Jun 12, 2026
Merged

bryan-minimal merged 6 commits into
mainfrom
fix-next-glib-build-dep

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Jun 12, 2026 •
Copy link
Copy Markdown
Member

What

Unblocks the next rebuild triggered by the base-soup bundle (#240). Three coupled fixes — next won't build without all three:

  1. packages/next/build.ncl — add glib to build_deps + runtime_deps (puts glib's headers, glib-2.0.pc, libglib.so in the sandbox/runtime closure).
  2. packages/next/build.sh — surface glib's include/lib paths to the sharp native compile.
  3. packages/libvips/build.ncl — bump 8.18.2 → 8.18.3 (sha verified against upstream .sha256sum).

Why — latent FTBFS surfaced by the cascade (NOT a binutils/coreutils defect)

The bundle (#240) forced the toolchain closure to rebuild, including next. This was the first genuine recompile of next since #161; every build since was a cache hit — which is why it appeared fine recently. The true rebuild compiles sharp from source against the system libvips, and exposed two pieces of accumulated drift. Diagnosed across three buildbot rounds, each error advancing past the last:

(a) glib-object.h: No such file — fixed by parts 1+2

vips/vips8 is a public libvips header that #includes <glib-object.h>, but vips-cpp.pc lists glib under Requires.private. sharp's node-gyp build runs a non-static pkg-config --cflags vips-cpp, which doesn't expand private requires — so glib's -I/usr/include/glib-2.0 was never on the compile line. Adding glib to the deps put the headers in the sandbox; build.sh now exports them via CPATH (read by gcc directly, independent of node-gyp's Makefile flag handling) + CXXFLAGS/LDFLAGS.

(b) "libvips version 8.18.3+ is required" — fixed by part 3

With the headers found, the compile advanced to sharp's version assertion. next/build.sh installs sharp unpinned (always latest); sharp 0.35.1 hard-requires libvips ≥ 8.18.3, released only 2026-06-09. Our package was pinned at 8.18.2 → assertion failure. Bumped to 8.18.3 (the version sharp's libvips-cpp-8.18.3.stamp expects).

Residual uncertainty (buildbot is the judge)

  • I can't reproduce the sharp build locally (clean-room VM stalled on spin-up), so the buildbot verdict is the truth.
  • Confirmed fixed: glib header (round 2 got past it) → libvips version (round 3 error). The remaining unknown is the link step; .node addons usually tolerate undefined glib symbols (resolved at load via libvips → libglib) and I've added LDFLAGS anyway. If link surfaces something, it's a one-line follow-up here.

Follow-up worth filing (not in this PR)

next/build.sh's npm install --ignore-scripts sharp is unpinned — this exact break (sharp bumps its min-libvips, we lag) will recur. Pinning sharp to a known-good version in the install line would make the build reproducible. Flagging for a separate hardening PR.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Bump binutils to 2.46.1.
    • Bump coreutils to 9.11.
    • Bump libvips to 8.18.3.
    • Add glib to the "next" package build/runtime to improve native image-processing builds so required native headers/libs are found during build.

bryan-minimal and others added 2 commits June 11, 2026 17:23
…ndle)

Bundled per the base-soup rule: binutils and coreutils are both in the
circularly-dependent toolchain, so the cascading rebuild should land as one
unit. glibc has an update available too but is intentionally deferred to a
separate change.

Both mirrored to gs://minimal-staging-archives and sha-verified against
upstream ftp.gnu.org (.tar.xz):
  binutils-2.46.1.tar.xz  e127a709...  (matches upstream)
  coreutils-9.11.tar.xz   394024ed...  (matches upstream)

Note: coreutils' tarball was manually verified/corrected — pkgmgr's GNU-FTP
listing parser resolved the .tar.gz when .tar.xz was also available, so the
.xz here was re-mirrored + sha-checked by hand. Parser-preference fix is a
separate pkgmgr follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…build)

The base-soup bundle (#240) forced the first genuine rebuild of `next`
since #161 — prior "builds" were cache hits. The rebuild compiles
`sharp` from source against the system libvips, and libvips's public
header `vips/vips8` #includes <glib-object.h>. `next` had libvips only
as a runtime_dep (which does surface vips8 in the sandbox) but no glib,
so glib's headers + glib-2.0.pc were absent and sharp FTBFS on both
arches:

  /usr/include/vips/vips8:41:10: fatal error: glib-object.h: No such file

glib is vips-cpp.pc's public `Requires`; the image-format libs
(expat/jpeg/png/webp/lcms2) are `Requires.private` and aren't pulled in
for a dynamic compile, so glib alone should satisfy the chain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot commented Jun 12, 2026 •
Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: db38c4fc-65cc-4bd1-b2c6-4d509630241f

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2d075 and 81ceb6a.

📒 Files selected for processing (1)
  • packages/libvips/build.ncl
✅ Files skipped from review due to trivial changes (1)
  • packages/libvips/build.ncl

📝 Walkthrough

Walkthrough

Bumps binutils to 2.46.1, coreutils to 9.11, and libvips to 8.18.3 (updating their source sha256 checksums). Adds glib as a build/runtime dependency for next and wires pkg-config-derived CPATH/CFLAGS/LDFLAGS in packages/next/build.sh for the sharp native build.

Changes

Package dependency and version updates

Layer / File(s) Summary
Binutils version and checksum update
packages/binutils/build.ncl
Binutils version is bumped to 2.46.1 and the staged source tarball sha256 is updated to match the new release.
Coreutils version and checksum update
packages/coreutils/build.ncl
Coreutils version is bumped to 9.11 and the upstream tarball sha256 is updated to match the new release.
Libvips version and checksum update
packages/libvips/build.ncl
Libvips version is bumped to 8.18.3 and the release tarball sha256 is updated to match the new release.
Next package glib dependency addition and build wiring
packages/next/build.ncl, packages/next/build.sh
next now imports ../glib/build.ncl, adds glib to build_deps and runtime_deps, and build.sh exports pkg-config-derived CPATH/CFLAGS/CXXFLAGS/LDFLAGS and LIBRARY_PATH so the sharp native addon can find and link glib.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble at versions, small and bright,
Two bumps, one wiring to make builds right,
Glib flags whisper paths to native land,
Checksums snugly held within my hand,
Hop — the packages bound and light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: adding glib dependency to 'next' package and surfacing glib paths to fix sharp build failure, which aligns with the core modifications in build.ncl and build.sh.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-next-glib-build-dep

Comment @coderabbitai help to get the list of available commands and usage tips.

Adding glib to the dep list put its headers + glib-2.0.pc in the sandbox
but the sharp compile still couldn't find <glib-object.h>: sharp finds
our system libvips via `pkg-config vips-cpp`, and vips-cpp.pc lists glib
under Requires.private — a non-static `pkg-config --cflags vips-cpp`
(what node-gyp uses) doesn't expand private requires, so glib's
-I/usr/include/glib-2.0 was never passed even though libvips's public
header <vips/vips8> #includes <glib-object.h>.

Export glib's include/lib dirs before `node install/build.js`. CPATH /
LIBRARY_PATH are honored by gcc directly (independent of node-gyp's
Makefile flag handling); CFLAGS/CXXFLAGS/LDFLAGS cover the conventional
path. Built from `pkg-config glib-2.0 gobject-2.0`, pure-bash -I parse
(no sed dependency in the sandbox).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bryan-minimal bryan-minimal changed the title next: add glib build/runtime dep (unblock base-soup cascade) next: fix sharp FTBFS — glib dep + surface glib paths to native build (unblock #240 cascade) Jun 12, 2026
next's build.sh installs sharp unpinned (always latest); sharp 0.35.1
hard-requires libvips >= 8.18.3 (released 2026-06-09). Our package was
pinned at 8.18.2, so once the glib include path was fixed the sharp
native build hit its version assertion:

  common.h:23:2: error: "libvips version 8.18.3+ is required"

sha256 verified against the upstream vips-8.18.3.tar.xz.sha256sum asset
(f41285b6...).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@msample msample left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@bryan-minimal
bryan-minimal added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit fb8b3d1 Jun 12, 2026
3 checks passed
@bryan-minimal
bryan-minimal deleted the fix-next-glib-build-dep branch June 12, 2026 18:23
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

0