config_host.mk.in                             |    1 +
 configure.ac                                  |    5 +++--
 external/harfbuzz/ExternalProject_harfbuzz.mk |    4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit dfbdb858e2e584f7a557a45e4ad315dc5a3bef57
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Apr 25 15:33:34 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Apr 25 20:38:53 2025 +0200

    Instead of warning and failing, just do the right thing
    
    After df83ad933b11e973855d66792c9aff38714f9201 "fix harfbuzz build with
    --enable-python=fully-internal on linux", my --enable-python=fully-internal
    Linux builds that auto-detect MESON=/usr/bin/meson started to emit a 
configure
    warning
    
    > * WARNING : using internal python with a meson launcher might not work, 
best to use MESON=/path/to/meson.py in autogen.input
    
    and then fail to build ExternalProject_harfbuzz with
    
    > Traceback (most recent call last):
    >   File 
"/home/sberg/lo/core/instdir/program/python-core-3.11.12/lib/importlib/metadata/__init__.py",
 line 563, in from_name
    >     return next(cls.discover(name=name))
    >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    > StopIteration
    >
    > During handling of the above exception, another exception occurred:
    >
    > Traceback (most recent call last):
    >   File "/usr/bin/meson", line 33, in <module>
    >     sys.exit(load_entry_point('meson==1.7.0', 'console_scripts', 
'meson')())
    >              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    >   File "/usr/bin/meson", line 22, in importlib_load_entry_point
    >     for entry_point in distribution(dist_name).entry_points
    >                        ^^^^^^^^^^^^^^^^^^^^^^^
    >   File 
"/home/sberg/lo/core/instdir/program/python-core-3.11.12/lib/importlib/metadata/__init__.py",
 line 982, in distribution
    >     return Distribution.from_name(distribution_name)
    >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    >   File 
"/home/sberg/lo/core/instdir/program/python-core-3.11.12/lib/importlib/metadata/__init__.py",
 line 565, in from_name
    >     raise PackageNotFoundError(name)
    > importlib.metadata.PackageNotFoundError: No package metadata was found 
for meson
    
    So better add back the idea from 736998ccef0bacdd2bbf038c98dacfbe654f1a4d 
"Only
    run meson from python when it apparently needs to be" (that had been removed
    with df83ad933b11e973855d66792c9aff38714f9201 "fix harfbuzz build with
    --enable-python=fully-internal on linux") to treat a Meson executable that
    doesn't advertise itself as being a Python script as just any plain 
executable,
    which we don't throw at our --enable-python=fully-internal interpreter.  
(Just
    like, say, an Emscripten build of LO uses an emcc compiler executable that
    internally uses Python, and onto which we don't force our
    --enable-python=fully-internal interpreter, either.)
    
    Change-Id: I13965ef08043f350e9614bd61a469708b7faf27b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184626
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/config_host.mk.in b/config_host.mk.in
index c947b47aefcd..c210d78708a7 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -504,6 +504,7 @@ export MDDS_LIBS=$(gb_SPACE)@MDDS_LIBS@
 export MERGELIBS=@MERGELIBS@
 export MERGELIBS_MORE=@MERGELIBS_MORE@
 MESON=@MESON@
+MESON_NO_PYTHON=@MESON_NO_PYTHON@
 export ML_EXE=@ML_EXE@
 export MOC5=@MOC5@
 export MOC6=@MOC6@
diff --git a/configure.ac b/configure.ac
index 57545beeb4fb..28364e612ee9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11463,6 +11463,7 @@ if test "$COM" = "MSC"; then # override the above
     
HARFBUZZ_LIBS='$(gb_UnpackedTarball_workdir)/harfbuzz/builddir/src/libharfbuzz.a
 $(GRAPHITE_LIBS)'
 fi
 
+MESON_NO_PYTHON=
 if test "$with_system_harfbuzz" = "yes"; then
     if test "$with_system_graphite" = "no"; then
         AC_MSG_ERROR([--with-system-graphite must be used when 
--with-system-harfbuzz is used])
@@ -11489,8 +11490,7 @@ else
     fi
     if test -z "$PYTHON_FOR_BUILD"; then
         if test "$(basename $MESON)" = "$(basename -s .py $MESON)"; then
-            AC_MSG_WARN([using internal python with a meson launcher might not 
work, best to use MESON=/path/to/meson.py in autogen.input])
-            add_warning "using internal python with a meson launcher might not 
work, best to use MESON=/path/to/meson.py in autogen.input"
+            MESON_NO_PYTHON=TRUE
         fi
     else
         AC_MSG_CHECKING([whether meson can be run with "$PYTHON_FOR_BUILD 
$MESON"])
@@ -11502,6 +11502,7 @@ else
         fi
     fi
 fi
+AC_SUBST(MESON_NO_PYTHON)
 if test -z "$NINJA" || test "$NINJA" = 'assumed to be available from Visual 
Studio'; then
     x_NINJA=[\#]
 else
diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk 
b/external/harfbuzz/ExternalProject_harfbuzz.mk
index ee02b95753ec..ab09f2a96ad6 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -47,7 +47,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) : 
| $(call gb_Externa
        $(call gb_ExternalProject_run,build,\
                
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}$(LIBO_PATH_SEPARATOR)$(gb_UnpackedTarball_workdir)/graphite$(if
 $(SYSTEM_ICU),,$(LIBO_PATH_SEPARATOR)$(gb_UnpackedTarball_workdir)/icu)" \
                PYTHONWARNINGS= \
-               $(call gb_ExternalExecutable_get_command,python) $(MESON) setup 
builddir \
+               $(if $(MESON_NO_PYTHON),,$(call 
gb_ExternalExecutable_get_command,python)) $(MESON) setup builddir \
                        -Ddefault_library=static -Dbuildtype=$(if 
$(ENABLE_DEBUG),debug,release) \
                        -Dauto_features=disabled \
                        -Dcpp_std=$(subst -std:,,$(subst -std=,,$(filter 
-std%,$(CXXFLAGS_CXX11)))) \
@@ -57,7 +57,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) : 
| $(call gb_Externa
                        -Dicu_builtin=true \
                        -Dgraphite2=enabled \
                        $(if $(filter-out 
$(BUILD_PLATFORM),$(HOST_PLATFORM))$(WSL),--cross-file cross-file.txt) && \
-               $(call gb_ExternalExecutable_get_command,python) $(MESON) 
compile -C builddir lib \
+               $(if $(MESON_NO_PYTHON),,$(call 
gb_ExternalExecutable_get_command,python)) $(MESON) compile -C builddir lib \
                        $(if $(verbose),--verbose) \
        )
        $(call gb_Trace_EndRange,harfbuzz,EXTERNAL)

Reply via email to