Commit Graph
87 Commits
Author SHA1 Message Date
Xisco Fauli 241826dcb9 python3: upgrade to 3.13.11 (master only)
* external/python3/decimal.patch.1 partially reverts
commit 849e0716d378d6f9f724d1b3c386f6613d52a49d
Author: Zachary Ware <zach@python.org>
Date:   Mon Mar 18 12:07:25 2024 -0500

    gh-115119: Switch Windows build to mpdecimal external (GH-115182)

to build mpdecimal as internal on Windows

Downloaded from https://www.python.org/ftp/python/3.13.11/Python-3.13.11.tar.xz

Change-Id: Ia3385a3cc29f05ba898ec721c7e2a26c9d5f5ac2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195320
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-12-16 22:22:30 +01:00
Xisco Fauli 27d0c9a3db build sqlite3 and lzma on Windows anyway
and use the same config.h in all platforms.
Compiling these libraries only takes a few seconds
so no need to exclude Windows here
it should also fix the win arm64 build

This patch reverts

commit e4421ce01d
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Mon Nov 10 22:35:22 2025 +0100

    sqlite3: don't create a static library on Windows

and part of

commit 1cb84d60d9
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Thu Oct 30 20:11:23 2025 +0100

    external: add lzma

Change-Id: Ia66242d4fef78cf8d99f853db4c9eee2e24c62ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194023
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-11-14 15:20:30 +01:00
Xisco Fauli 6408a49ac5 tdf#168513: python3: bundle lzma
Change-Id: I7b9729cd293aea781b204888236c3aa5aa858eaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193739
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-11-11 21:40:00 +01:00
Xisco Fauli e4421ce01d sqlite3: don't create a static library on Windows
sqlite3 is later compiled on Windows by sqlite3.vcxproj

Change-Id: I77662cb5add82e812e2523a89a3d44b3ae05e095
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193772
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-11-11 10:40:34 +01:00
Xisco Fauli 71d738ed14 some janitorial work
after

commit f98ce0f91b
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Mon Oct 27 14:39:23 2025 +0100

    external: Add sqlite3

and

commit 1dfb0c9936
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Tue Sep 23 13:17:41 2025 +0200

    tdf#168512: python3: bundle sqlite3

Based on https://gerrit.libreoffice.org/c/core/+/193225/comments/b7f0a403_822adc42

Change-Id: I82f9dd6b9238df94b5c4619d003f67871885945c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193351
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-11-03 17:15:50 +01:00
Xisco Fauli 3d57e6a9b5 tdf#132074: python3: bundle dbm
Change-Id: I1ed3c6e834f486cc8753513dfb03a2a0d4a8cfd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193155
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-10-29 18:58:53 +01:00
Xisco Fauli 1dfb0c9936 tdf#168512: python3: bundle sqlite3
Add sqlite3.patch.1 since sqlite3.vcxproj expects the
sqlite version in the path

Change-Id: Ieb262b5401447cc9cc8c8d68197b3ec492c6ed94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191394
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-10-29 14:21:29 +01:00
Xisco Fauli dcd517331c related tdf#168511: bundle venv on mac too + Add test
I missed it in
commit dd8c42bf4b
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Tue Sep 23 10:07:26 2025 +0200

    tdf#168511: python3: bundle venv

Change-Id: I180df8df27ece92aaa1feca379d280ff3f1ba2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191392
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-23 14:18:34 +02:00
Christian Lohmaier 41ebd4c123 add --enable-gcov configure flag (instaed of manually setting flags)
there was already parts of that in the makefile that would require
running "make gb_GCOV=YES" - but that alone was not enough, you were
also kinda expected to set LDFLAGS on the commandline (or at least it
had bitrotted to this state) - so just make it into a proper configure
switch.
Building with lto fails at least on baseline with
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /tmp/ccaE1KD4.ltrans31.ltrans.o:(.data.rel.ro.local+0x3befe0)
: undefined reference to `.L1'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /tmp/ccaE1KD4.ltrans31.ltrans.o:(.data.rel.ro.local+0x3befe8)
: undefined reference to `.L1'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /tmp/ccaE1KD4.ltrans31.ltrans.o:(.data.rel.ro.local+0x3bf018)
: undefined reference to `.L2'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /tmp/ccaE1KD4.ltrans31.ltrans.o:(.data.rel.ro.local+0x3bf020)
: undefined reference to `.L2'
[…many more of those with incrementing references…]
So for now warn if both are used.

Change-Id: I2c3427b48174de77a6894293a5e784df8ee24bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186821
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-06-23 15:15:58 +02:00
Xisco Fauli 528cdd6573 python3: upgrade to 3.12.11 (master only)
* Py_DontWriteBytecodeFlag is deprecated now, replace it with
PyConfig.write_bytecode

* setuptools and pip are no longer available by default on mac.
Get them from the wheel files the same way linux and windows do

Downloaded from https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tar.xz

Change-Id: Id1043671d8fbb6b3bfa39afbf6aedd634c92c5f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181785
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-06-17 20:39:18 +02:00
Xisco Fauli 3575986e30 tdf#162786, tdf#159988: python3: do not strip soabi on linux/macOS
Otherwise libraries installed through pip do not work

Change-Id: Ib916964ce7d309faffaad1763884b1600b139c18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180781
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-27 15:46:25 +01:00
Christian Lohmaier 657efd649f macOS: simplify mac exclusion recipes
on branches 25-2 and 24-8 the python tkinter dylib is back.
The corresponding python module is ignored already, and the tkinter
cpython dylib already was removed in the past, but apparently at some
point that file wasn't generated anymore and the corresponding line to
delete it was removed in 6e62c9df96
That same commit also changed the filenames to use a * wildcard after
the python version, apparently to account for a "d" suffix in the
--enable-dbgutil case. In the spirit of the old commit to avoid rm -f
and to be explicit and catch potential other issues in future remove
that wildcard again/replace the suffix with a macro that contains the
appropriate suffix already as used in ExternalPackage_python3.mk.

Change-Id: I22b49af7dbf9a0bed5c124d9f137b8a38fee7471
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180705
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-01-27 13:37:45 +01:00
Xisco Fauli c9ae567c79 python3: get python.exe from extern
Instead of downloading nuget.exe and then python.exe
as explained in https://lists.freedesktop.org/archives/libreoffice/2025-January/092881.html,
Add python.3.12.8.nupkg to extern and download it as a tarball
to unzip it in external/pythonx86.
find_python.bat will look for python.exe in external/pythonx86/tools

Downloaded from
https://globalcdn.nuget.org/packages/python.3.12.8.nupkg?packageVersion=3.12.8

Change-Id: Ib1638fa66b3983048c2f9a472d00ce365602fcbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180078
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-01-10 23:18:29 +01:00
Xisco Fauli 50524481b3 Python: upgrade to 3.11.11 (master only)
Downloaded from https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tar.xz

* Add external/python3/replace-powershell-with-wget.patch.1
to avoid

FindPythonForBuild:
 Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure
 channel.
 At line:1 char:1
 + Invoke-WebRequest https://aka.ms/nugetclidl -OutFile
 'C:\cygwin64\home\tdf\jenki ...
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~
     + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt
    pWebRequest) [Invoke-WebRequest], WebException
     + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
    ll.Commands.InvokeWebRequestCommand

 'py' is not recognized as an internal or external command,
 operable program or batch file.

when downloading nuget.exe from https://aka.ms/nugetclidl
using powershell. By default powershell uses TLS 1.0 and the site security requires TLS 1.2,
so it fails with 'The request was aborted: Could not create SSL/TLS
secure channel.'

Kudos to Caolán for helping with a compiling issue.
See https://lists.freedesktop.org/archives/libreoffice/2024-December/092830.html

Change-Id: If66a88dd8f8c7774c49f8c33e9e40d2d5418e7c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178681
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-09 15:42:20 +01:00
Xisco Fauli 24bf1dbb32 python3: easy_install no longer exists on macosx
/bin/sh: line 1: easy_install-3.10: No such file or directory

Also seen in libreoffice-24-2 branch with python 3.8
/bin/sh: line 1: easy_install-3.8: No such file or directory

Change-Id: Ia4b26c4526c03bec2f06f19ec6ea8539332d43da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170176
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-09 10:46:30 +02:00
Christian Lohmaier 875a1bf2e1 makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo)
…by a simple/static $(gb_UnpackedTarball_workdir)/foo
see also 0c4c84a14b

Change-Id: I8e6aa55c85534c4446556548910c950ddbe7c6fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167163
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-05-06 11:40:45 +02:00
Julien Nabet 8797ba5e5d Typo: Unfortuantely->Unfortunately (python3/ExternalProject_python3.mk)
Change-Id: I80d316c76196d8cdda4b2ad509d2d1b53b5c414a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157991
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2023-10-15 20:48:34 +02:00
Taichi Haradaguchi c72d5d787f tdf#116412 include bz2 module in internal python
This commit includes the changes in 5e3510dbb6
and 219bef04b7, as well as the following changes:

* add bzip2 as permissable build target when cross compiling for Windows ARM64.
* add external/bzip2/disable-test.patch.0 for cross-compiling.
* revert the changes to configure.ac in 5e3510dbb6.
* change the argument of gb_UnpackedTarball_fix_end_of_line.

Change-Id: Iad8b1ed48d6c56e1302d9ac11620dc8084e79276
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157101
Tested-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-10-14 08:53:14 +02:00
Stephan Bergmann 233e0a009a A more principled suppression of -fsanitize=function in external C code
...after
<https://github.com/llvm/llvm-project/commit/279a4d0d67c874e80c171666822f2fabdd6fa926>
"-fsanitize=function: support C".

This includes reverts of 16af9e8186 "update clang
asan suppressions" and 151a43f3d0 ""update clang
asan suppressions".

Change-Id: I49740f5f3a784af1d62b830b47bfdfa27fe3e471
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156935
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-15 07:58:37 +02:00
Taichi Haradaguchi 5cd48b4969 Revert "tdf#116412: include bz2 in internal python"
This reverts commit 5e3510dbb6.

Reason for revert: occured build error at https://ci.libreoffice.org/view/tb%20platform%20status/job/lo_daily_tb_win_arm64/966/

Change-Id: I9f9087964f7a85c03bca6be4eff5717d6d274c89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155391
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-08-07 05:59:22 +02:00
Taichi Haradaguchi 5e3510dbb6 tdf#116412: include bz2 in internal python
Change-Id: Ie257446692227ae689fad2e61a42405a68e4f665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139580
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-07-30 09:20:29 +02:00
Stephan Bergmann 70bcf9e8be Remove support for AIX
As discussed in the mailing list thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2023-January/089808.html>
"Plan to remove dead C++ UNO bridge implementations (bridges/source/cpp_uno/*)",
the bridge implementation at bridges/source/cpp_uno/gcc3_aix_powerpc is
apparently dead and should thus be removed.  However, that was the only bridge
implementation for AIX, which implies that support for the AIX platform as a
whole is dead and should thus be removed.

Change-Id: I96de3f7f97d4fd770ff78256f0ea435383688be9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146057
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-27 07:28:16 +00:00
Christian Lohmaier a7a766aa41 macOS (janitor): remove workarounds for no longer supported SDKs
since we won't accept anything lower than 10.14 on master (and 10.13 on
libreoffice-7-4 branch), we don't need those quirks anymore.

Change-Id: Ibc71a2ce7a0dc60769d03d477991b48fc99d534d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143040
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2022-11-21 22:35:33 +01:00
Stephan Bergmann 5931638fda external/python3: Explicitly check that all extension modules got built
...to avoid issues like we now experienced on Jenkins box tb76, where e.g.
<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/108402/> failed with
just an unhelpful

> /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/external/python3/ExternalPackage_python3.mk:46: *** file /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/UnpackedTarball/python3/LO_lib/_elementtree.cpython-3.8d.so does not exist in the tarball.  Stop.
> make[1]: *** Waiting for unfinished jobs....
> Makefile:299: recipe for target 'build' failed
> make: *** [build] Error 2

after ExternalProject_python3 had been built successfully, outputting just

> [build PRJ] python3

even though its workdir/UnpackedTarball/python3/build.log states

> *** WARNING: renaming "_elementtree" since importing it failed: pyexpat version is incompatible

and

> Following modules built successfully but were removed because they could not be imported:
> _elementtree

(but which got hidden by gbuild)

Change-Id: I28904ef41cb823e308bb8e15cbe969872702cb55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130355
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-23 11:12:10 +01:00
Jan-Marek Glogowski 4537886ec1 externals: always provide platform configure flags
No idea why we just provided the platform flags when cross-
compiling. In the curious case, where the host platform is
detected as x86_64-pc-mingw32 per default and we actually
want to override it with x86_64-pc-cygwin, we don't do a
cross compile, but must override the host platform.

But there is additional special handling needed for the omitted
cross-platform build in the special case of --host=i686-pc-cygwin
and --build=x86_64-pc-cygwin, where we deliberatly ignore cross
building; Windows is already a slow build, so try to keep this
optimization (AMD64 can execute x86 binaries).

There is the theoretical case, where the externals config.guess
would have detected something else and that "magically" even
worked, while the LO detected triplet would fail, but this
should be fixed in the external in any way.

Change-Id: Ib7a9719e0e406fe90334b7611dc3f01b51692bfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129153
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-31 10:31:04 +01:00
Mike Kaganski 8e779c062a Centralize VS-to-toolset mapping in configure
This allows to define the mapping once, and avoid modification in
multiple places each time a new VS version support is added

Change-Id: I93de4c9d78c3f67a0a2e157007e9d13b6f557937
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-08 14:54:10 +02:00
Hossein c156a8c708 Add preliminary VS 2022 support
This patch changes the configure.ac, so that LibreOffice compiles
with the latest VS 2022 preview.

The option --with-visual-studio=2022 should be added to the
autogen.input, in order to use VS 2022 preview.

Change-Id: Ia1d9bbeabbbd44ffe82af3624151b69d36c0a45c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122133
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-16 19:50:56 +02:00
Ilmari Lauhakangas ac586d1cae Make some scripts more portable
Change-Id: Ia89059eea51ca396a7c74143625ac9a6706de198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120773
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-08-20 12:32:22 +02:00
Stephan Bergmann 30b6b43bcb external/python3: First removeunnecessarystuff, then fixinstallnames
otherwise, we could get issues like

> error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Users/stephan/Software/lo/core/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.8/lib/python3.8/lib-dynload/_curses_panel.cpython-3.8.so (No such file or directory)
> error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Users/stephan/Software/lo/core/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.8/lib/python3.8/lib-dynload/_curses.cpython-3.8.so (No such file or directory)
> error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Users/stephan/Software/lo/core/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.8/lib/python3.8/lib-dynload/_testinternalcapi.cpython-3.8.so (No such file or directory)
> error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Users/stephan/Software/lo/core/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.8/lib/python3.8/lib-dynload/_dbm.cpython-3.8.so (No such file or directory)

when the two jobs run in parallel

Change-Id: I6db18d7a6fa0ce177e88f8f714434acf9afe3ea5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115218
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-07 08:22:35 +02:00
Jan-Marek Glogowski 8a4173987e WASM: add initial support for Emscripten cross build
- configure with:
- --host=wasm64-local-emscripten
- had to make a few externals optional, so adding:
  - --disable-nss
  - --disable-cmis
  - --disable-curl

Change-Id: I48d1c73d2675ad2e2beaf2c341578199efbd24ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111130
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-05-05 21:14:54 +02:00
Jan-Marek Glogowski 013ddc4f53 Switch OPENSSL config var from negative to positive
- align with most of the rest of config_host
- rename DISABLE_OPENSSL to ENABLE_OPENSSL
- make this configurable

Change-Id: Ic3b41fcdda38db66134939f12265e0da24833d60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114564
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-05-05 21:14:30 +02:00
Tor Lillqvist 6e62c9df96 Python .so files names have changed on macOS at least for some reason
There is no longer any "m" in the name suffix. Adapt the names of the
ones we want to remove for macOS.

The idlelib and tkinter dylibs are no longer there at all.

Don't use the -f flag to the rm commands. Thus we will notice the next
time something we want to remove isn't actually there or has been
renamed. But sadly for some unknown reason we do need to use a *
wildcard in the .so names.

Fixes a problem caught by App Store review where the Python curses
module had not been removed as it should have been. (It uses
non-public APIs and can thus not be included.)

Change-Id: I51b9728cc9ca0a962908d3994e3a0ff8e4fa7f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114372
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-04-21 08:25:21 +02:00
Christian Lohmaier 4b9190fc29 mac: don't put script files into Contents/MacOS or framework-bin directory
Signing them as executable code would require external attributes, and
those in turn break packaging into hfs+ dmg when building on apfs with
Big Sur.
It is not a new thing - the old Code Signing in Depth technote
https://developer.apple.com/library/archive/technotes/tn2206/_index.html
already reads:
"Store Python, Perl, shell, and other script files and other non-Mach-O
executables in your app's Contents/Resources directory. While it's
possible to sign such executables and store them in Contents/MacOS, this
is not recommended.
[…]
Put another way, a properly-signed app that has all of its files in the
correct places will not contain any signatures stored as extended
attributes."
The patch does exactly that for LO and the shipped python framework and
adds symlinks for the moved files.
Same applies for the Language pack applescript and the tarball - those
are also moved into Contents/Resources

Change-Id: Iab21e77b73f941248ca89c6e80703fdf67a1057c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109537
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-01-18 15:56:36 +01:00
Tor Lillqvist 8b8c420dc5 Drop Python modules we don't want on macOS, too, like on other platforms
On macOS, for various reasons, we use a different approach than on
other platforms to construct the bundled Python.

Instead of explicitly listing what to include (out of what Python
contains and builds) (in ExternalPackage_python3.mk), after Python is
built, we remove stuff we don't want (in ExternalProject_python3.mk)
and then include everything left in the LibreOfficePython.framework
(in GeneratedPackage_python3.mk).

This fixes a problem in App Store review: For some reason the review
said that the setcchar() function from the ncurses library, used by
Python's curses module, is non-public. No idea why the (automated)
review picked on that function. As far as I see from the ncurses
header in the SDK, that function is no less public than the other
ncurses functions that the Python module uses.

But oh well, we don't actually ship the curses module anyway on other
platforms, so just drop it on macOS, too. And while at it, drop the
other unwanted ones, too. And any binary shared libraries for them.

Change-Id: Idecaf10a6fb1c59e8711095927f5699b8d2ec98e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107055
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107141
Tested-by: Tor Lillqvist <tml@collabora.com>
2020-12-03 11:05:52 +01:00
Thomas Viehmann 12142490cd Enable Python Py_DEBUG setting when built with --enable-dbgutil on Linux
This has been suggested on IRC for testing fixes/avoiding regressions
when working on the GIL locking in PyUNO.

Change-Id: Ifda21a867b3c0c7db636a9ec950050012e4742de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106791
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
2020-12-01 10:16:17 +01:00
Tor Lillqvist a6a2855818 Add comment on how to run Python's own unit tests
Change-Id: Id62a688d2ddf7493d419a00a9fd0dfc6a6f13f0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106173
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-11-19 21:14:42 +01:00
Jan-Marek Glogowski 63cf188ce0 WIN add and apply default msbuild platform+config
Adds three Windows gb_* variables:

- gb_MSBUILD_CONFIG_AND_PLATFORM can be passed as msbuild flags
- gb_MSBUILD_PLATFORM maps debug / release settings
- gb_MSBUILD_CONFIG maps the CPUTYPE to the default msbuild names

and converts the users in external projects.

Change-Id: Ie9b817721180d78d104db11c44241e4b3e46bba9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102701
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-09-15 08:42:54 +02:00
Jan-Marek Glogowski b4dfba9477 python3: update to 3.8.4
With all the prerequisites in place, LO can be updated to the
current Python release. Interestingly I found that Cygwin always
seems to use LC_COLLATE=C, probably because the default collation
rules are missing.

Then there are the changes introduced in "PEP 587 -- Python
Initialization Configuration", which appearingly have modified the
DLL search path behaviour on Windows, so the OpenSLL DLLs aren't
found anymore in the program directory. As a workaround, the
OpenSLL and libffi DLLs are now (also) installed into the Python
lib dir on Windows.

Change-Id: Ib82f7b77213da9c525f8c79a13d128d9eec9ca64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98437
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-07-17 10:15:06 +02:00
Jan-Marek Glogowski 883068462f libffi: build DLL on Windows
The build setup is rather horrible, with some minimal gcc MSVC
wrapper. But the DLL is a prerequisite for the Python 3.8 build,
which dropped the internal libffi.

It's also possible to build it statically, but then you have to
patch the Python 3 _ctypes msbuild properties.

This also defaults to explicit --build and --host settings, even
without a cross build, because the predicted name would otherwise
differ (*-unknown-* instead of *-pc-*).

Additionally a "make install" also fails...

Change-Id: Ifb7dac840e23efffb9a5e342560aef9e11e0db79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98436
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-07-17 10:14:36 +02:00
Jan-Marek Glogowski 0911b0a263 openssl: update to 1.1.1g
The OpenSSL 1.1.1 release is currently the only supported version
and it already has the Windows Arm64 support I was looking for.

This change also explicitly enables thread support, which Python
depends on since release 3.7, which removed the --without-threads
build option. But the explicit OPENSSL_THREADS was just added in
3.8.4, so the old no-threads build fails now and was wrong since
probably much longer.

Change-Id: I61d94f966bc59407f213f4a81f0a49d0c05f8948
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98435
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-07-17 10:14:17 +02:00
Stephan Bergmann 2919bc1586 Fix gb_ExternalProject_get_state_target,python3,removeunnecessarystuff
...which had been introduced with 0f2f719ccd
"tdf#106324: Remove unnecessary test folder from LibreOfficePython framework",
but had apparently forgotten to touch the target file when done, so any make
target that would (indirectly) depend on it would keep rebuilding python3 et al.

Change-Id: I0ac3611383c82c4e91a1eaa02e4cf5db28d326fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93117
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-29 10:54:08 +02:00
Stephan Bergmann 29d47d22c4 Fix passing --disable-optimized into external/python3
This had originally been covered by dccf47b7f6
"Build python3 with debug flags if --enable-debug", which got broken by
eeeec33ada "merge --enable-selective-debuginfo
into --enable-symbols" (which removed the definition of
gb_Module_CURRENTMODULE_DEBUG_ENABLED without adapting its use here).

But looking again, setting OPT for workdir/UnpackedTarball/python3/configure.ac
based on our various flags doesn't seem to be such a good idea anyway:  It is
used to specify a mixture of debuginfo (-g; which is set rather unconditionally,
so no need for us to cater for --enable-symbols here), optimization (-fwrapv,
-O*), and warning (-Wall) flags.  So better let
workdir/UnpackedTarball/python3/configure.ac keep deciding for itself what flags
to set in OPT, and then just override via CFLAGS those that do not suite us.
(Where it appears to be a happy coincidence that the Python build system puts
CFLAGS after OPT, so the former can override the latter.)

(An alternative approach could have been to pass --with-pydebug based on e.g.
--enable-dbgutil, as the former (a) causes OPT to include -O0 rather than -O3,
and (b) is documented to change the ABI (see
workdir/UnpackedTarball/python3/configure.ac: "Py_DEBUG implies assertions, but
also changes the ABI."), so probably best fits --enable-dbgutil.  However, at
least on Linux, --with-pydebug produces
workdir/UnpackedTarball/python3/libpython3.7dm.so rather than
workdir/UnpackedTarball/python3/libpython3.so, so would have required further
modifications.  Also, in a Linux UBsan build, making ExternalProject_python3
would have started to cause some "applying zero offset to null pointer"
failures, but which would have been easy to fix.)

(I noticed the missing -O0 when I attached gdb to an instdir/program/python.bin
process and `py-bt` only showed "(frame information optimized out)" frames,
which this change fixes for --disable-optimized builds.)

Change-Id: I9583e60692ae7130377422062f3c6df9334d693f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92362
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-16 16:04:05 +02:00
Stephan Bergmann 24973523ba Bump Windows build baseline to Visual Studio 2019 16.4
(where 16.4 is currently the latest version of Visual Studio 2019 available at
<https://visualstudio.microsoft.com/downloads/>), see
<https://lists.freedesktop.org/archives/libreoffice/2020-February/084575.html>
"ESC meeting minutes: 2020-02-27": "Update baseline to VS2019 on master before
7.0 [...] check what’s the current patch level, require that? [...] no
objections"

The code from 4ea0059bca "VS detection: Fallback
to old registry check if vswhere failed" has been removed in accordance with its
comment "The below hack does not work for VS 2019 anyway, so should be removed
when upgrading baseline.

(Changing the comment "go to Start menu, open 'Visual Studio 2017', [...]"
regarding the installation of GNU Make from source is somewhat arbitrary, but
lets stick to the tradition of bumping that version number along with any build
baseline bump.)

Change-Id: Ic4fe8a3d347aa1748377f2d3205e302bff189b79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89699
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2020-03-04 18:33:21 +01:00
Luboš Luňák 0adc9b615f GBUILD_TRACE, support for finding out where the build time is spent
See instructions in solenv/gbuild/Trace.mk . This generates a file than
can be viewed e.g. in the Chromium tracing view.

Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-16 14:49:45 +01:00
Michael Stahl 79084665f0 python3: bundle libffi for GNU/Linux builds
CPython commit f40d4ddff3c800b3c956a5e8820aabe3aa87cddd "Closes #27979:
Remove bundled copy of libffi" causes a bit of a problem because it
turns out that libffi isn't all that stable; there's libffi.so.5 on
CentOS 6, libffi.so.6 on CentOS 7 and libffi.so.7 on
lo_daily_update_gandalf tinderbox.

So we have to bundle it in LO; it's only used on GNU/Linux currently.

CPython commit 32119e10b792ad7ee4e5f951a2d89ddbaf111cc5 "bpo-35947:
Update Windows to the current version of libffi (GH-11797)" also removes
the libffi for MSVC, so in a future python upgrade we will have to build
libffi for MSVC too.

The libffi fork for MacOSX is still in CPython git master.

(regression from b10be5d484)

Change-Id: Ibc20cf8cd3614cf9941b6970662bd930496776b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86493
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-09 17:56:19 +01:00
Michael Stahl b10be5d484 python3: upgrade to release 3.7.6
* external/python3/python-3.3.3-aix.patch.1:
  most of it doesn't apply and AIX port isn't maintained anyway so
  remove it for now
* external/python3/ubsan.patch.0:
  apparently one of the files was removed
* 0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1:
  fixed upstream
* python3-osx-avoid-new-10.13.patch.1:
  replace with simply passing ac_cv_func_utimensat=no to configure
* external/python3/python-3.5.4-ssl.patch.1:
  project files to build OpenSSL removed upstream
* There have been changes to how python locates OpenSSL; new variables
  OPENSSL_INCLUDES etc; it turns out that you have to pass one directory
  to --with-openssl, as the variables cannot be passed
* libuuid.so.1 is a new dependency of the _uuid module
* libffi.so.6 is a new dependency of the _ctypes module (the bundled
  copy of libffi for non-Darwin platforms was removed)
* python-3.3.0-pythreadstate.patch.1:
  the PyThreadState functions have been changed such that
  CppunitTest_services asserts when there is a PyThreadAttach on top of
  PyThreadDetach on top of PyThreadAttach, i.e., 2 PyThreadState per
  thread (PyGILState_Check() fails).  Instead of patching in additional
  workarounds, change PyThreadAttach so that it re-uses an existing
  PyThreadState if one exists for the thread.

Change-Id: I24c19d79b43a30709261fd9db66312b2e3872fd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84765
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-08 10:22:17 +01:00
Michael Stahl b0930d5613 python3: upgrade to release 3.5.9
Fixes CVE-2019-9948 CVE-2019-9740 CVE-2019-10160 CVE-2019-16056
and expat CVE-2019-15903.

python-3.3.5-pyexpat-symbols.patch.1 fails to apply, and it's a
mystery why --with-system-expat is used everywhere but on MacOSX,
where 292af048ac disabled it for no
obvious reason, so try to remove the special case and get rid of the
patch.

Change-Id: I5ba4532eb6e7c2fb90daba95d132dcc7c9013d96
Reviewed-on: https://gerrit.libreoffice.org/83117
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-19 12:22:59 +01:00
Tomoyuki Kubota f61d647420 Initial VS 2019 Support
Change-Id: I8e08efb549ebd52c37183a1185d6de73f2b00601
Reviewed-on: https://gerrit.libreoffice.org/64630
Reviewed-by: himajin100000 <himajin100000@gmail.com>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Tested-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-16 13:01:03 +02:00
Stephan Bergmann c2216d2d7a Drop unnecessary gb_DEBUG_CFLAGS
...which was at maximum set to GCC's -finline-limit=0 -fno-inline
(solenv/gbuild/platform/com_GCC_defs.mk).  Those options were set for debug
builds "since forever", but that looks very much like cargo cult:  -fno-inline
"is the default when not optimizing" anyway
(<https://gcc.gnu.org/onlinedocs/gcc-7.4.0/gcc/Optimize-Options.html>), and it
is unclear to me how -finline-limit=0 should have any impact beyond -fno-inline
(and maybe was present for ancient compilers that only supported -finline-limit
but not -fno-inline?).

Change-Id: Id6752d03b1b7ec8763defabc5720d4dd08790874
Reviewed-on: https://gerrit.libreoffice.org/66836
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-24 11:25:03 +01:00
himajin100000 a0e326f5e1 Minimum Supported Version is VS2017
Change-Id: Id771f1fe0d8c6702a52836f6229a944d259fed4c
Reviewed-on: https://gerrit.libreoffice.org/66424
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-16 12:49:14 +01:00