Skip to content

v0.4.0 — distribution

Choose a tag to compare

@s2x s2x released this 17 Aug 19:24
· 3 commits to main since this release

Supports liblbug 0.19.x. This release is about getting the client onto machines that are not a
development checkout. Nothing in the query path changed.

Four ways to install

needs speed
FFI ext-ffi + liblbug on disk baseline
prebuilt binary (below) matching PHP version fastest
pie install crazy-goat/ladybug-ext toolchain + liblbug on disk fastest
build from source phpize, C toolchain, 80 MB archive fastest
composer require crazy-goat/ladybug-php

The package is on Packagist, so no
repositories entry is needed any more.

Prebuilt binaries

Attached below: ladybug.so for PHP 8.2, 8.3, 8.4 and 8.5 on linux-x86_64, linux-aarch64
and macos-arm64, with SHA256SUMS. The PHP version has to match exactly. liblbug is linked
in, so nothing else is needed on the machine — which is also why each one is around 20 MB.

Static linking is a correctness requirement here, not a size preference: it is the only linkage
immune to the INSTALL crash fixed in 0.3.1. A shared-linked extension segfaults on any host
with intl loaded.

Every binary is verified before it is attached — no liblbug dependency, no stray libstdc++
exports, both suites passing with intl in the process, and a clean-room run that queries
through the extension with liblbug moved off the machine entirely.

PIE

The extension is published separately as
crazy-goat/ladybug-ext, generated from
ext/ on each release. PIE requires an extension's Composer name to differ from any regular
package's, so it needs its own repository; that one is a mirror and issues belong here.

bash tools/fetch-liblbug.sh 0.19.1 --static
pie install crazy-goat/ladybug-ext --enable-ladybug-static --with-liblbug="$PWD/lib"

Two bugs found by building what we distribute

  • Linking liblbug.a re-exported 281 std:: symbols and 23 STB_GNU_UNIQUE locale facet ids,
    which would have made this extension the first half of the crash it avoids: glibc binds unique
    symbols process-wide and ignores RTLD_DEEPBIND. -Wl,--exclude-libs,ALL removes them and
    breaks LOAD json, because LadybugDB's downloaded extensions resolve 91 lbug:: symbols from
    whoever loaded liblbug. ext/ladybug.map splits by owner instead of by language.
  • PIE runs ./configure with no arguments unless the installer names a declared option, and
    PHP_ARG_ENABLE([ladybug]) defaulted to no — a bare configure planned a build of nothing and
    exited 0, so pie install would have reported success and installed no extension.

Also: the extension reported version 0.1.0 through three releases. It is 0.4.0 now, with a
test to keep it current.

The INSTALL crash diagnosis from 0.3.1 is confirmed on x86_64 as well; every measurement
behind it had been taken on arm64.