Skip to content

Commit a1705a8

Browse files
committed
fix(build): align module paths across generators
- force a flat lib directory for Debian and Ubuntu packaging - add diagnostics when deployed module trees are missing or empty - write module test lists per configuration for multi-config generators
1 parent 993ac3d commit a1705a8

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,16 @@ jobs:
403403
# redirects where the build puts things. The AppDir is produced by
404404
# `cmake --install` below, which is the same tree a distribution
405405
# gets, so CI stops assembling something nobody else can reproduce.
406+
#
407+
# LIBDIR is pinned because a /usr prefix on Debian/Ubuntu makes
408+
# GNUInstallDirs pick the multiarch lib/<triplet>, which put the
409+
# modules under usr/lib/aarch64-linux-gnu/ -- where neither the
410+
# deployment below nor the AppImage runtime ($APPDIR/usr/lib/
411+
# gpgfrontend/modules) looks for them.
406412
cmake -B ${{github.workspace}}/build -G Ninja \
407413
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
408414
-DCMAKE_INSTALL_PREFIX=/usr \
415+
-DCMAKE_INSTALL_LIBDIR=lib \
409416
-DGPGFRONTEND_BUILD_STABLE=${{env.GPGFRONTEND_BUILD_STABLE}} \
410417
-DGPGFRONTEND_BUILD_PORTABLE=${{env.GPGFRONTEND_BUILD_PORTABLE}} \
411418
-DGPGFRONTEND_LINK_GPGME_INTO_CORE=ON \
@@ -528,12 +535,17 @@ jobs:
528535
# single flat directory, which the namespace layout no longer has:
529536
# each module owns usr/lib/gpgfrontend/modules/<key>/native/.
530537
MODULE_ROOT="$APP_DIR/usr/lib/gpgfrontend/modules"
531-
test -d "$MODULE_ROOT"
538+
test -d "$MODULE_ROOT" || {
539+
echo "no module tree at $MODULE_ROOT; installed module trees:" >&2
540+
find "$APP_DIR" -type d -path '*/gpgfrontend/modules' >&2 || true
541+
exit 1
542+
}
532543
EXECUTABLES=()
533544
while read -r native; do
534545
EXECUTABLES+=("-executable=$native")
535546
done < <(find "$MODULE_ROOT" -type f -name '*.so' | sort)
536-
test "${#EXECUTABLES[@]}" -gt 0
547+
test "${#EXECUTABLES[@]}" -gt 0 \
548+
|| { echo "no module natives under $MODULE_ROOT" >&2; exit 1; }
537549
echo "deploying ${#EXECUTABLES[@]} module native(s)"
538550
539551
chmod u+x linuxdeployqt-continuous.AppImage

‎CMakeLists.txt‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,14 +726,25 @@ add_subdirectory(src)
726726
# The module test binaries, registered by gf_register_module_test(). Removed
727727
# when there are none, so a tree reconfigured without tests does not keep
728728
# running a stale list.
729+
#
730+
# A multi-config generator (Xcode, Visual Studio, Ninja Multi-Config) resolves
731+
# $<TARGET_FILE> once per configuration, and one output path would then be
732+
# written with different content per configuration, which is a generate-time
733+
# error. There the list goes beside that configuration's binaries instead.
729734
get_property(gf_module_tests GLOBAL PROPERTY GPGFRONTEND_MODULE_TEST_TARGETS)
735+
get_property(gf_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
730736
set(gf_module_test_list "${CMAKE_BINARY_DIR}/test-bin/module-tests.list")
731737
if(gf_module_tests)
732738
set(gf_module_test_lines "")
733739
foreach(gf_test IN LISTS gf_module_tests)
734740
string(APPEND gf_module_test_lines "$<TARGET_FILE:${gf_test}>\n")
735741
endforeach()
736-
file(GENERATE OUTPUT "${gf_module_test_list}"
742+
set(gf_module_test_output "${gf_module_test_list}")
743+
if(gf_multi_config)
744+
set(gf_module_test_output
745+
"${CMAKE_BINARY_DIR}/test-bin/$<CONFIG>/module-tests.list")
746+
endif()
747+
file(GENERATE OUTPUT "${gf_module_test_output}"
737748
CONTENT "${gf_module_test_lines}")
738749
else()
739750
file(REMOVE "${gf_module_test_list}")

0 commit comments

Comments
 (0)