build(cmake): add pofiles dep to every NLS-aware executable - #98
Merged
Merged
Conversation
CMake's gettext_process_po_files puts the per-language .gmo builds in
the all target but adds no dependency to any specific binary. Building
one binary in isolation (e.g. cmake --build build --target amuled) on
a Linux host therefore skips the .gmo step entirely. The subsequent
cmake --install build then errors with
CMake Error at build/po/cmake_install.cmake:46 (file):
file INSTALL cannot find ".../build/po/ar.gmo": No such file or
directory.
because the install (FILES ${gmo}) rules issued from po/CMakeLists.txt
fire unconditionally for every enabled language. Reproduces against
any partial-target build on Linux.
Add a single sweeping add_dependencies(pofiles) loop at the end of
src/CMakeLists.txt that covers every executable amule ships:
amule amuled amulecmd amulegui amuleweb ed2k
alc alcc cas wxcas fileview
Gated on ENABLE_NLS AND TARGET pofiles. pofiles is the aggregator
target gettext_process_po_files maintains internally; making each
binary depend on it pulls the full catalog build into any
partial-target invocation. TARGET pofiles also covers the
ENABLE_NLS=YES-but-msgfmt-missing edge case where po/ isn't entered.
Mac doesn't install .mo files for daemon-style binaries (the APPLE
branch in po/CMakeLists.txt defers to a POST_BUILD on the amule .app
bundle), so the install failure is Linux-only -- but the dependency
fix lands cleanly on every platform and makes partial builds robust
across all of them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #94 — found while exercising partial-target builds during VM testing of the manpage pipeline.
Summary
gettext_process_po_filesputs the per-language.gmobuild in CMake'salltarget but adds no dependency to any specific binary target. So building one binary in isolation — e.g.cmake --build build --target amuled— silently skips the.gmostep entirely on Linux. The subsequentcmake --install buildthen errors with:because the
install (FILES ${gmo})rules issued frompo/CMakeLists.txtfire unconditionally for every enabled language. Reproduces against any partial-target build on Linux.Add a single sweeping
add_dependencies(..., pofiles)loop at the end ofsrc/CMakeLists.txtcovering every executable aMule ships:amule amuled amulecmd amulegui amuleweb ed2k alc alcc cas wxcas fileviewpofilesis the aggregator target thatgettext_process_po_filesmaintains internally — making each binary depend on it pulls the full catalog build into any partial-target invocation. Gated onENABLE_NLS AND TARGET pofiles, which also covers theENABLE_NLS=YES-but-msgfmt-missing edge case wherepo/isn't entered.Test plan
Run on Ubuntu 26.04 ARM64.
cmake -B build -DBUILD_DAEMON=YES && cmake --build build --target amuled && cmake --install build→CMake Error … file INSTALL cannot find .../build/po/ar.gmo.gmofiles built as a side effect of--target amuled, install completes cleanly, 37.mofiles land atshare/locale/<lang>/LC_MESSAGES/amule.mo--targetfor any other binary (verifiedamulecmd,ed2k) pulls in the same 37-file catalog buildENABLE_NLS=OFFconfigure still works — the loop is a no-op sinceTARGET pofilesis false.moinstall path is Mac-specific (POST_BUILD on the.appbundle, noinstall(FILES ${gmo})rule), so this fix is invisible there but not harmfulcmake --build build(ALL) behavior unchanged —.gmowas already inall, this just adds a redundant edgeScope
Only the catalog dependency. The orthogonal issue of
cmake --install buildfailing on binaries you didn't build (e.g.--target amuledthen trying to installamulecmd) is separate scope; it requires either makinginstalldepend on its target arguments or accepting the current "build everything, then install" contract. Not addressed here.