What's New in v0.13.10
Fixed
- Optimized Windows builds could hand out an import slot as a Python object. PyOZ took the address of Python's data (
&c._Py_NoneStruct, thePyExc_*variables, type objects) as if it were known at link time. On Windows that data lives in the Python DLL and its address is only known at run time, from the import table; the optimizer placed such addresses in constant tables (the 61-entry exception table behind error mappings), and the linker filled them with the import slots' addresses. Raising a mapped exception from a release build could then crash. Every access now goes throughpyoz.py.types.pyData, an@externwithis_dll_importon Windows, so the address is always loaded from the import slot, as__declspec(dllimport)does in C. This coversPy_None/Py_True/Py_False/Py_NotImplemented, allPyExc_*accessors and the type objects. pyoz.bases.Exception,ValueError,TypeErrorandRuntimeErrordid not compile and would have returnedtypeinstead of the exception class.
Added
pyoz buildchecks Windows modules for constants holding an import slot's address and refuses to package one, naming the first symbol. This also catches user code that takes the address of Python data directly (&pyoz.py.c._Py_NoneStruct). CI cross-builds the example module for Windows with this check, and runs it optimized on Windows.
Installation
Download the binary for your platform and add it to your PATH:
| Platform | Binary |
|---|---|
| Linux x86_64 | pyoz-x86_64-linux
|
| Linux ARM64 | pyoz-aarch64-linux
|
| macOS x86_64 | pyoz-x86_64-macos
|
| macOS ARM64 (Apple Silicon) | pyoz-aarch64-macos
|
| Windows x86_64 | pyoz-x86_64-windows.exe
|
| Windows ARM64 | pyoz-aarch64-windows.exe
|
Source
Download PyOZ-0.13.10.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl