From 533e993f2d11814252c40d60bdab469de03b14db Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 17 Nov 2023 14:23:41 +0100 Subject: [PATCH] Don't reuse --unit values across (sequential, even) systemd-run invocations At least some old versions of systemd-run apparently have occasional issues when sequential invocations reuse the same --unit value, as now (i.e., after the machine was updated to auto-detect --with-coredumpctl) failed with > [build CUT] basctl_dialogs_test > LO_TEST_LOCALE=de > Running scope as unit: -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope [...] > LO_TEST_LOCALE=en-US > Running scope as unit: -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope [...] > LO_TEST_LOCALE=fi > Failed to start transient scope unit: Unit -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope already exists. Change-Id: If009e26231228bec739637e4140be90c0b86d6b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159569 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- solenv/gbuild/CppunitTest.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 18af97e7fff1..adfcccce49fb 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -27,7 +27,7 @@ gb_CppunitTest_coredumpctl_setup := gb_CppunitTest_coredumpctl_run := else gb_CppunitTest_coredumpctl_setup = \ - export LIBO_TEST_UNIT=$$($(SYSTEMD_ESCAPE) "$1:$$(date -u +%Y%m%d%H%M%S):$$$$" | cut -b -249) && + export LIBO_TEST_UNIT=$$($(SYSTEMD_ESCAPE) "$1:$$(date -u +%Y%m%d%H%M%S):$$$$$(if $2,:$2)" | cut -b -249) && gb_CppunitTest_coredumpctl_run := $(SYSTEMD_RUN) --scope --user --unit="$$LIBO_TEST_UNIT" endif @@ -135,10 +135,11 @@ else $(if $(gb_CppunitTest__interactive),, \ $(if $(value gb_CppunitTest_postprocess), \ rm -fr $@.core && mkdir $@.core && cd $@.core &&)) \ - $(call gb_CppunitTest_coredumpctl_setup,$@) \ ( \ $(if $(gb_CppunitTest_localized),for l in $(WITH_LANG_LIST) ; do \ - printf 'LO_TEST_LOCALE=%s\n' "$$l" && LO_TEST_LOCALE="$$l" ) \ + printf 'LO_TEST_LOCALE=%s\n' "$$l" && ) \ + $(call gb_CppunitTest_coredumpctl_setup,$@,$(if $(gb_CppunitTest_localized),$$l)) \ + $(if $(gb_CppunitTest_localized),LO_TEST_LOCALE="$$l") \ $(if $(gb_CppunitTest__vcl_no_svp), \ $(filter-out SAL_USE_VCLPLUGIN=svp,$(gb_TEST_ENV_VARS)),$(gb_TEST_ENV_VARS)) \ $(EXTRA_ENV_VARS) \