How to use the xPack Meson Build
This page is intended for those who plan to use the xPack Meson Build binaries in their workflows.
meson-python3
In the xPack distribution, for convenience, the meson
executable is
a standard ELF/EXE that includes the Python run-time, rather then a script
invoked via Python. Therefore, it does not expect a Python interpreter in the
environment.
However, if the meson scripts require Python code with dependencies on
other Python modules, meson-python3 -m pip install
can be used to install them
in the user home folder (~/.local/lib/python3.NN/site-packages
).
openssl certificates
The embedded Python includes support for SSL via openssl.
On macOS and GNU/Linux, the certificates are expected to be located
in /etc/ssl
.
On Windows, meson utilises the library provided by Python in the
Windows embedded package, and the certificates should be
installed in the same manner as for the regular Python,
but using meson-python3
.
Versioning
The version string used by the
upstream Meson Build project
is a three number string
like 1.5.2
;
to this string the xPack distribution adds a fourth number,
but since SemVer allows only three numbers,
all additional ones can
be added only as pre-release strings, separated by a dash,
like 1.5.2-1
. When
published as a npm package, the version gets
a fifth number,
like 1.5.2-1.1
.
Since adherence of third party packages to SemVer is not guaranteed,
it is recommended to avoid referring to the xPack Meson Build dependency via
a SemVer expressions
like ^1.5.2-1
or ~1.5.2-1
, and
prefer exact matches,
like 1.5.2-1.1
.
Shared libraries
On all platforms the binary xpm packages are standalone, and expect only the standard runtime to be present on the host.
All dependencies that are built as shared libraries are copied locally
in the libexec
folder (or in the same folder as the executable for Windows).
DT_RPATH
and LD_LIBRARY_PATH
On GNU/Linux the binaries are adjusted to use a relative path:
$ readelf -d library.so | grep rpath
0x000000000000001d (RPATH) Library rpath: [$ORIGIN]
In the GNU ld.so
search strategy, the DT_RPATH
has
the highest priority, higher than LD_LIBRARY_PATH
, so if this latter one
is set in the environment, it should not interfere with the xPack binaries.
Please note that previous versions, up to mid-2020, used DT_RUNPATH
, which
has a priority lower than LD_LIBRARY_PATH
; setting LD_LIBRARY_PATH
in the environment overrode DT_RUNPATH
, resulting in failures to load
the libraries.
@rpath
and @loader_path
Similarly, on macOS, the binaries are adjusted with install_name_tool
(part of CLT) to use a relative path.
Using meson-build in testing
TODO