Advance Guix checkout on FreeBSD

This commit is contained in:
2026-04-01 11:21:50 +02:00
parent 47d31e8992
commit d82195beed
4 changed files with 947 additions and 71 deletions

View File

@@ -637,3 +637,92 @@ Next recommended step:
1. obtain recent `Guile-SQLite3` compatible with the fixed local Guile build and install it into the same local dependency prefix
2. re-run the derivation-generation investigation again to identify the next configure-time or checkout-time blocker after `Guile-SQLite3`
3. continue keeping `/frx/store` as the intended experimental store root and keep `~/repos/bdwgc` in reserve if later FreeBSD-specific GC/thread issues appear
## 2026-04-01 — Phase 1.2 follow-up: remaining checkout Guile prerequisites built; next blocker is `./pre-inst-env guix --version`
Completed work:
- installed the remaining missing host C library dependencies required for the next Guile extension stack:
- `libgcrypt`
- `libgpg-error`
- `lzlib`
- added a reproducible build harness for the remaining mandatory Guix checkout Guile modules:
- `tests/guix/build-local-guile-configure-deps.sh`
- extended the derivation-generation investigation harness to:
- probe local recent-enough availability for:
- `(sqlite3)`
- `(gcrypt hash)`
- `(zlib)`
- `(lzlib)`
- `(semver)`
- run checkout `configure` with:
- `MAKE=gmake`
- continue past successful configuration into:
- `gmake scripts/guix`
- `./pre-inst-env guix --version`
- used the current Guix package definitions as source of truth for the following additional module stack:
- `guile-sqlite3` `0.1.3`
- `guile-gcrypt` `0.5.0`
- `guile-zlib` `0.2.2`
- `guile-lzlib` `0.3.0`
- `guile-semver` `0.2.0`
- built and installed those modules into the same shared local dependency prefix already used for prior checkout prerequisites:
- `/tmp/guile-gnutls-freebsd-validate-install`
- validated successfully that the fixed local Guile can now satisfy all of the remaining configure-time Guix module checks encountered so far:
- `(sqlite3)` with `sqlite-bind-arguments`
- `(gcrypt hash)` with `hash-algorithm` lookup
- `(zlib)` with `make-zlib-input-port`
- `(lzlib)`
- `(semver)`
- re-ran the checkout derivation-generation investigation with:
- `GUILE_EXTRA_PREFIX=/tmp/guile-gnutls-freebsd-validate-install`
- store directory still set to `/frx/store`
- wrote the results to:
- `docs/reports/phase1-guix-checkout-configure-stack-freebsd.md`
Important findings:
- `guile-gcrypt` required an explicit configure workaround on this host:
- `--with-libgcrypt-prefix=/usr/local`
- without it, the package's `libgcrypt-config --libs` parsing produced an unusable shared-library name on FreeBSD
- the currently served upstream `guile-lzlib` `0.3.0` tarball no longer matches the Guix-recorded hash:
- expected from Guix: `a7f99c8d2a143e05ea22db2dc8b9ce6c27cae942162b45ee3015ed9027af0ff2`
- observed from current source URL: `6a2847a303a141bb95b1b5d1a4b975b4dbff9cc590eba377cc8072682e7637ec`
- for local validation, the harness fell back to the matching upstream Git tag and recorded commit:
- `474cee42116295bc0bd2acf12d4d6a766043090e`
- once the remaining Guile modules were present, checkout `configure --with-courage` stopped failing on missing modules
- however, the checkout still needed:
- `MAKE=gmake`
to complete configuration successfully on FreeBSD
- after that, `gmake scripts/guix` succeeded as well
- the next concrete blocker has moved from configuration-time prerequisites to runtime behavior of the uninstalled Guix command path:
- `./pre-inst-env guix --version` prints the version banner, then exits with:
- `Wrong type to apply: #<syntax-transformer leave-on-EPIPE>`
Current assessment:
- the checkout-preparation path on FreeBSD has now progressed beyond the missing mandatory Guile module stack that previously blocked configuration
- the current local validation prefix now contains the required configure-time modules encountered so far for a real Guix checkout
- the first blocker after successful checkout configuration and `scripts/guix` generation is now a runtime Scheme failure in the uninstalled `guix` command path itself
- the work is therefore now meaningfully past “cannot configure” and into “configures, builds `scripts/guix`, but fails at `./pre-inst-env guix --version`
Recent commits:
- `e380e88``Add FreeBSD Guile verification harness`
- `cd721b1``Update progress after Guile verification`
- `27916cb``Diagnose Guile subprocess crash on FreeBSD`
- `02f7a7f``Validate local Guile fix on FreeBSD`
- `4aebea4``Add native GNU Hello FreeBSD build harness`
- `c944cdb``Validate Guix builder phases on FreeBSD`
- `0a2e48e``Validate GNU which builder phases on FreeBSD`
- `245a47d``Document gaps to real Guix FreeBSD builds`
- `d62e9b0``Investigate Guix derivation generation on FreeBSD`
- `c0a85ed``Build local Guile-GnuTLS on FreeBSD`
- `15b9037``Build local Guile-Git on FreeBSD`
- `47d31e8``Build local Guile-JSON on FreeBSD`
Next recommended step:
1. investigate the `leave-on-EPIPE` runtime failure now blocking `./pre-inst-env guix --version`
2. complete the remaining Phase 1.3 FreeBSD system-call mapping/documentation deliverable so Phase 1 foundations can be closed out cleanly
3. continue keeping `/frx/store` as the intended experimental store root and keep `~/repos/bdwgc` in reserve if later FreeBSD-specific GC/thread issues appear

View File

@@ -0,0 +1,239 @@
# Phase 1.2 follow-up: remaining Guix checkout Guile prerequisites built on FreeBSD; next blocker is `./pre-inst-env guix --version`
Date: 2026-04-01
## Summary
This step cleared the remaining mandatory Guile module prerequisites needed by a Guix checkout `configure --with-courage` run on FreeBSD, and then pushed the checkout investigation past configuration into the next executable boundary.
Added/updated files:
- `tests/guix/build-local-guile-configure-deps.sh`
- updated `tests/guix/run-derivation-generation-investigation.sh`
The result is:
1. the remaining required checkout-time Guile modules can be built successfully on FreeBSD against the fixed local Guile build
2. `configure --with-courage` now succeeds when run with `MAKE=gmake`
3. `gmake scripts/guix` also succeeds
4. the next concrete blocker is no longer a missing Guile module; it is a runtime failure from `./pre-inst-env guix --version`
## Inputs used
### Local Guile
The same fixed local Guile build was used:
- `/tmp/guile-freebsd-validate-install/bin/guile`
### Shared local dependency prefix
This step continued using the shared local prefix already created by earlier prerequisite work:
- `/tmp/guile-gnutls-freebsd-validate-install`
At this point the prefix contains at least:
- Guile-GnuTLS
- Guile bytestructures
- Guile-Git
- Guile-JSON
- Guile-SQLite3
- Guile-Gcrypt
- Guile-zlib
- Guile-lzlib
- Guile-semver
### Host-side packages installed for this step
This step installed the missing C library dependencies required by the remaining Guile extension stack:
```sh
sudo pkg install -y libgcrypt lzlib
```
Installed host packages included:
- `libgcrypt` `1.12.0`
- `libgpg-error` `1.59`
- `lzlib` `1.16`
The host already had:
- `sqlite3` `3.50.4`
## Guix source-of-truth package definitions used
This step used the current Guix package definitions in:
- `~/repos/guix/gnu/packages/guile.scm`
- `~/repos/guix/gnu/packages/gnupg.scm`
- `~/repos/guix/gnu/packages/guile-xyz.scm`
Packages built:
- `guile-sqlite3` `0.1.3`
- `guile-gcrypt` `0.5.0`
- `guile-zlib` `0.2.2`
- `guile-lzlib` `0.3.0`
- `guile-semver` `0.2.0`
Resolved Git commits recorded by the harness:
- `guile-sqlite3` tag `v0.1.3`
- `9405dda61347ff26c57e3be7531dc9dc5a19cf40`
- `guile-gcrypt` tag `v0.5.0`
- `1b637955d40b206d2bdebed5443a545a0412f813`
- `guile-semver` tag `v0.2.0`
- `607ca84c24b8950fdb5aca73e9d53d924e49fc24`
Verified tarball hashes:
- `guile-zlib` `0.2.2`
- Guix nix-base32: `04p9lb3bq5y0k358s8agpksx9x68vzx330cb8jkn4qp3qj7cmnx2`
- SHA256: `a2dbca8ec4e36262a7448b8131fadfc8f4d4f5bc4f218dca98c017bcc6a2e912`
## Important FreeBSD-specific findings
### 1. `guile-gcrypt` needed an explicit libgcrypt prefix on this host
`guile-gcrypt` configure failed initially because its `libgcrypt-config --libs` parsing logic derived an unusable dynamic library name on FreeBSD when `/usr/local/bin/libgcrypt-config` emitted both `-lgcrypt` and `-lgpg-error`.
For local validation, configuring with:
```text
--with-libgcrypt-prefix=/usr/local
```
resolved that issue cleanly.
### 2. Current `guile-lzlib` source URL no longer matches the Guix hash
The current upstream tarball at:
```text
https://codeberg.org/guile-compression/guile-lzlib/archive/0.3.0.tar.gz
```
produced this SHA256 on the host:
```text
6a2847a303a141bb95b1b5d1a4b975b4dbff9cc590eba377cc8072682e7637ec
```
but the current Guix package definition expects:
```text
a7f99c8d2a143e05ea22db2dc8b9ce6c27cae942162b45ee3015ed9027af0ff2
```
To continue local validation, the harness fell back to the upstream Git tag matching version `0.3.0` and recorded:
- fallback commit `474cee42116295bc0bd2acf12d4d6a766043090e`
This is useful independent evidence that the currently served upstream tarball has drifted relative to the hash recorded in Guix.
### 3. `MAKE=gmake` is required for the Guix checkout configure/build path here
Once the remaining Guile modules were available, the Guix checkout no longer failed on missing modules. However, configuration still failed unless it was run with GNU make selected explicitly.
Using:
```text
MAKE=gmake
```
allowed `configure --with-courage` to complete successfully on FreeBSD.
## Validation commands
### Build the remaining required Guile modules
```sh
ENV_OUT=/tmp/guile-configure-deps-env.sh \
METADATA_OUT=/tmp/guile-configure-deps-metadata.txt \
./tests/guix/build-local-guile-configure-deps.sh
```
### Re-run the checkout investigation
```sh
GUILE_EXTRA_PREFIX=/tmp/guile-gnutls-freebsd-validate-install \
METADATA_OUT=/tmp/guix-derivation-investigation-next-boundary.txt \
./tests/guix/run-derivation-generation-investigation.sh
```
The investigation still used the requested experimental directories:
- store: `/frx/store`
- local state: `/frx/var`
- sysconf: `/frx/etc`
## Module validation results
The remaining module checks all succeeded:
```text
sqlite3 module check: ok
gcrypt module check: ok
zlib module check: ok
lzlib module check: ok
semver module check: ok
```
The prefix also still satisfied the earlier requirements:
```text
Existing (gnutls) module in prefix: present
Existing (git) module in prefix: present
Existing (json) module in prefix: present
```
## Updated checkout investigation result
After these module builds, the Guix checkout now behaves as follows on FreeBSD:
1. `configure` without `--with-courage` still fails on the explicit unsupported-platform gate
2. `configure --with-courage` now succeeds when run with `MAKE=gmake`
3. `gmake scripts/guix` succeeds
4. `./pre-inst-env guix --version` prints the version banner but exits with a Scheme runtime error
Observed failure signature:
```text
ice-9/eval.scm:619:8: Wrong type to apply: #<syntax-transformer leave-on-EPIPE>
```
The command still printed the expected banner first:
```text
guix (GNU Guix) 1.5.0.7351-62b61
```
So the current boundary has moved past checkout configuration and script generation into runtime behavior of the uninstalled Guix command itself.
## Additional observations
- `configure` now reports these required modules as available and recent enough:
- Guile-JSON
- Guile-SQLite3
- Guile-Gcrypt
- Guile-Git
- Guile-zlib
- Guile-lzlib
- Guile-semver
- `Guile-Lib` still does not satisfy the optional versioned requirement, but that remains a warning rather than a blocker
- `Guile-SSH` is still unavailable and reported as such during configure, but it also does not block this checkout path here
- using `/frx/store` continues to produce the expected warning that substitutes from `gnu.org` will not be usable
## What this step demonstrates
This step demonstrates that:
1. the Guix checkout has now progressed beyond the long sequence of missing mandatory Guile module prerequisites on FreeBSD
2. the next blocker is now in actual execution of the checkout command path rather than in missing configure-time dependencies
3. the current FreeBSD boundary has advanced from “cannot configure” to “configures and builds `scripts/guix`, but `./pre-inst-env guix --version` fails at runtime”
## Recommended next step
Investigate the `leave-on-EPIPE` runtime failure in the uninstalled Guix command path, while also completing the remaining Phase 1.3 syscall-interface mapping/documentation work needed to close out Phase 1 foundations.

View File

@@ -0,0 +1,430 @@
#!/bin/sh
set -eu
guile_sqlite3_repo=${GUILE_SQLITE3_REPO:-"https://codeberg.org/guile-sqlite3/guile-sqlite3.git"}
guile_sqlite3_version=${GUILE_SQLITE3_VERSION:-0.1.3}
guile_gcrypt_repo=${GUILE_GCRYPT_REPO:-"https://codeberg.org/guile-gcrypt/guile-gcrypt.git"}
guile_gcrypt_version=${GUILE_GCRYPT_VERSION:-0.5.0}
guile_zlib_source_url=${GUILE_ZLIB_SOURCE_URL:-"https://codeberg.org/guile-compression/guile-zlib/archive/v0.2.2.tar.gz"}
guile_zlib_version=${GUILE_ZLIB_VERSION:-0.2.2}
guile_zlib_nix_base32=${GUILE_ZLIB_NIX_BASE32:-04p9lb3bq5y0k358s8agpksx9x68vzx330cb8jkn4qp3qj7cmnx2}
guile_lzlib_source_url=${GUILE_LZLIB_SOURCE_URL:-"https://codeberg.org/guile-compression/guile-lzlib/archive/0.3.0.tar.gz"}
guile_lzlib_repo=${GUILE_LZLIB_REPO:-"https://codeberg.org/guile-compression/guile-lzlib"}
guile_lzlib_version=${GUILE_LZLIB_VERSION:-0.3.0}
guile_lzlib_nix_base32=${GUILE_LZLIB_NIX_BASE32:-1whgmwkr1v8m63p4aaqn8blwl9vcrswwhbfv4bm0aghl5a6rryd7}
guile_semver_repo=${GUILE_SEMVER_REPO:-"https://codeberg.org/daym/guile-semver.git"}
guile_semver_version=${GUILE_SEMVER_VERSION:-0.2.0}
install_prefix=${INSTALL_PREFIX:-/tmp/guile-gnutls-freebsd-validate-install}
guile_bin=${GUILE_BIN:-/tmp/guile-freebsd-validate-install/bin/guile}
guix_source_dir=${GUIX_SOURCE_DIR:-"$HOME/repos/guix"}
make_bin=${MAKE_BIN:-gmake}
if [ ! -x "$guile_bin" ]; then
echo "Guile binary is not executable: $guile_bin" >&2
exit 1
fi
if [ ! -d "$guix_source_dir/guix" ]; then
echo "Guix source tree not found at $guix_source_dir" >&2
exit 1
fi
for tool in git autoreconf fetch sha256 bsdtar pkg-config "$make_bin"; do
if ! command -v "$tool" >/dev/null 2>&1; then
echo "Required tool not found: $tool" >&2
exit 1
fi
done
for module in sqlite3 libgcrypt; do
if ! pkg-config --exists "$module"; then
echo "Required pkg-config module not found: $module" >&2
echo "Install the corresponding host package first (for example via pkg)." >&2
exit 1
fi
done
if [ ! -f /usr/local/include/lzlib.h ] || [ ! -f /usr/local/lib/liblz.so ]; then
echo "Required lzlib headers or shared library not found under /usr/local" >&2
echo "Install the lzlib package first (for example via pkg)." >&2
exit 1
fi
cleanup=0
if [ -n "${WORKDIR:-}" ]; then
workdir=$WORKDIR
mkdir -p "$workdir"
else
workdir=$(mktemp -d /tmp/fruix-guile-configure-deps.XXXXXX)
cleanup=1
fi
if [ "${KEEP_WORKDIR:-0}" -eq 1 ]; then
cleanup=0
fi
cleanup_workdir() {
if [ "$cleanup" -eq 1 ]; then
rm -rf "$workdir"
fi
}
trap cleanup_workdir EXIT INT TERM
guile_bindir=$(CDPATH= cd -- "$(dirname "$guile_bin")" && pwd)
guile_prefix=$(CDPATH= cd -- "$guile_bindir/.." && pwd)
guile_lib_dir=$guile_prefix/lib
guile_version=$(LD_LIBRARY_PATH="$guile_lib_dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$guile_bin" -c '(display (effective-version))')
site_dir=$install_prefix/share/guile/site/$guile_version
site_ccache_dir=$install_prefix/lib/guile/$guile_version/site-ccache
extensions_dir=$install_prefix/lib/guile/$guile_version/extensions
tool_bindir=$workdir/guile-tools-bin
mkdir -p "$tool_bindir"
ln -sf "$guile_bin" "$tool_bindir/guile-3.0"
ln -sf "$guile_bin" "$tool_bindir/guile"
ln -sf "$guile_bindir/guild" "$tool_bindir/guild-3.0"
ln -sf "$guile_bindir/guild" "$tool_bindir/guild"
ln -sf "$guile_bindir/guile-config" "$tool_bindir/guile-config-3.0"
ln -sf "$guile_bindir/guile-config" "$tool_bindir/guile-config"
ln -sf "$guile_bindir/guile-snarf" "$tool_bindir/guile-snarf"
export PATH="$tool_bindir:$guile_bindir:/usr/local/bin:$PATH"
export ACLOCAL_PATH=/usr/local/share/aclocal${ACLOCAL_PATH:+:$ACLOCAL_PATH}
export PKG_CONFIG_PATH=/usr/local/libdata/pkgconfig:/usr/local/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
export CPPFLAGS='-I/usr/local/include'
export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,-rpath,$guile_lib_dir -Wl,-rpath,$install_prefix/lib"
if [ -n "${LD_LIBRARY_PATH:-}" ]; then
export LD_LIBRARY_PATH="$install_prefix/lib:$guile_lib_dir:/usr/local/lib:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$install_prefix/lib:$guile_lib_dir:/usr/local/lib"
fi
if [ -d "$site_dir" ]; then
export GUILE_LOAD_PATH="$site_dir${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}"
fi
if [ -d "$site_ccache_dir" ]; then
export GUILE_LOAD_COMPILED_PATH="$site_ccache_dir${GUILE_LOAD_COMPILED_PATH:+:$GUILE_LOAD_COMPILED_PATH}"
fi
if [ -d "$extensions_dir" ]; then
export GUILE_EXTENSIONS_PATH="$extensions_dir${GUILE_EXTENSIONS_PATH:+:$GUILE_EXTENSIONS_PATH}"
fi
metadata_file=$workdir/guile-configure-deps-build-metadata.txt
env_file=$workdir/guile-configure-deps-env.sh
printf 'Using Guile: %s\n' "$guile_bin"
printf 'Installing into existing prefix: %s\n' "$install_prefix"
printf 'Working directory: %s\n' "$workdir"
rm -rf \
"$site_dir/sqlite3" "$site_dir/sqlite3.scm" "$site_ccache_dir/sqlite3" "$site_ccache_dir/sqlite3.go" \
"$site_dir/gcrypt" "$site_dir/gcrypt.scm" "$site_ccache_dir/gcrypt" "$site_ccache_dir/gcrypt.go" \
"$site_dir/zlib" "$site_dir/zlib.scm" "$site_ccache_dir/zlib" "$site_ccache_dir/zlib.go" \
"$site_dir/lzlib" "$site_dir/lzlib.scm" "$site_ccache_dir/lzlib" "$site_ccache_dir/lzlib.go" \
"$site_dir/semver" "$site_dir/semver.scm" "$site_ccache_dir/semver" "$site_ccache_dir/semver.go"
mkdir -p "$install_prefix"
expected_zlib_sha256_hex=$(GUILE_AUTO_COMPILE=0 \
GUILE_LOAD_PATH="$guix_source_dir${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}" \
"$guile_bin" -c "(use-modules (guix base32) (rnrs bytevectors) (ice-9 format)) (for-each (lambda (b) (format #t \"~2,'0x\" b)) (bytevector->u8-list (nix-base32-string->bytevector (cadr (command-line))))) (newline)" \
"$guile_zlib_nix_base32")
expected_lzlib_sha256_hex=$(GUILE_AUTO_COMPILE=0 \
GUILE_LOAD_PATH="$guix_source_dir${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}" \
"$guile_bin" -c "(use-modules (guix base32) (rnrs bytevectors) (ice-9 format)) (for-each (lambda (b) (format #t \"~2,'0x\" b)) (bytevector->u8-list (nix-base32-string->bytevector (cadr (command-line))))) (newline)" \
"$guile_lzlib_nix_base32")
sqlite3_src_dir=$workdir/guile-sqlite3
sqlite3_build_dir=$workdir/build-guile-sqlite3
sqlite3_bootstrap_log=$workdir/guile-sqlite3-bootstrap.log
sqlite3_configure_log=$workdir/guile-sqlite3-configure.log
sqlite3_build_log=$workdir/guile-sqlite3-build.log
sqlite3_install_log=$workdir/guile-sqlite3-install.log
git clone --depth 1 --branch "v$guile_sqlite3_version" "$guile_sqlite3_repo" "$sqlite3_src_dir" >"$workdir/guile-sqlite3-clone.log" 2>&1
guile_sqlite3_commit=$(git -C "$sqlite3_src_dir" rev-parse HEAD)
(
cd "$sqlite3_src_dir"
autoreconf -vfi
) >"$sqlite3_bootstrap_log" 2>&1
mkdir -p "$sqlite3_build_dir"
(
cd "$sqlite3_build_dir"
"$sqlite3_src_dir/configure" --prefix="$install_prefix"
) >"$sqlite3_configure_log" 2>&1
(
cd "$sqlite3_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 -j"${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 1)}"
) >"$sqlite3_build_log" 2>&1
(
cd "$sqlite3_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 install
) >"$sqlite3_install_log" 2>&1
sqlite3_check=$("$guile_bin" -c '(use-modules (sqlite3)) (display (if (procedure? sqlite-bind-arguments) "ok" "missing-export")) (newline)')
if [ "$sqlite3_check" != "ok" ]; then
echo "(sqlite3) module validation failed" >&2
exit 1
fi
gcrypt_src_dir=$workdir/guile-gcrypt
gcrypt_build_dir=$workdir/build-guile-gcrypt
gcrypt_bootstrap_log=$workdir/guile-gcrypt-bootstrap.log
gcrypt_configure_log=$workdir/guile-gcrypt-configure.log
gcrypt_build_log=$workdir/guile-gcrypt-build.log
gcrypt_install_log=$workdir/guile-gcrypt-install.log
git clone --depth 1 --branch "v$guile_gcrypt_version" "$guile_gcrypt_repo" "$gcrypt_src_dir" >"$workdir/guile-gcrypt-clone.log" 2>&1
guile_gcrypt_commit=$(git -C "$gcrypt_src_dir" rev-parse HEAD)
(
cd "$gcrypt_src_dir"
autoreconf -vfi
) >"$gcrypt_bootstrap_log" 2>&1
mkdir -p "$gcrypt_build_dir"
(
cd "$gcrypt_build_dir"
"$gcrypt_src_dir/configure" --prefix="$install_prefix" --with-libgcrypt-prefix=/usr/local
) >"$gcrypt_configure_log" 2>&1
(
cd "$gcrypt_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 -j1
) >"$gcrypt_build_log" 2>&1
(
cd "$gcrypt_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 install
) >"$gcrypt_install_log" 2>&1
gcrypt_check=$("$guile_bin" -c '(use-modules (gcrypt hash)) (display (if (equal? (hash-algorithm sha256) (lookup-hash-algorithm (quote sha256))) "ok" "mismatch")) (newline)')
if [ "$gcrypt_check" != "ok" ]; then
echo "(gcrypt hash) module validation failed" >&2
exit 1
fi
zlib_tarball=$workdir/guile-zlib-$guile_zlib_version.tar.gz
zlib_src_dir=$workdir/guile-zlib
zlib_build_dir=$workdir/build-guile-zlib
zlib_bootstrap_log=$workdir/guile-zlib-bootstrap.log
zlib_configure_log=$workdir/guile-zlib-configure.log
zlib_build_log=$workdir/guile-zlib-build.log
zlib_install_log=$workdir/guile-zlib-install.log
fetch -o "$zlib_tarball" "$guile_zlib_source_url"
actual_zlib_sha256_hex=$(sha256 -q "$zlib_tarball")
if [ "$actual_zlib_sha256_hex" != "$expected_zlib_sha256_hex" ]; then
echo "sha256 mismatch for $zlib_tarball" >&2
echo "expected: $expected_zlib_sha256_hex" >&2
echo "actual: $actual_zlib_sha256_hex" >&2
exit 1
fi
bsdtar -xf "$zlib_tarball" -C "$workdir"
(
cd "$zlib_src_dir"
if [ -x ./autogen.sh ]; then
./autogen.sh
else
autoreconf -vfi
fi
) >"$zlib_bootstrap_log" 2>&1
mkdir -p "$zlib_build_dir"
(
cd "$zlib_build_dir"
"$zlib_src_dir/configure" --prefix="$install_prefix"
) >"$zlib_configure_log" 2>&1
(
cd "$zlib_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 -j"${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 1)}"
) >"$zlib_build_log" 2>&1
(
cd "$zlib_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 install
) >"$zlib_install_log" 2>&1
zlib_check=$("$guile_bin" -c '(use-modules (zlib)) (display (if (procedure? make-zlib-input-port) "ok" "missing-export")) (newline)')
if [ "$zlib_check" != "ok" ]; then
echo "(zlib) module validation failed" >&2
exit 1
fi
lzlib_tarball=$workdir/guile-lzlib-$guile_lzlib_version.tar.gz
lzlib_src_dir=$workdir/guile-lzlib
lzlib_build_dir=$workdir/build-guile-lzlib
lzlib_bootstrap_log=$workdir/guile-lzlib-bootstrap.log
lzlib_configure_log=$workdir/guile-lzlib-configure.log
lzlib_build_log=$workdir/guile-lzlib-build.log
lzlib_install_log=$workdir/guile-lzlib-install.log
lzlib_source_mode=tarball
lzlib_source_note=matched-guix-hash
lzlib_fallback_commit='<none>'
fetch -o "$lzlib_tarball" "$guile_lzlib_source_url"
actual_lzlib_sha256_hex=$(sha256 -q "$lzlib_tarball")
if [ "$actual_lzlib_sha256_hex" = "$expected_lzlib_sha256_hex" ]; then
bsdtar -xf "$lzlib_tarball" -C "$workdir"
else
lzlib_source_mode=git-fallback
lzlib_source_note=source-url-hash-mismatch
git clone --depth 1 --branch "$guile_lzlib_version" "$guile_lzlib_repo" "$lzlib_src_dir" >"$workdir/guile-lzlib-clone.log" 2>&1
lzlib_fallback_commit=$(git -C "$lzlib_src_dir" rev-parse HEAD)
fi
(
cd "$lzlib_src_dir"
if [ -x ./autogen.sh ]; then
./autogen.sh
else
autoreconf -vfi
fi
) >"$lzlib_bootstrap_log" 2>&1
mkdir -p "$lzlib_build_dir"
(
cd "$lzlib_build_dir"
"$lzlib_src_dir/configure" --prefix="$install_prefix"
) >"$lzlib_configure_log" 2>&1
(
cd "$lzlib_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 -j"${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 1)}"
) >"$lzlib_build_log" 2>&1
(
cd "$lzlib_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 install
) >"$lzlib_install_log" 2>&1
lzlib_check=$("$guile_bin" -c '(use-modules (lzlib)) (display "ok") (newline)')
if [ "$lzlib_check" != "ok" ]; then
echo "(lzlib) module validation failed" >&2
exit 1
fi
semver_src_dir=$workdir/guile-semver
semver_build_dir=$workdir/build-guile-semver
semver_bootstrap_log=$workdir/guile-semver-bootstrap.log
semver_configure_log=$workdir/guile-semver-configure.log
semver_build_log=$workdir/guile-semver-build.log
semver_install_log=$workdir/guile-semver-install.log
git clone --depth 1 --branch "v$guile_semver_version" "$guile_semver_repo" "$semver_src_dir" >"$workdir/guile-semver-clone.log" 2>&1
guile_semver_commit=$(git -C "$semver_src_dir" rev-parse HEAD)
(
cd "$semver_src_dir"
autoreconf -vfi
) >"$semver_bootstrap_log" 2>&1
mkdir -p "$semver_build_dir"
(
cd "$semver_build_dir"
"$semver_src_dir/configure" --prefix="$install_prefix"
) >"$semver_configure_log" 2>&1
(
cd "$semver_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 -j"${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 1)}"
) >"$semver_build_log" 2>&1
(
cd "$semver_build_dir"
"$make_bin" GUILE_AUTO_COMPILE=0 install
) >"$semver_install_log" 2>&1
semver_check=$("$guile_bin" -c '(use-modules (semver)) (display (if (procedure? string->semver) "ok" "missing-export")) (newline)')
if [ "$semver_check" != "ok" ]; then
echo "(semver) module validation failed" >&2
exit 1
fi
gnutls_check=$("$guile_bin" -c '(catch #t (lambda () (use-modules (gnutls)) (display "present") (newline)) (lambda _ (display "missing") (newline)))')
git_check=$("$guile_bin" -c '(catch #t (lambda () (use-modules (git)) (display (if (procedure? graph-descendant?) "present" "missing-export")) (newline)) (lambda _ (display "missing") (newline)))')
set +e
json_check=$("$guile_bin" -c '(use-modules (json)) (define-json-mapping <frob> make-frob frob? json->frob (a frob-a) (b frob-b "bee")) (display (if (equal? (json->frob (open-input-string "{ \"a\": 1, \"bee\": 2 }")) (make-frob 1 2)) "present" "mismatch")) (newline)')
json_rc=$?
set -e
if [ "$json_rc" -ne 0 ]; then
json_check=missing
fi
sqlite3_pkg_version=$(pkg-config --modversion sqlite3)
libgcrypt_pkg_version=$(pkg-config --modversion libgcrypt)
lzlib_pkg_version=$(pkg info lzlib | awk 'NR==1 { sub(/^lzlib-/, "", $1); print $1 }')
cat >"$env_file" <<EOF
export GUILE_EXTRA_PREFIX='$install_prefix'
export GUILE_LOAD_PATH='$site_dir'
export GUILE_LOAD_COMPILED_PATH='$site_ccache_dir'
export GUILE_EXTENSIONS_PATH='$extensions_dir'
export LD_LIBRARY_PATH='$install_prefix/lib:$guile_lib_dir:/usr/local/lib'
EOF
cat >"$metadata_file" <<EOF
guile_sqlite3_repo=$guile_sqlite3_repo
guile_sqlite3_version=$guile_sqlite3_version
guile_sqlite3_commit=$guile_sqlite3_commit
guile_gcrypt_repo=$guile_gcrypt_repo
guile_gcrypt_version=$guile_gcrypt_version
guile_gcrypt_commit=$guile_gcrypt_commit
guile_zlib_source_url=$guile_zlib_source_url
guile_zlib_version=$guile_zlib_version
guile_zlib_nix_base32=$guile_zlib_nix_base32
guile_zlib_expected_sha256_hex=$expected_zlib_sha256_hex
guile_zlib_actual_sha256_hex=$actual_zlib_sha256_hex
guile_lzlib_source_url=$guile_lzlib_source_url
guile_lzlib_repo=$guile_lzlib_repo
guile_lzlib_version=$guile_lzlib_version
guile_lzlib_nix_base32=$guile_lzlib_nix_base32
guile_lzlib_expected_sha256_hex=$expected_lzlib_sha256_hex
guile_lzlib_actual_sha256_hex=$actual_lzlib_sha256_hex
guile_lzlib_source_mode=$lzlib_source_mode
guile_lzlib_source_note=$lzlib_source_note
guile_lzlib_fallback_commit=$lzlib_fallback_commit
guile_semver_repo=$guile_semver_repo
guile_semver_version=$guile_semver_version
guile_semver_commit=$guile_semver_commit
guile_bin=$guile_bin
guile_version=$guile_version
install_prefix=$install_prefix
site_dir=$site_dir
site_ccache_dir=$site_ccache_dir
extensions_dir=$extensions_dir
sqlite3_pkg_version=$sqlite3_pkg_version
libgcrypt_pkg_version=$libgcrypt_pkg_version
lzlib_pkg_version=$lzlib_pkg_version
guile_sqlite3_bootstrap_log=$sqlite3_bootstrap_log
guile_sqlite3_configure_log=$sqlite3_configure_log
guile_sqlite3_build_log=$sqlite3_build_log
guile_sqlite3_install_log=$sqlite3_install_log
guile_gcrypt_bootstrap_log=$gcrypt_bootstrap_log
guile_gcrypt_configure_log=$gcrypt_configure_log
guile_gcrypt_build_log=$gcrypt_build_log
guile_gcrypt_install_log=$gcrypt_install_log
guile_zlib_bootstrap_log=$zlib_bootstrap_log
guile_zlib_configure_log=$zlib_configure_log
guile_zlib_build_log=$zlib_build_log
guile_zlib_install_log=$zlib_install_log
guile_lzlib_bootstrap_log=$lzlib_bootstrap_log
guile_lzlib_configure_log=$lzlib_configure_log
guile_lzlib_build_log=$lzlib_build_log
guile_lzlib_install_log=$lzlib_install_log
guile_semver_bootstrap_log=$semver_bootstrap_log
guile_semver_configure_log=$semver_configure_log
guile_semver_build_log=$semver_build_log
guile_semver_install_log=$semver_install_log
sqlite3_module_check=$sqlite3_check
gcrypt_module_check=$gcrypt_check
zlib_module_check=$zlib_check
lzlib_module_check=$lzlib_check
semver_module_check=$semver_check
gnutls_module_already_present=$gnutls_check
guile_git_module_already_present=$git_check
guile_json_module_already_present=$json_check
env_file=$env_file
EOF
if [ -n "${METADATA_OUT:-}" ]; then
mkdir -p "$(dirname "$METADATA_OUT")"
cp "$metadata_file" "$METADATA_OUT"
fi
if [ -n "${ENV_OUT:-}" ]; then
mkdir -p "$(dirname "$ENV_OUT")"
cp "$env_file" "$ENV_OUT"
fi
printf 'PASS local-guile-configure-deps-build\n'
printf 'sqlite3 module check: %s\n' "$sqlite3_check"
printf 'gcrypt module check: %s\n' "$gcrypt_check"
printf 'zlib module check: %s\n' "$zlib_check"
printf 'lzlib module check: %s\n' "$lzlib_check"
printf 'semver module check: %s\n' "$semver_check"
printf 'Existing (gnutls) module in prefix: %s\n' "$gnutls_check"
printf 'Existing (git) module in prefix: %s\n' "$git_check"
printf 'Existing (json) module in prefix: %s\n' "$json_check"
printf 'Environment file: %s\n' "$env_file"
printf 'Metadata file: %s\n' "$metadata_file"
if [ -n "${ENV_OUT:-}" ]; then
printf 'Copied environment file to: %s\n' "$ENV_OUT"
fi
if [ -n "${METADATA_OUT:-}" ]; then
printf 'Copied metadata file to: %s\n' "$METADATA_OUT"
fi
printf '%s\n' '--- metadata ---'
cat "$metadata_file"

View File

@@ -5,12 +5,17 @@ source_repo=${GUIX_SOURCE_REPO:-"$HOME/repos/guix"}
store_dir=${STORE_DIR:-/frx/store}
localstatedir=${LOCALSTATEDIR:-/frx/var}
sysconfdir=${SYSCONFDIR:-/frx/etc}
guile_bin=${GUILE_BIN:-/tmp/guile-freebsd-validate-install/bin/guile}
make_bin=${MAKE_BIN:-gmake}
if [ ! -x "$guile_bin" ]; then
echo "Guile binary is not executable: $guile_bin" >&2
exit 1
fi
if ! command -v "$make_bin" >/dev/null 2>&1; then
echo "Required make tool not found: $make_bin" >&2
exit 1
fi
guile_bindir=$(CDPATH= cd -- "$(dirname "$guile_bin")" && pwd)
guile_prefix=$(CDPATH= cd -- "$guile_bindir/.." && pwd)
@@ -71,12 +76,14 @@ build_courage=$workdir/build-with-courage
bootstrap_log=$workdir/bootstrap.log
unsupported_log=$workdir/configure-unsupported.log
courage_log=$workdir/configure-with-courage.log
make_scripts_log=$workdir/make-scripts-guix.log
guix_version_log=$workdir/pre-inst-env-guix-version.log
derivation_log=$workdir/pre-inst-env-guix-build-hello-derivation.log
metadata_file=$workdir/derivation-generation-investigation.txt
gnutls_check_out=$workdir/guile-gnutls-check.out
gnutls_check_err=$workdir/guile-gnutls-check.err
printf 'Working directory: %s\n' "$workdir"
printf 'Cloning source from: %s\n' "$source_repo"
rm -rf "$srcclone"
git clone --shared "$source_repo" "$srcclone" >/dev/null 2>&1
(
@@ -84,6 +91,7 @@ git clone --shared "$source_repo" "$srcclone" >/dev/null 2>&1
./bootstrap
) >"$bootstrap_log" 2>&1
rm -rf "$build_unsupported" "$build_courage"
mkdir -p "$build_unsupported" "$build_courage"
set +e
@@ -92,6 +100,7 @@ set +e
PKG_CONFIG_PATH=/usr/local/libdata/pkgconfig:/usr/local/lib/pkgconfig \
CPPFLAGS='-I/usr/local/include' \
LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib' \
MAKE="$make_bin" \
GUILE="$guile_bin" \
GUILE_EFFECTIVE_VERSION=3.0 \
"$srcclone/configure" \
@@ -106,6 +115,7 @@ unsupported_rc=$?
PKG_CONFIG_PATH=/usr/local/libdata/pkgconfig:/usr/local/lib/pkgconfig \
CPPFLAGS='-I/usr/local/include' \
LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib' \
MAKE="$make_bin" \
GUILE="$guile_bin" \
GUILE_EFFECTIVE_VERSION=3.0 \
"$srcclone/configure" \
@@ -118,39 +128,33 @@ courage_rc=$?
set -e
unsupported_summary=$(grep -E "supported platform|Guix system type|configure: error" "$unsupported_log" | tail -n 5 || true)
courage_summary=$(grep -E "supported platform|GnuTLS|guile 3.0|Guile-Git|Guile-JSON|Guile-SQLite3|Guile-Gcrypt|Guile-zlib|Guile-lzlib|Guile-semver|configure: error|configure: WARNING" "$courage_log" | tail -n 10 || true)
courage_error=$(grep -E "^configure: error:" "$courage_log" | tail -n 1 | sed 's/^configure: error: //' || true)
courage_summary=$(grep -E "supported platform|GnuTLS|Guile-Git|Guile-JSON|Guile-Sqlite3|Guile-Gcrypt|Guile-zlib|Guile-lzlib|Guile-semver|configure: error|configure: WARNING|checking whether Guile" "$courage_log" | tail -n 16 || true)
courage_error=$(grep -E '^configure: error:' "$courage_log" | tail -n 1 | sed 's/^configure: error: //' || true)
local_gnutls_check=missing
set +e
"$guile_bin" -c '(use-modules (gnutls)) (display "ok") (newline)' >"$gnutls_check_out" 2>"$gnutls_check_err"
check_rc=$?
set -e
if [ "$check_rc" -eq 0 ]; then
local_gnutls_check=present
fi
module_probe() {
name=$1
code=$2
out=$3
err=$4
set +e
"$guile_bin" -c "$code" >"$out" 2>"$err"
rc=$?
set -e
if [ "$rc" -eq 0 ] && [ "$(tr -d '\n' < "$out")" = ok ]; then
printf 'present'
else
printf 'missing'
fi
}
git_check_out=$workdir/guile-git-check.out
git_check_err=$workdir/guile-git-check.err
local_git_check=missing
set +e
"$guile_bin" -c '(use-modules (git)) (display (if (procedure? graph-descendant?) "ok" "missing-export")) (newline)' >"$git_check_out" 2>"$git_check_err"
check_rc=$?
set -e
if [ "$check_rc" -eq 0 ] && [ "$(tr -d '\n' < "$git_check_out")" = ok ]; then
local_git_check=present
fi
json_check_out=$workdir/guile-json-check.out
json_check_err=$workdir/guile-json-check.err
local_json_check=missing
set +e
"$guile_bin" -c '(use-modules (json)) (define-json-mapping <frob> make-frob frob? json->frob (a frob-a) (b frob-b "bee")) (display (if (equal? (json->frob (open-input-string "{ \"a\": 1, \"bee\": 2 }")) (make-frob 1 2)) "ok" "mismatch")) (newline)' >"$json_check_out" 2>"$json_check_err"
check_rc=$?
set -e
if [ "$check_rc" -eq 0 ] && [ "$(tr -d '\n' < "$json_check_out")" = ok ]; then
local_json_check=present
fi
local_gnutls_check=$(module_probe gnutls '(use-modules (gnutls)) (display "ok") (newline)' "$workdir/guile-gnutls-check.out" "$workdir/guile-gnutls-check.err")
local_git_check=$(module_probe git '(use-modules (git)) (display (if (procedure? graph-descendant?) "ok" "missing-export")) (newline)' "$workdir/guile-git-check.out" "$workdir/guile-git-check.err")
local_json_check=$(module_probe json '(use-modules (json)) (define-json-mapping <frob> make-frob frob? json->frob (a frob-a) (b frob-b "bee")) (display (if (equal? (json->frob (open-input-string "{ \"a\": 1, \"bee\": 2 }")) (make-frob 1 2)) "ok" "mismatch")) (newline)' "$workdir/guile-json-check.out" "$workdir/guile-json-check.err")
local_sqlite3_check=$(module_probe sqlite3 '(use-modules (sqlite3)) (display (if (procedure? sqlite-bind-arguments) "ok" "missing-export")) (newline)' "$workdir/guile-sqlite3-check.out" "$workdir/guile-sqlite3-check.err")
local_gcrypt_check=$(module_probe gcrypt '(use-modules (gcrypt hash)) (display (if (equal? (hash-algorithm sha256) (lookup-hash-algorithm (quote sha256))) "ok" "mismatch")) (newline)' "$workdir/guile-gcrypt-check.out" "$workdir/guile-gcrypt-check.err")
local_zlib_check=$(module_probe zlib '(use-modules (zlib)) (display (if (procedure? make-zlib-input-port) "ok" "missing-export")) (newline)' "$workdir/guile-zlib-check.out" "$workdir/guile-zlib-check.err")
local_lzlib_check=$(module_probe lzlib '(use-modules (lzlib)) (display "ok") (newline)' "$workdir/guile-lzlib-check.out" "$workdir/guile-lzlib-check.err")
local_semver_check=$(module_probe semver '(use-modules (semver)) (display (if (procedure? string->semver) "ok" "missing-export")) (newline)' "$workdir/guile-semver-check.out" "$workdir/guile-semver-check.err")
if [ "$unsupported_rc" -eq 0 ]; then
echo "configure without --with-courage unexpectedly succeeded" >&2
@@ -160,36 +164,99 @@ if ! grep -q "not a supported platform" "$unsupported_log"; then
echo "configure without --with-courage failed, but not for the expected unsupported-platform reason" >&2
exit 1
fi
if [ "$courage_rc" -eq 0 ]; then
echo "configure with --with-courage unexpectedly succeeded; investigation expectations need updating" >&2
exit 1
fi
if [ "$local_gnutls_check" = missing ]; then
if ! grep -q "Guile bindings of GnuTLS are missing" "$courage_log"; then
echo "configure with --with-courage failed, but not for the expected missing-GnuTLS-bindings reason" >&2
exit 1
scripts_rc=not-run
guix_version_rc=not-run
derivation_rc=not-run
make_scripts_summary=
guix_version_summary=
derivation_summary=
investigation_stage=configure-failed
if [ "$courage_rc" -ne 0 ]; then
if [ "$local_gnutls_check" = missing ]; then
grep -q "Guile bindings of GnuTLS are missing" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-GnuTLS-bindings reason" >&2
exit 1
}
elif [ "$local_git_check" = missing ]; then
grep -q "Guile-Git is missing" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-Git reason" >&2
exit 1
}
elif [ "$local_json_check" = missing ]; then
grep -q "Guile-JSON is missing" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-JSON reason" >&2
exit 1
}
elif [ "$local_sqlite3_check" = missing ]; then
grep -q "Guile-SQLite3 could not be found" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-SQLite3 reason" >&2
exit 1
}
elif [ "$local_gcrypt_check" = missing ]; then
grep -q "Guile-Gcrypt could not be found" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-Gcrypt reason" >&2
exit 1
}
elif [ "$local_zlib_check" = missing ]; then
grep -q "Guile-zlib could not be found" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-zlib reason" >&2
exit 1
}
elif [ "$local_lzlib_check" = missing ]; then
grep -q "Guile-lzlib is missing" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-lzlib reason" >&2
exit 1
}
elif [ "$local_semver_check" = missing ]; then
grep -q "Guile-semver is missing" "$courage_log" || {
echo "configure with --with-courage failed, but not for the expected missing-Guile-semver reason" >&2
exit 1
}
fi
else
if grep -q "Guile bindings of GnuTLS are missing" "$courage_log"; then
echo "configure with --with-courage still reports missing GnuTLS bindings even though (gnutls) loads" >&2
exit 1
fi
fi
if [ "$local_gnutls_check" = present ] && [ "$local_git_check" = missing ]; then
if ! grep -q "Guile-Git is missing" "$courage_log"; then
echo "configure with --with-courage failed, but not for the expected missing-Guile-Git reason" >&2
exit 1
fi
fi
if [ "$local_gnutls_check" = present ] && [ "$local_git_check" = present ] && [ "$local_json_check" = missing ]; then
if ! grep -q "Guile-JSON is missing" "$courage_log"; then
echo "configure with --with-courage failed, but not for the expected missing-Guile-JSON reason" >&2
exit 1
fi
elif [ "$local_json_check" = present ]; then
if grep -q "Guile-JSON is missing" "$courage_log"; then
echo "configure with --with-courage still reports missing Guile-JSON even though (json) works" >&2
exit 1
investigation_stage=configured
set +e
(
cd "$build_courage"
"$make_bin" -j1 scripts/guix
) >"$make_scripts_log" 2>&1
scripts_rc=$?
set -e
make_scripts_summary=$(tail -n 20 "$make_scripts_log" 2>/dev/null || true)
if [ "$scripts_rc" -eq 0 ]; then
investigation_stage=scripts-guix-built
set +e
(
cd "$build_courage"
./pre-inst-env guix --version
) >"$guix_version_log" 2>&1
guix_version_rc=$?
set -e
guix_version_summary=$(tail -n 30 "$guix_version_log" 2>/dev/null || true)
if [ "$guix_version_rc" -eq 0 ]; then
investigation_stage=guix-version-ok
set +e
(
cd "$build_courage"
./pre-inst-env guix build -d hello
) >"$derivation_log" 2>&1
derivation_rc=$?
set -e
derivation_summary=$(tail -n 40 "$derivation_log" 2>/dev/null || true)
if [ "$derivation_rc" -eq 0 ]; then
investigation_stage=derivation-generated
else
investigation_stage=derivation-failed
fi
else
investigation_stage=guix-version-failed
fi
else
investigation_stage=scripts-guix-build-failed
fi
fi
@@ -199,6 +266,7 @@ srcclone=$srcclone
guile_bin=$guile_bin
guile_version=$guile_version
guile_extra_prefix=${GUILE_EXTRA_PREFIX:-<unset>}
make_bin=$make_bin
store_dir=$store_dir
localstatedir=$localstatedir
sysconfdir=$sysconfdir
@@ -208,15 +276,36 @@ configure_with_courage_log=$courage_log
configure_without_courage_rc=$unsupported_rc
configure_with_courage_rc=$courage_rc
configure_with_courage_error=${courage_error:-<none>}
make_scripts_guix_log=$make_scripts_log
make_scripts_guix_rc=$scripts_rc
pre_inst_env_guix_version_log=$guix_version_log
pre_inst_env_guix_version_rc=$guix_version_rc
pre_inst_env_guix_build_derivation_log=$derivation_log
pre_inst_env_guix_build_derivation_rc=$derivation_rc
investigation_stage=$investigation_stage
local_guile_gnutls_module=$local_gnutls_check
local_guile_git_module=$local_git_check
local_guile_json_module=$local_json_check
local_guile_sqlite3_module=$local_sqlite3_check
local_guile_gcrypt_module=$local_gcrypt_check
local_guile_zlib_module=$local_zlib_check
local_guile_lzlib_module=$local_lzlib_check
local_guile_semver_module=$local_semver_check
unsupported_summary_begin
$unsupported_summary
unsupported_summary_end
courage_summary_begin
$courage_summary
courage_summary_end
make_scripts_summary_begin
$make_scripts_summary
make_scripts_summary_end
guix_version_summary_begin
$guix_version_summary
guix_version_summary_end
derivation_summary_begin
$derivation_summary
derivation_summary_end
EOF
if [ -n "${METADATA_OUT:-}" ]; then
@@ -227,15 +316,44 @@ fi
printf 'PASS guix-derivation-generation-investigation\n'
printf 'Store dir under test: %s\n' "$store_dir"
printf 'Finding 1: configure without --with-courage is blocked by unsupported platform gating.\n'
if [ "$local_gnutls_check" = missing ]; then
printf 'Finding 2: configure with --with-courage is currently blocked by missing Guile (gnutls) bindings.\n'
elif [ "$local_git_check" = missing ]; then
printf 'Finding 2: Guile (gnutls) is available, but configure is now blocked by missing Guile-Git.\n'
elif [ "$local_json_check" = missing ]; then
printf 'Finding 2: Guile (gnutls) and Guile-Git are available, but configure is now blocked by missing Guile-JSON.\n'
else
printf 'Finding 2: Guile (gnutls), Guile-Git, and Guile-JSON are available; next blocker: %s\n' "${courage_error:-unknown configure failure}"
fi
case "$investigation_stage" in
configure-failed)
if [ "$local_gnutls_check" = missing ]; then
printf 'Finding 2: configure with --with-courage is currently blocked by missing Guile (gnutls) bindings.\n'
elif [ "$local_git_check" = missing ]; then
printf 'Finding 2: Guile (gnutls) is available, but configure is now blocked by missing Guile-Git.\n'
elif [ "$local_json_check" = missing ]; then
printf 'Finding 2: Guile (gnutls) and Guile-Git are available, but configure is now blocked by missing Guile-JSON.\n'
elif [ "$local_sqlite3_check" = missing ]; then
printf 'Finding 2: configure now advances to missing recent Guile-SQLite3.\n'
elif [ "$local_gcrypt_check" = missing ]; then
printf 'Finding 2: configure now advances to missing recent Guile-Gcrypt.\n'
elif [ "$local_zlib_check" = missing ]; then
printf 'Finding 2: configure now advances to missing recent Guile-zlib.\n'
elif [ "$local_lzlib_check" = missing ]; then
printf 'Finding 2: configure now advances to missing Guile-lzlib.\n'
elif [ "$local_semver_check" = missing ]; then
printf 'Finding 2: configure now advances to missing Guile-semver.\n'
else
printf 'Finding 2: configure reached a non-module blocker: %s\n' "${courage_error:-unknown configure failure}"
fi
;;
scripts-guix-build-failed)
printf 'Finding 2: configure succeeds with MAKE=%s, but building scripts/guix is the next blocker.\n' "$make_bin"
;;
guix-version-failed)
printf 'Finding 2: configure succeeds and scripts/guix builds, but ./pre-inst-env guix --version is the next blocker.\n'
;;
derivation-failed)
printf 'Finding 2: ./pre-inst-env guix --version works, but guix build -d hello is the next blocker.\n'
;;
derivation-generated)
printf 'Finding 2: derivation generation for hello succeeded.\n'
;;
*)
printf 'Finding 2: investigation stage %s.\n' "$investigation_stage"
;;
esac
if [ "$cleanup" -eq 0 ]; then
printf 'Metadata file: %s\n' "$metadata_file"
else