Files
fruix/docs/reports/phase1-guile-gnutls-freebsd.md

187 lines
4.8 KiB
Markdown

# Phase 1.2 follow-up: local Guile-GnuTLS built on FreeBSD and checkout investigation advanced
Date: 2026-04-01
## Summary
This step addressed the previously identified missing Guile `(gnutls)` blocker that prevented a Guix checkout from configuring on FreeBSD even when `--with-courage` was used.
Added harnesses/updates:
- `tests/guix/build-local-guile-gnutls.sh`
- updated `tests/guix/run-derivation-generation-investigation.sh`
The result is:
1. local Guile-GnuTLS can be built successfully on FreeBSD against the already validated fixed local Guile build
2. after making that module available, the Guix checkout configure step advances past the GnuTLS check
3. the next checkout blocker is now clearly identified as missing `Guile-Git`
## Inputs used
### Local Guile
The build used the previously validated fixed local Guile install:
- `/tmp/guile-freebsd-validate-install/bin/guile`
### Guile-GnuTLS source identity
The source of truth was the current Guix package definition in `~/repos/guix/gnu/packages/tls.scm`:
- package: `guile-gnutls`
- version: `5.0.1`
- Guix nix-base32: `0kqngyx4520gjk49l6whjd2ss994kaj9rm78lli6p3q6xry0945i`
Translated and verified SHA256:
```text
b190047cee068f6b22a5e8d49ca49a2425ad4593901b9ac8940f8842ba7f164f
```
### FreeBSD package dependency
The host did not have the C GnuTLS library installed, so this step installed:
- `gnutls`
- `libtasn1`
- `nettle`
- `p11-kit`
via:
```sh
sudo pkg install -y gnutls
```
## FreeBSD-specific build findings
### 1. GNU make is required
Guile-GnuTLS uses GNU-make-specific pattern rules in `guile/src/Makefile.am`.
Attempting to build with FreeBSD base `make` failed with:
```text
make[3]: don't know how to make core.x. Stop
```
Using `gmake` resolved that issue.
### 2. Guile-GnuTLS needs a FreeBSD-specific `alloca` include fix
The build then failed in `guile/src/core.c` with:
```text
fatal error: 'alloca.h' file not found
```
On this FreeBSD host, `alloca` is available via `stdlib.h`, not `alloca.h`.
For validation, the harness applies a small source patch in the disposable tree:
```c
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <alloca.h>
#endif
```
With that patch applied, the build completed successfully.
## Validation command
```sh
ENV_OUT=/tmp/guile-gnutls-env.sh \
METADATA_OUT=/tmp/guile-gnutls-metadata.txt \
./tests/guix/build-local-guile-gnutls.sh
```
Default install prefix used by the harness:
```text
/tmp/guile-gnutls-freebsd-validate-install
```
## Result
The local Guile-GnuTLS build succeeded.
Installed artifacts included:
- `share/guile/site/3.0/gnutls.scm`
- `lib/guile/3.0/site-ccache/gnutls.go`
- `lib/guile/3.0/extensions/guile-gnutls-v-2.so.0.0.0`
Module validation succeeded with the fixed local Guile build:
```scheme
(use-modules (gnutls))
```
Observed validation result:
```text
ok
```
The harness also writes an environment file that can be used to expose the built module tree to later commands.
## Re-running the checkout investigation
After building Guile-GnuTLS, the derivation-generation investigation was re-run with:
```sh
GUILE_EXTRA_PREFIX=/tmp/guile-gnutls-freebsd-validate-install \
METADATA_OUT=/tmp/guix-derivation-investigation-with-gnutls.txt \
./tests/guix/run-derivation-generation-investigation.sh
```
The investigation still uses the requested experimental store/state paths:
- store: `/frx/store`
- local state: `/frx/var`
- sysconf: `/frx/etc`
## Updated result
With `(gnutls)` available, the Guix checkout gets past the previous GnuTLS blocker.
The configure step now fails at the next missing Guile dependency:
```text
configure: error: Guile-Git is missing; please install it.
```
This is a meaningful advancement because it proves the earlier GnuTLS blocker is genuinely cleared and that the checkout can proceed farther toward a usable `pre-inst-env` environment.
## What this step demonstrates
This step demonstrates that:
1. missing Guile `(gnutls)` support on FreeBSD is not a dead end
2. a local, compatible Guile-GnuTLS build can be produced against the fixed local Guile build
3. FreeBSD now reaches the next concrete checkout blocker for Guix source-tree configuration: `Guile-Git`
## Current blocker stack
The current checkout path toward real derivation generation is now blocked by:
1. unsupported-platform configure gating unless `--with-courage` is used
2. missing `Guile-Git` after GnuTLS support is supplied
The earlier missing `(gnutls)` blocker has been cleared for local validation purposes.
## Recommended next step
Build or otherwise obtain `Guile-Git` compatible with the same fixed local Guile build, then re-run the derivation-generation investigation again.
That should reveal whether the next boundary lies in:
- another Guile module dependency
- `pre-inst-env` usability
- derivation emission
- daemon connectivity
- `/frx/store`/daemon assumptions