Standalone jerbuild binaries omit transitive compiled libraries from app.boot #86

Closed
opened 2026-09-20 15:12:21 -04:00 by ober · 2 comments
Owner

Problem

A FreeBSD 15.1 amd64 service built with Jerboa 0.12.10 links successfully but cannot start when a project module imports (std net request). The executable exits before its entry point with:

Exception: library (std pregexp) not found

The same clean rebuild also produced Exception: library (jerboa runtime) not found for another standalone executable. These are runtime boot-image closure failures, separate from the FreeBSD compile-program hang tracked in #78.

Reproduction

  1. Build a standalone native executable whose reachable module graph imports (std net request), e.g. via jerbuild build --config ... or jerbuild binary.
  2. Run the resulting executable with --version.
  3. It can fail before user code with Exception: library (std pregexp) not found.

Adding $JERBOA_HOME/lib to --libdirs, and explicitly importing/referencing (std pregexp) at the entry point, did not make the standalone image start. Removing stale .so/.wpo artifacts instead caused compilation-instance mismatch errors.

Likely cause

The static builder creates app.boot from program.so only. A nested compiled dependency is then absent from the embedded boot image. A successful link is therefore insufficient evidence that the executable can load its complete runtime closure.

Expected behavior

The builder should resolve and bundle the full transitive compiled-library closure in the app boot image, preserving the same compilation instances. Add a regression that builds a small executable using (std net request) and executes it successfully on FreeBSD.

Environment

  • FreeBSD 15.1-RELEASE-p3 amd64 (ta6fb)
  • Jerboa 0.12.10 multicall (~/.local/bin/jerboa)
  • Native jerbuild build / gmake binary
  • Observed 2026-09-20

This blocks deployment of ober/jerboa-botjail 0.6.0 because its Forgejo handoff publisher needs the HTTP client.

## Problem A FreeBSD 15.1 amd64 service built with Jerboa 0.12.10 links successfully but cannot start when a project module imports `(std net request)`. The executable exits before its entry point with: ``` Exception: library (std pregexp) not found ``` The same clean rebuild also produced `Exception: library (jerboa runtime) not found` for another standalone executable. These are runtime boot-image closure failures, separate from the FreeBSD `compile-program` hang tracked in #78. ## Reproduction 1. Build a standalone native executable whose reachable module graph imports `(std net request)`, e.g. via `jerbuild build --config ...` or `jerbuild binary`. 2. Run the resulting executable with `--version`. 3. It can fail before user code with `Exception: library (std pregexp) not found`. Adding `$JERBOA_HOME/lib` to `--libdirs`, and explicitly importing/referencing `(std pregexp)` at the entry point, did not make the standalone image start. Removing stale `.so`/`.wpo` artifacts instead caused compilation-instance mismatch errors. ## Likely cause The static builder creates `app.boot` from `program.so` only. A nested compiled dependency is then absent from the embedded boot image. A successful link is therefore insufficient evidence that the executable can load its complete runtime closure. ## Expected behavior The builder should resolve and bundle the full transitive compiled-library closure in the app boot image, preserving the same compilation instances. Add a regression that builds a small executable using `(std net request)` and executes it successfully on FreeBSD. ## Environment - FreeBSD 15.1-RELEASE-p3 amd64 (`ta6fb`) - Jerboa 0.12.10 multicall (`~/.local/bin/jerboa`) - Native `jerbuild build` / `gmake binary` - Observed 2026-09-20 This blocks deployment of `ober/jerboa-botjail` 0.6.0 because its Forgejo handoff publisher needs the HTTP client.
Author
Owner

Attached: jerboa-issue-86-handoff.md (16,686 bytes; SHA-256 eba792f781e11ef24cc49ba5144ed9631a2d4c72965af764b7ef63f649895028). Downloaded the issue attachment and verified it matches the local Markdown byte for byte.

Important correction to the original diagnosis: the actual CLI builder is jerbuild.ss:do-binary-build; its default release path embeds the whole-program image, rather than using the separate lib/jerboa/build.ss:build-binary app.boot routine. The previously asserted app.boot cause was not established.

The handoff maps upstream master 1cda118d62c1f2e23dbfbcd685fcc82b24433289 (0.12.18), including the existing FreeBSD compilation-path fix from PR #84. The failing host still reports installed multicall 0.12.10. It gives exact filenames/functions/lines, commands to build the fixed multicall and rebuild all three affected consumer executables, conditional repair steps, regression and CI coverage, and an explicit closure checklist. A rebuilt current-master consumer has not yet been validated; this attachment does not claim issue #86 is resolved.

Attached: [jerboa-issue-86-handoff.md](https://git.jerboa.sh/attachments/7df3b4c0-d495-4a44-a899-d2dd341d529a) (16,686 bytes; SHA-256 `eba792f781e11ef24cc49ba5144ed9631a2d4c72965af764b7ef63f649895028`). Downloaded the issue attachment and verified it matches the local Markdown byte for byte. Important correction to the original diagnosis: the actual CLI builder is `jerbuild.ss:do-binary-build`; its default release path embeds the whole-program image, rather than using the separate `lib/jerboa/build.ss:build-binary` app.boot routine. The previously asserted app.boot cause was not established. The handoff maps upstream master `1cda118d62c1f2e23dbfbcd685fcc82b24433289` (0.12.18), including the existing FreeBSD compilation-path fix from [PR #84](https://git.jerboa.sh/ober/jerboa/pulls/84). The failing host still reports installed multicall 0.12.10. It gives exact filenames/functions/lines, commands to build the fixed multicall and rebuild all three affected consumer executables, conditional repair steps, regression and CI coverage, and an explicit closure checklist. A rebuilt current-master consumer has not yet been validated; this attachment does not claim issue #86 is resolved.
Author
Owner

Implemented and submitted for review in PR #91: #91.

Validation completed before opening the PR:

  • macOS arm64 make binary, make binary-smoke-existing, make jerboa-smoke, and issue82 regression.
  • FreeBSD 15.1 amd64 fresh multicall build and clean standalone direct/config regression.
  • FreeBSD Botjail rebuild with the fresh compiler; bj-serviced, bj-release-worker, and bj-job-host version/help startup checks pass.

FreeBSD multicall SHA-256: a5b67135ab481b56bead8e4c621259f4357e85771deaef8d77fd733a69f30171.

Implemented and submitted for review in PR #91: https://git.jerboa.sh/ober/jerboa/pulls/91. Validation completed before opening the PR: - macOS arm64 `make binary`, `make binary-smoke-existing`, `make jerboa-smoke`, and issue82 regression. - FreeBSD 15.1 amd64 fresh multicall build and clean standalone direct/config regression. - FreeBSD Botjail rebuild with the fresh compiler; `bj-serviced`, `bj-release-worker`, and `bj-job-host` version/help startup checks pass. FreeBSD multicall SHA-256: `a5b67135ab481b56bead8e4c621259f4357e85771deaef8d77fd733a69f30171`.
ober closed this issue 2026-09-21 23:46:41 -04:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ober/jerboa#86
No description provided.