core-init-ext: add more checking and verbose errors to checkPhase
Run nix flake check / build (push) Failing after 10m23s

This commit is contained in:
2026-06-04 19:28:21 +09:00
parent 8afa09b948
commit 874e22c2e7
+16 -1
View File
@@ -79,6 +79,18 @@ in stdenv.mkDerivation (finalAttrs: {
checkPhase = ''
runHook preCheck
for ext in ${lib.escapeShellArgs (builtins.catAttrs "library" extensions)}; do
if [ ! -f "$ext" ]; then
echo "Extension $ext does not exist."
exit 1
fi
if ! file "$ext" | grep -qE "ELF|ar archive"; then
echo "Extension $ext does not appear to be a valid shared library or static archive."
exit 1
fi
done
for ext in ${lib.escapeShellArgs (builtins.catAttrs "library" extensions)}; do
if nm -g --defined-only "$ext" | grep -q " sqlite_api$"; then
echo "Extension $ext appears to reference the 'sqlite_api' symbol, which is not expected for extensions which are going to be statically linked."
@@ -92,8 +104,11 @@ in stdenv.mkDerivation (finalAttrs: {
${lib.concatMapStringsSep "\n" (ext: "expectedSymbols[${lib.escapeShellArg ext.shutdown}]=${lib.escapeShellArg ext.library};") (lib.filter (ext: ext.shutdown or null != null) extensions)}
for sym in "''${!expectedSymbols[@]}"; do
if ! nm -g --defined-only "''${expectedSymbols[$sym]}" | grep -q " ''${sym}$"; then
SYMBOL_LIST=$(nm -g --defined-only "''${expectedSymbols[$sym]}" | awk '{print $3}' | sed '/^[[:space:]]*$/d')
if ! grep -q "''${sym}$" <<< "$SYMBOL_LIST"; then
echo "Expected symbol $sym not found in ''${expectedSymbols[$sym]}."
echo "Found symbols:"
echo "$SYMBOL_LIST"
exit 1
fi
done