From d457b6e564cdd3bea276a038817d3583a44c8c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20O=2E=20S=C3=B8rensen?= Date: Wed, 5 Aug 2026 14:11:47 +0200 Subject: [PATCH] build: Build only the library, not the whole tree Runs make -C gnulib then make -C liblouis rather than a top level make. The tree also contains tools/, tables/, man/, doc/, tests/, python/ and windows/, none of which reach a package. Speed is the lesser reason. A failure under tools/ does not stop a top level make: the win-arm64 build once emitted eight link errors there and still exited 0, which hid a real problem in several thousand lines of log. Building only what is shipped means any failure is about the thing being shipped. It also removes the libtool "could not determine the host path" warnings, which come from the wrapper scripts it generates around uninstalled executables. 48 in a full container build, none now. gnulib is named explicitly because make will not build a sibling directory on demand: make -C liblouis alone stops with "No rule to make target '../gnulib/libgnu.la'". Skipping tables/ is safe. The two tables generated there with m4, nl-chardefs.uti and nl-NL-g0.utb, also ship pre-generated in the release tarball, so LibLouis.NET.Tables still stages a complete set. All eight RIDs build and verify unchanged. Container wall clock 636s against 849s, and the serial Windows targets gain most: win-x86 500s against 630s, win-arm64 222s against 334s. Co-Authored-By: Claude Opus 5 --- .gitignore | 3 +++ PACKAGING.md | 21 +++++++++++++++++++++ build/build_runtime_macos_packages.sh | 7 ++++++- build/build_runtime_packages.sh | 17 +++++++++++++++-- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 86c063c..cedb7b8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ runtime.*.liblouis/runtimes/ # Rider / ReSharper per-user settings *.DotSettings.user + +# Worktrees created by spawned Claude Code sessions +.claude/worktrees/ diff --git a/PACKAGING.md b/PACKAGING.md index a1ae783..1bfe967 100644 --- a/PACKAGING.md +++ b/PACKAGING.md @@ -119,6 +119,27 @@ mean x86: Both were still present in liblouis 3.38.0, so expect them to survive an upstream bump. +### Only the library is built + +The build runs `make -C gnulib` then `make -C liblouis`, not a top level `make`. The tree also +contains `tools/`, `tables/`, `man/`, `doc/`, `tests/`, `python/` and `windows/`, none of which +reach a package. + +The reason is not only speed. A failure under `tools/` does not stop a top level `make`: the +`win-arm64` build once emitted eight link errors there and still exited 0, which hid a real problem +in several thousand lines of log. Building only what is shipped means any failure is about the +thing being shipped. It also removes libtool's `could not determine the host path` warnings, which +come from the wrapper scripts it generates around uninstalled executables and were pure noise: 48 +of them in a full build, none now. + +gnulib has to be named explicitly and built first. liblouis links `gnulib/libgnu.la`, and make does +not build a sibling directory on demand — `make -C liblouis` alone stops with `No rule to make +target '../gnulib/libgnu.la'`. + +Skipping `tables/` is safe because the two tables generated there with m4, `nl-chardefs.uti` and +`nl-NL-g0.utb`, are also shipped pre-generated in the release tarball, so `LibLouis.NET.Tables` +still stages a complete set. + ### Self-contained Windows binaries The Windows targets are built with `-static-libgcc`. Without it, 32-bit mingw links against diff --git a/build/build_runtime_macos_packages.sh b/build/build_runtime_macos_packages.sh index c2f81dd..960275f 100755 --- a/build/build_runtime_macos_packages.sh +++ b/build/build_runtime_macos_packages.sh @@ -28,7 +28,12 @@ build_runtime_nuget_macos() { export CPPFLAGS="-arch $arch" ./configure --enable-ucs4 --enable-year2038 --host="$host" - make -j"$(cpu_count)" + + # Only the library is packaged; see build_runtime_packages.sh. gnulib has to be built + # first and by name, because liblouis links against gnulib/libgnu.la and make will not + # build a sibling directory on demand. + make -j"$(cpu_count)" -C gnulib + make -j"$(cpu_count)" -C liblouis target_dir="$REPO_ROOT/runtime.$rid.liblouis/runtimes/$rid/native" mkdir -p "$target_dir" diff --git a/build/build_runtime_packages.sh b/build/build_runtime_packages.sh index 5d616b9..3b1c688 100755 --- a/build/build_runtime_packages.sh +++ b/build/build_runtime_packages.sh @@ -75,10 +75,23 @@ build_runtime_nuget() { *) jobs=$(cpu_count) ;; esac + # Only the library is packaged, so only the library is built. The tree also contains + # tools/, tables/, man/, doc/, tests/, python/ and windows/, none of which reach a package. + # + # This is not just speed. A failure in tools/ does not stop the top level make - the + # win-arm64 build once emitted eight link errors there and still exited 0, which buried a + # real problem in the log. Building only what is shipped means any failure is about the + # thing being shipped. It also removes libtool's "could not determine the host path" + # warnings, which come from wrapper scripts generated around uninstalled executables. + # + # gnulib first and explicitly: liblouis links against gnulib/libgnu.la, and make will not + # build a sibling directory on demand - it stops with "No rule to make target". if [ -n "$extra_cflags" ]; then - make -j"$jobs" CFLAGS="$extra_cflags" + make -j"$jobs" -C gnulib CFLAGS="$extra_cflags" + make -j"$jobs" -C liblouis CFLAGS="$extra_cflags" else - make -j"$jobs" + make -j"$jobs" -C gnulib + make -j"$jobs" -C liblouis fi target_dir="$REPO_ROOT/runtime.$rid.liblouis/runtimes/$rid/native"