Make FreeBSD base version declarative
This commit is contained in:
@@ -3447,3 +3447,94 @@ Next recommended step:
|
||||
1. begin Phase 15 by making the FreeBSD base version a declarative Fruix input
|
||||
2. demonstrate side-by-side native base versions in `/frx/store`
|
||||
3. validate rebuild/redeploy/rollback across those base versions
|
||||
|
||||
## 2026-04-03 — Phase 15.1: made the FreeBSD base a declarative Fruix input
|
||||
|
||||
Completed work:
|
||||
|
||||
- wrote the Phase 15.1 report:
|
||||
- `docs/reports/phase15-declarative-base-freebsd.md`
|
||||
- added a new declarative base record in `modules/fruix/packages/freebsd.scm`:
|
||||
- `freebsd-base`
|
||||
- `freebsd-base?`
|
||||
- `%default-freebsd-base`
|
||||
- the declarative base now records at least:
|
||||
- `name`
|
||||
- `version-label`
|
||||
- `release`
|
||||
- `branch`
|
||||
- `source-root`
|
||||
- `target`
|
||||
- `target-arch`
|
||||
- `kernconf`
|
||||
- `make-flags`
|
||||
- native FreeBSD package constructors are now parameterized by a declared base:
|
||||
- `freebsd-native-kernel-for`
|
||||
- `freebsd-native-world-for`
|
||||
- `freebsd-native-runtime-for`
|
||||
- `freebsd-native-bootloader-for`
|
||||
- `freebsd-native-headers-for`
|
||||
- `freebsd-native-system-packages-for`
|
||||
- `freebsd-native-development-profile-packages-for`
|
||||
- existing exported native package variables remain available as the `%default-freebsd-base` instances:
|
||||
- `freebsd-native-kernel`
|
||||
- `freebsd-native-world`
|
||||
- `freebsd-native-runtime`
|
||||
- `freebsd-native-bootloader`
|
||||
- `freebsd-native-headers`
|
||||
- added a new operating-system field in `modules/fruix/system/freebsd.scm`:
|
||||
- `#:freebsd-base`
|
||||
- exported accessor: `operating-system-freebsd-base`
|
||||
- the declared base is now recorded in system/image metadata through:
|
||||
- `operating-system-closure-spec`
|
||||
- `operating-system-image-spec`
|
||||
- `metadata/freebsd-base.scm`
|
||||
- `metadata/store-layout.scm`
|
||||
- native build manifests and `.freebsd-native-build-info.scm` now record:
|
||||
- `declared-base`
|
||||
- `scripts/fruix.scm` now emits declared base metadata for `build` and `image`:
|
||||
- `freebsd_base_name`
|
||||
- `freebsd_base_version_label`
|
||||
- `freebsd_base_release`
|
||||
- `freebsd_base_branch`
|
||||
- `freebsd_base_source_root`
|
||||
- `freebsd_base_target`
|
||||
- `freebsd_base_target_arch`
|
||||
- `freebsd_base_kernconf`
|
||||
- `freebsd_base_file`
|
||||
|
||||
New validation files:
|
||||
|
||||
- `tests/system/phase15-declarative-base-pid1-operating-system.scm.in`
|
||||
- `tests/system/run-phase15-declarative-base-build.sh`
|
||||
|
||||
Validation:
|
||||
|
||||
- declarative-base build harness passes:
|
||||
- `tests/system/run-phase15-declarative-base-build.sh`
|
||||
- workdir: `/tmp/phase15-1-build-1775202535`
|
||||
- result: `PASS phase15-declarative-base-build`
|
||||
- confirmed:
|
||||
- `kernel_store=/frx/store/8fcef04c7e507e86ea5e92f251fe3c6ac1aa3bcf4809fa77ddd8b92854bfcde0-freebsd-native-kernel-15.0-STABLE-declarative`
|
||||
- `bootloader_store=/frx/store/7a0ba431e487dc35a8f6318108da16a37c8426c43e77e7a7f91404ba1d980eef-freebsd-native-bootloader-15.0-STABLE-declarative`
|
||||
- `runtime_store=/frx/store/17c24ad20ddcb136c39352b68e758deae0b480258ba0128a5546f696a7eba0a6-freebsd-native-runtime-15.0-STABLE-declarative`
|
||||
- `native_base_store_count=3`
|
||||
- `host_base_store_count=0`
|
||||
- `freebsd_base_name=stable-default`
|
||||
- `freebsd_base_version_label=15.0-STABLE-declarative`
|
||||
- `freebsd_base_release=15.0-STABLE`
|
||||
- `freebsd_base_branch=stable/15`
|
||||
- `freebsd_base_source_root=/usr/src`
|
||||
- `freebsd_base_kernconf=GENERIC`
|
||||
- `declarative_base_input=ok`
|
||||
- the harness also confirmed:
|
||||
- `metadata/freebsd-base.scm` exists
|
||||
- `parameters.scm` records the declared base
|
||||
- `metadata/store-layout.scm` records the declared base
|
||||
- native build info files record the declared base version/branch
|
||||
|
||||
Current assessment:
|
||||
|
||||
- Phase 15.1 is complete
|
||||
- Fruix now models the FreeBSD base as an explicit declarative system input instead of leaving it implicit in the builder host alone
|
||||
- the next step is to use that new declaration to prove side-by-side base versions and rollback-friendly rebuild/redeploy behavior
|
||||
|
||||
141
docs/reports/phase15-declarative-base-freebsd.md
Normal file
141
docs/reports/phase15-declarative-base-freebsd.md
Normal file
@@ -0,0 +1,141 @@
|
||||
# Phase 15.1: make the FreeBSD base version a declarative Fruix input
|
||||
|
||||
Date: 2026-04-03
|
||||
|
||||
## Goal
|
||||
|
||||
Phase 15.1 made the FreeBSD base an explicit declarative part of the Fruix system model instead of leaving it as an implicit property of whatever `/usr/src` happened to be present on the builder host.
|
||||
|
||||
## Implementation
|
||||
|
||||
### New declarative base record
|
||||
|
||||
Added in `modules/fruix/packages/freebsd.scm`:
|
||||
|
||||
- `freebsd-base`
|
||||
- `freebsd-base?`
|
||||
- accessors for:
|
||||
- `name`
|
||||
- `version-label`
|
||||
- `release`
|
||||
- `branch`
|
||||
- `source-root`
|
||||
- `target`
|
||||
- `target-arch`
|
||||
- `kernconf`
|
||||
- `make-flags`
|
||||
- `%default-freebsd-base`
|
||||
|
||||
This gives Fruix an explicit model for the base input used by native FreeBSD artifacts.
|
||||
|
||||
### Native package constructors now accept a declared base
|
||||
|
||||
Added package constructors:
|
||||
|
||||
- `freebsd-native-kernel-for`
|
||||
- `freebsd-native-world-for`
|
||||
- `freebsd-native-runtime-for`
|
||||
- `freebsd-native-bootloader-for`
|
||||
- `freebsd-native-headers-for`
|
||||
- `freebsd-native-system-packages-for`
|
||||
- `freebsd-native-development-profile-packages-for`
|
||||
|
||||
The existing exported package variables remain as the `%default-freebsd-base` instances:
|
||||
|
||||
- `freebsd-native-kernel`
|
||||
- `freebsd-native-world`
|
||||
- `freebsd-native-runtime`
|
||||
- `freebsd-native-bootloader`
|
||||
- `freebsd-native-headers`
|
||||
|
||||
That preserves the validated Phase 14 path while making alternative declared bases possible.
|
||||
|
||||
### Operating-system model now records the declared base
|
||||
|
||||
Added to `modules/fruix/system/freebsd.scm`:
|
||||
|
||||
- `operating-system-freebsd-base`
|
||||
- new `#:freebsd-base` field on `operating-system`
|
||||
|
||||
The declared base is now recorded in:
|
||||
|
||||
- `operating-system-closure-spec`
|
||||
- `operating-system-image-spec`
|
||||
- `metadata/freebsd-base.scm`
|
||||
- `metadata/store-layout.scm`
|
||||
|
||||
### CLI metadata now exposes the declared base
|
||||
|
||||
`scripts/fruix.scm` now emits, for `fruix system build` and `image`:
|
||||
|
||||
- `freebsd_base_name`
|
||||
- `freebsd_base_version_label`
|
||||
- `freebsd_base_release`
|
||||
- `freebsd_base_branch`
|
||||
- `freebsd_base_source_root`
|
||||
- `freebsd_base_target`
|
||||
- `freebsd_base_target_arch`
|
||||
- `freebsd_base_kernconf`
|
||||
- `freebsd_base_file`
|
||||
|
||||
### Native build metadata now records the declared base
|
||||
|
||||
Native build manifests and `.freebsd-native-build-info.scm` now carry a `declared-base` block so the native artifacts themselves record the declarative base choice.
|
||||
|
||||
## New files
|
||||
|
||||
Added:
|
||||
|
||||
- `tests/system/phase15-declarative-base-pid1-operating-system.scm.in`
|
||||
- `tests/system/run-phase15-declarative-base-build.sh`
|
||||
|
||||
## Validation
|
||||
|
||||
Passing run:
|
||||
|
||||
- `PASS phase15-declarative-base-build`
|
||||
- workdir: `/tmp/phase15-1-build-1775202535`
|
||||
|
||||
The harness used an explicit declared base:
|
||||
|
||||
```scheme
|
||||
(freebsd-base
|
||||
#:name "stable-default"
|
||||
#:version-label "15.0-STABLE-declarative"
|
||||
#:release "15.0-STABLE"
|
||||
#:branch "stable/15"
|
||||
#:source-root "/usr/src"
|
||||
#:target "amd64"
|
||||
#:target-arch "amd64"
|
||||
#:kernconf "GENERIC")
|
||||
```
|
||||
|
||||
Confirmed:
|
||||
|
||||
```text
|
||||
kernel_store=/frx/store/8fcef04c7e507e86ea5e92f251fe3c6ac1aa3bcf4809fa77ddd8b92854bfcde0-freebsd-native-kernel-15.0-STABLE-declarative
|
||||
bootloader_store=/frx/store/7a0ba431e487dc35a8f6318108da16a37c8426c43e77e7a7f91404ba1d980eef-freebsd-native-bootloader-15.0-STABLE-declarative
|
||||
runtime_store=/frx/store/17c24ad20ddcb136c39352b68e758deae0b480258ba0128a5546f696a7eba0a6-freebsd-native-runtime-15.0-STABLE-declarative
|
||||
native_base_store_count=3
|
||||
host_base_store_count=0
|
||||
freebsd_base_name=stable-default
|
||||
freebsd_base_version_label=15.0-STABLE-declarative
|
||||
freebsd_base_release=15.0-STABLE
|
||||
freebsd_base_branch=stable/15
|
||||
freebsd_base_source_root=/usr/src
|
||||
freebsd_base_kernconf=GENERIC
|
||||
declarative_base_input=ok
|
||||
```
|
||||
|
||||
The harness also confirmed:
|
||||
|
||||
- `metadata/freebsd-base.scm` exists
|
||||
- `parameters.scm` records the declared base
|
||||
- `metadata/store-layout.scm` records the declared base
|
||||
- native build info files record the declared base version/branch
|
||||
|
||||
## Result
|
||||
|
||||
Phase 15.1 is complete.
|
||||
|
||||
Fruix now has an explicit declarative FreeBSD base input in the system model, while still allowing the current validated `/usr/src`-based path to work unchanged by default.
|
||||
Reference in New Issue
Block a user