CustomTarget_html.mk |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit f1f75b9cd0c51cb3872a3fa8fb5beee86f04490a
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Wed Dec 14 09:51:51 2022 +0100
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Mon Dec 19 11:28:59 2022 +0000

    Fix prepending xargs to gb_ExternalExecutable_get_command, help part
    
    ...as was done in f048f02f505704a76c4f01b4ff3f369e8ed928b5 "hid2file.js
    generation: process in batch, not each file one-by-one", causing my build to
    fail with
    
    > [XSL] CustomTarget/helpcontent2/help3xsl/hid2file.js
    > xargs: 
LD_LIBRARY_PATH=/home/sbergman/gcc/trunk/inst/lib64:/home/sbergman/lo/core/instdir/program:/home/sbergman/lo/core/instdir/program:
 No such file or directory
    
    Change-Id: I94ea42878de55a887e6955b350997425438bb90e
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144154
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 970907045a2400da7ed6e3d14ef76f7ad3b2d783)
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144263
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index 46068e82b0..8db68cf8c1 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -48,7 +48,7 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \
                ( \
                        RESPONSEFILE=$(call gb_var2file,$(shell 
$(gb_MKTEMP)),$(foreach 
module,$(html_TEXT_MODULES),$(gb_AllLangHelp_$(module)_HELPFILES)))  && \
                        echo 'var hid2fileMap = {' \
-                       && cd $(SRCDIR) && xargs $(call 
gb_ExternalExecutable_get_command,xsltproc) $< <$$RESPONSEFILE || { rm 
$$RESPONSEFILE; exit 1 ; } \
+                       && cd $(SRCDIR) && $(call 
gb_ExternalExecutable_get_command,xsltproc,xargs) $< <$$RESPONSEFILE || { rm 
$$RESPONSEFILE; exit 1 ; } \
                        && rm "$$RESPONSEFILE" \
                        && echo '};' \
                ) > $@ \
commit 47d547be539ab2822babba4dc0fb230f971de450
Author:     Christian Lohmaier <[email protected]>
AuthorDate: Tue Dec 13 14:35:15 2022 +0100
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Mon Dec 19 11:28:51 2022 +0000

    hid2file.js generation: process in batch, not each file one-by-one
    
    xsltproc can happily process many files at once, no need to process them
    individually and also no need to surround them with the rm, touch, rm
    triplet each time to catch a possible error.
    When letting xargs actually run the command, then xargs will report
    error if any invocation failed. It will not stop execution commands for
    remaining input unless the command exists with status 255 explicitly,
    but this doesn't matter, processing the whole batch regardless is still
    much faster than processing each file separately.
    To maximize the number of files that can be processed in a single
    command, don't prefix each file with $(SRCDIR)/, but instead cd to
    $(SRCRDIR) before running the command.
    
    Change-Id: I532a54f7298d7011900af5e618d75b37649b0477
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144050
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>
    (cherry picked from commit f048f02f505704a76c4f01b4ff3f369e8ed928b5)
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144065

diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index 7c6ed744da..46068e82b0 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -38,9 +38,6 @@ $(eval $(call 
gb_CustomTarget_register_targets,helpcontent2/help3xsl,\
        ) \
 ))
 
-# In the below recipe, the file [email protected] is used to communicate failure of 
xsltproc in the pipeline
-# (similar to Bash's `set -o pipefail`; the final `rm [email protected]` will fail, and 
fail the whole
-# command, if the xsltproc invocation failed):
 $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \
                $(SRCDIR)/helpcontent2/help3xsl/generate_hid2file.xsl \
                $(call gb_ExternalExecutable_get_dependencies,xsltproc) \
@@ -49,15 +46,9 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1)
        $(call gb_Helper_abbreviate_dirs,\
                ( \
+                       RESPONSEFILE=$(call gb_var2file,$(shell 
$(gb_MKTEMP)),$(foreach 
module,$(html_TEXT_MODULES),$(gb_AllLangHelp_$(module)_HELPFILES)))  && \
                        echo 'var hid2fileMap = {' \
-                       && RESPONSEFILE=$(call gb_var2file,$(shell 
$(gb_MKTEMP)),$(foreach module,$(html_TEXT_MODULES),$(addprefix 
$(SRCDIR)/,$(gb_AllLangHelp_$(module)_HELPFILES)))) \
-                       && <"$$RESPONSEFILE" $(if $(filter WNT,$(OS)),tr -d 
'\r' | env -i PATH="$$PATH") xargs -n 1 printf '%s\n' \
-                       | while read xhp; do \
-                               rm -f [email protected] && \
-                               { $(call 
gb_ExternalExecutable_get_command,xsltproc) $< $$xhp && touch [email protected]; } \
-                               | $(gb_AWK) 'NF' \
-                               && rm [email protected] || exit \
-                       ; done \
+                       && cd $(SRCDIR) && xargs $(call 
gb_ExternalExecutable_get_command,xsltproc) $< <$$RESPONSEFILE || { rm 
$$RESPONSEFILE; exit 1 ; } \
                        && rm "$$RESPONSEFILE" \
                        && echo '};' \
                ) > $@ \

Reply via email to