solenv/gbuild/CppunitTest.mk |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 533e993f2d11814252c40d60bdab469de03b14db
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Nov 17 14:23:41 2023 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Nov 17 16:57:01 2023 +0100

    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
    <https://ci.libreoffice.org/job/lo_ubsan/2982/> 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 <sberg...@redhat.com>

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) \

Reply via email to