Skip to content

build(cmake): add pofiles dep to every NLS-aware executable - #98

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/app-catalogs-target-dep
Jun 11, 2026
Merged

build(cmake): add pofiles dep to every NLS-aware executable#98
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/app-catalogs-target-dep

Conversation

@got3nks

@got3nks got3nks commented Jun 11, 2026

Copy link
Copy Markdown

Followup to #94 — found while exercising partial-target builds during VM testing of the manpage pipeline.

Summary

gettext_process_po_files puts the per-language .gmo build in CMake's all target 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 .gmo step entirely on Linux. 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 covering every executable aMule ships:

amule amuled amulecmd amulegui amuleweb ed2k alc alcc cas wxcas fileview

pofiles is the aggregator target that gettext_process_po_files maintains internally — making each binary depend on it pulls the full catalog build into any partial-target invocation. Gated on ENABLE_NLS AND TARGET pofiles, which also covers the ENABLE_NLS=YES-but-msgfmt-missing edge case where po/ isn't entered.

Test plan

Run on Ubuntu 26.04 ARM64.

  • Before fix (master tip)cmake -B build -DBUILD_DAEMON=YES && cmake --build build --target amuled && cmake --install buildCMake Error … file INSTALL cannot find .../build/po/ar.gmo
  • After fix — same sequence: 37 .gmo files built as a side effect of --target amuled, install completes cleanly, 37 .mo files land at share/locale/<lang>/LC_MESSAGES/amule.mo
  • --target for any other binary (verified amulecmd, ed2k) pulls in the same 37-file catalog build
  • ENABLE_NLS=OFF configure still works — the loop is a no-op since TARGET pofiles is false
  • macOS configure still works — the dependency lands the same way; the .mo install path is Mac-specific (POST_BUILD on the .app bundle, no install(FILES ${gmo}) rule), so this fix is invisible there but not harmful
  • Full cmake --build build (ALL) behavior unchanged — .gmo was already in all, this just adds a redundant edge

Scope

Only the catalog dependency. The orthogonal issue of cmake --install build failing on binaries you didn't build (e.g. --target amuled then trying to install amulecmd) is separate scope; it requires either making install depend on its target arguments or accepting the current "build everything, then install" contract. Not addressed here.

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.
@got3nks
got3nks merged commit 3bb7803 into amule-org:master Jun 11, 2026
10 checks passed
@got3nks
got3nks deleted the fix/app-catalogs-target-dep branch June 11, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant