You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When cross-compiling on Windows for a Linux system, we need to pass a POSIX path like /usr to the built-in prefix option.
The behaviour has changed due to a bugfix in Python 3.13. Now, if you supply the prefix via the default_options argument to project(), that causes the following error output:
$ meson setup --cross-file crossfile.ini builddir
The Meson build system
Version: 1.7.0
Source dir: C:\Users\dbuenger\test\20250227_meson-prefix-bug
Build dir: C:\Users\dbuenger\test\20250227_meson-prefix-bug\builddir
Build type: cross build
meson.build:1:0: ERROR: prefix value '/usr' must be an absolute path
I did a little digging and found out that Meson calls os.path.isabs() do determine whether the default prefix value is valid. The behavior of that function has changed in Python 3.13. Previously, it returned True for paths starting with a single slash. However, this was considered a bug that was fixed in the most recent version. Here's the issue on the cpython repo: python/cpython#113829
(If you pass /usr instead of C:/usr, Meson will set the prefix to C:/Program Files/Git/usr. I don't know if this expansion is done by meson or by the Git Bash shell I'm using -- I'm assuming the latter.)
To Reproduce
Runmeson setup --cross-file crossfile.ini builddir with the following meson.build:
Expected behavior
When cross-compiling, Meson accepts an absolute POSIX path like /usr as the default value to the prefix option, even on Windows, without relying on the system-dependent os.path.isabs().
system parameters
Cross Build
Windows 11
Python 3.13.2
Meson 1.7.0
Ninja 1.11.1.git.kitware.jobserver-1
The text was updated successfully, but these errors were encountered:
Describe the bug
When cross-compiling on Windows for a Linux system, we need to pass a POSIX path like
/usr
to the built-inprefix
option.The behaviour has changed due to a bugfix in Python 3.13. Now, if you supply the
prefix
via thedefault_options
argument toproject()
, that causes the following error output:I did a little digging and found out that Meson calls
os.path.isabs()
do determine whether the default prefix value is valid. The behavior of that function has changed in Python 3.13. Previously, it returned True for paths starting with a single slash. However, this was considered a bug that was fixed in the most recent version. Here's the issue on the cpython repo: python/cpython#113829A workaround is to pass the
prefix
via the CLI:(If you pass
/usr
instead ofC:/usr
, Meson will set the prefix toC:/Program Files/Git/usr
. I don't know if this expansion is done by meson or by the Git Bash shell I'm using -- I'm assuming the latter.)To Reproduce
Run
meson setup --cross-file crossfile.ini builddir
with the followingmeson.build
:The
main.c
can basically be empty. Here's mycrossfile.ini
:Expected behavior
When cross-compiling, Meson accepts an absolute POSIX path like
/usr
as the default value to theprefix
option, even on Windows, without relying on the system-dependentos.path.isabs()
.system parameters
The text was updated successfully, but these errors were encountered: