| 27dee00e | 30-Jun-2026 |
Jim Jagielski <jimjag@gmail.com> |
Python 3 migration: baseline 3.11.15, complete pyuno bridge and build files
Migrate the bundled Python from 2.7.18 to 3.11.15 (Unix/macOS first; Windows build deferred to a future modern-MSVC effort
Python 3 migration: baseline 3.11.15, complete pyuno bridge and build files
Migrate the bundled Python from 2.7.18 to 3.11.15 (Unix/macOS first; Windows build deferred to a future modern-MSVC effort). This completes the source- and build-level migration; only the full-tree build gate (link pyuno against bundled libpython3.11, run a macro / bridgetest round-trip) remains.
Version baseline: - pyversion.mk, pyversion_dmake.mk: PYMAJOR/PYMINOR/PYMICRO -> 3/11/15.
pyuno C++ bridge (collapse the 2012 dual-version scaffolding to Py3-only): - pyuno_util.cxx: ustring2PyUnicode/pyString2ustring use a single UTF-8 round-trip (PyUnicode_DecodeUTF8 / PyUnicode_AsUTF8AndSize); drop the removed-in-3.12 Py_UNICODE_SIZE / PyUnicode_FromUnicode / AS_UNICODE paths. Remove now-dead ustring2PyString. - pyuno_type.cxx: PyUnicode_FromKindAndData for char; PyUnicode_GetLength / PyUnicode_ReadChar instead of the 3.12-removed GetSize / AsUnicode. - pyuno.cxx, pyuno_module.cxx, pyuno_runtime.cxx, pyuno_callable.cxx, pyuno_except.cxx, pyuno_impl.hxx, pyuno_dlopenwrapper.c: remove all PY_MAJOR_VERSION < 3 branches, PyInt_*, Py_InitModule, initpyuno, and the PyEval_InitThreads() no-ops; PyInit_pyuno is the sole module entry point. PyUnicode_AsUTF8 results are held as const char* (3.11 signature). PyTypeObject initializers normalised to the unconditional Py3 layout.
configure.ac: - AM_PATH_PYTHON([2.7]) -> ([3.11]); macOS hexversion floor 2.7.1 -> 3.11.0 (51118080); Py2 'print sys.version' -> print(); distutils.sysconfig -> sysconfig (distutils removed in 3.12).
Bundled-Python build: - makefile.mk: TARFILE_MD5 for Python-3.11.15; drop obsolete freebsd/ssl/ solaris patches; feed the solver's bundled OpenSSL to setup.py via python_CFLAGS/python_LDFLAGS; guard (retain) the deferred Windows msvs9 blocks. - Regenerated python-3.11.15-{sysbase,nohardlink}.patch and refreshed python-md5.patch / python-solver-before-std.patch against 3.11.15. Removed the orphaned 2.7.18 msvs9/sysbase/nohardlink and dead solaris patches. - prj/d.lst: Py3.11 stdlib layout (drop Py2-only lib-old/compiler/hotshot/ plat-linux2/bsddb/lib-tk/config; python3.11 paths; libpython3.11.*).
pythonscript.py: - Detect common Python 2 syntax in stored macros at compile() time and raise a clear "port to Python 3" message instead of a bare SyntaxError traceback.
Verified on macOS arm64: bundled CPython 3.11.15 with these patches configures, builds, and installs; _ssl/_hashlib/hashlib import and work; the changed pyuno C-API patterns compile clean against real 3.11 headers (-Wall -Wextra -Werror); all shipped .py files compile under 3.11.15.
show more ...
|
| 5e139d9f | 05-Jun-2026 |
Jim Jagielski <jimjag@gmail.com> |
Native Apple Silicon (arm64) support and bundled Python 3.10 baseline
Squashed combination of two efforts, applied onto trunk as a single commit. (trunk is not intended to be buildable; this lands t
Native Apple Silicon (arm64) support and bundled Python 3.10 baseline
Squashed combination of two efforts, applied onto trunk as a single commit. (trunk is not intended to be buildable; this lands the work for reference/integration.)
=== Apple Silicon (macOS arm64 / AAPCS64) === Build plumbing: set_soenv.in + source_soenv.sh arm64 Darwin branch (CPU=R, CPUNAME=AARCH64, OUTPATH=unxmaccr); new solenv/inc/unxmaccr.mk and unx.mk dispatch; macro.hxx AARCH64 arch string; osarch.pm + gbuild/platform/macosx.mk arch entries; configure.ac arm64 host detection, Big Sur+ version math, and 11.0 deployment target.
C++/UNO bridge (new s5abi_macosx_aarch64): abi.cxx/hxx AAPCS64 classifier (HFA + <=16B/>16B size rules), uno2cpp + call.s AArch64 trampoline, cpp2uno incoming path + privateSnippetExecutor + AArch64 codeSnippet codegen (x8 indirect-result handled, not displacing this/x0), share.hxx __cxa_exception reserved-member alignment fix; Library_cpp_uno.mk + makefile.mk wiring. sal/osl/unx/interlck.c arm64 atomics (__sync_* -> LSE).
Externals: openssl darwin64-arm64-cc; icu arm64 little-endian. (NSS 3.39 deferred -- too old for arm64.)
Packaging/JVM: Info.plist LSMinimumSystemVersion 11.0; installer download.pm/worker.pm/update_module_ignore_lists.pl recognize unxmaccr; jvmfwk modern macOS JDK discovery (/Library/Java/JavaVirtualMachines + Contents/Home probe).
The ABI/atomics/trampoline/JDK-discovery code was unit-tested natively on an arm64 macOS host; a full AOO build (and bridgetest) was not run. Code-signing infra (mandatory for arm64 distribution) is NOT included.
=== Bundled Python 2.7.18 -> 3.10 baseline (Unix/macOS first) === pyversion.mk/_dmake.mk -> 3.10.18 (single version knob). Shipped .py fixes: imp -> types.ModuleType (pythonscript.py, pythonloader.py) and file() -> open(); mailmerge.py Py3 email module imports + encoders. Windows Python 3 build and the makefile.mk/d.lst/configure.ac Py3 work are NOT included (separate, larger effort).
NOTE: macOS 11 becomes the minimum supported version. Python 3.10 is EOL 2026-10; the version knob allows a later bump.
show more ...
|
| 8e23be74 | 30-Apr-2026 |
Damjan Jovanovic <damjan@apache.org> |
Use pop() instead of del to delete keys from the self.modules dictionary for Python scripts, so KeyError isn't thrown when the key is missing.
Remove the saving to temporary files, it's not used for
Use pop() instead of del to delete keys from the self.modules dictionary for Python scripts, so KeyError isn't thrown when the key is missing.
Remove the saving to temporary files, it's not used for any other scripting language, and can cause bugs when the temporary files already exist from previous errors.
Patch by: me
show more ...
|
| 1a9bb40f | 29-Apr-2026 |
Damjan Jovanovic <damjan@apache.org> |
Forget Python modules from the cache after they are saved, so they get reloaded in the future. This is necessary as getModuleByUrl()'s self.sfa.getDateTimeModified() returns timestamps with all zeroe
Forget Python modules from the cache after they are saved, so they get reloaded in the future. This is necessary as getModuleByUrl()'s self.sfa.getDateTimeModified() returns timestamps with all zeroes for documents (== ZIP files), breaking the test for whether the embedded Python file has been changed. Also even if it worked, the minimum granularity for timestamps in ZIP files is 2 seconds, which isn't good enough.
Patch by: me
show more ...
|
| 2fa24674 | 25-Apr-2026 |
Damjan Jovanovic <damjan@apache.org> |
On Python, XInvocation.invoke() must return a tuple of 3 values, the return value, the aOutParamIndex and the aOutParam.
Deal with the ".py" file extension wrongly being added to macros, or wrongly
On Python, XInvocation.invoke() must return a tuple of 3 values, the return value, the aOutParamIndex and the aOutParam.
Deal with the ".py" file extension wrongly being added to macros, or wrongly being removed.
Return the changed "self" XBrowseNode when renaming.
The Deletable and Renamable events should not be allowed for the root "Python" node.
Libraries and macros can now be successfully created, renamed and deleted.
Patch by: me
show more ...
|