Files
fruix/docs/reports/phase5-derivation-generation-freebsd.md

3.4 KiB

Phase 5.2: Real derivation generation validated on FreeBSD against /frx/store

Date: 2026-04-01

Summary

This step validates that the now-runnable checkout can perform real package lowering and emit a real derivation targeting /frx/store on FreeBSD.

Added file:

  • tests/guix/run-phase5-derivation-generation.sh

Approach

Rather than jumping immediately to a full upstream package such as GNU Hello, this step uses a deliberately minimal custom package defined inside the harness. The goal is to validate the real Guix lowering layers first, while avoiding unrelated bootstrap baggage that is still not fully adapted to FreeBSD.

The custom package still exercises the layers that matter for this subphase:

  • package->bag
  • bag->derivation
  • real store connection through the daemon socket
  • derivation emission into /frx/store
  • source lowering as a real store item

Why a custom low-level package was used

Attempting to lower a representative upstream package now gets past the earlier leave-on-EPIPE command-path failure, but still runs into deeper platform/bootstrap issues on this FreeBSD path, such as missing bootstrap binaries for the native system string.

That means the meaningful next proof point was:

can the real checkout lower a package and emit a real derivation at all on FreeBSD?

The answer is now yes.

Validation command

Run command:

METADATA_OUT=/tmp/phase5-derivation-metadata.txt \
./tests/guix/run-phase5-derivation-generation.sh

What the harness does

The harness:

  1. reuses the patched checkout/runtime setup from Phase 5.1
  2. builds the patched guix-daemon for FreeBSD
  3. starts that daemon on a temporary Unix socket
  4. runs the checkout through the user-facing frontend boundary:
    • ./pre-inst-env fruix repl -- ...
  5. defines a minimal custom FreeBSD test package with a custom low-level build system
  6. lowers that package through:
    • package->bag
    • bag->derivation
  7. records the resulting derivation path and output path

Observed results

Observed metadata included:

  • bag_name=phase5-freebsd-lowering-0
  • bag_host_inputs=("source")
  • drv_path=/frx/store/...-phase5-freebsd-lowering-0.drv
  • out_path=/frx/store/...-phase5-freebsd-lowering-0

This demonstrates that:

  • the checkout can now talk to a real daemon socket on FreeBSD
  • a real package object can be lowered to a bag
  • that bag can be lowered to a real derivation
  • the derivation is registered under /frx/store
  • the output path is also a normal /frx/store path

Important findings

  • the FreeBSD daemon path does not need to be fully feature-complete before derivation generation becomes useful; a narrow but real lowering path already works
  • the custom package approach avoided conflating Phase 5.2 with the still-unresolved upstream bootstrap-package assumptions for native FreeBSD package graphs
  • the result is materially beyond the earlier builder-phase and profile prototypes because the derivation is now emitted by the real checkout and store machinery rather than by an ad hoc stand-in

Conclusion

Phase 5.2 is satisfied on the current FreeBSD prototype track:

  • a real derivation is now emitted by the checkout on FreeBSD
  • it targets /frx/store
  • it comes from a real package->bag and bag->derivation path rather than from a shell-only approximation

The next step is to go one layer deeper and submit an actual derivation-backed build request through the same FreeBSD-aware daemon/store path.