Skip to content

Conversation

@lazka
Copy link
Contributor

@lazka lazka commented Dec 13, 2025

g-ir-scanner internally uses setuptools/distutils, which with the mingw target sometimes uses distutils.util.split_quoted() and shlex.split() to split env vars, which uses Posix splitting rules.

In other cases it just passes strings to the subprocess module which uses the Windows splitting rules.

This started being a problem with meson 1.10, since with 1.9 it passed 'CC=ccache cc' while with 1.10 it now passes
'CC=C:\msys64\clang64\bin/ccache.EXE cc' which results in is_cygwincc() in distutils failing to find ccache.

Since it's hard to fix this in distutils/setuptools (there is no Windows split function in the stdlib, and setuptools is barely maintained right now) just try to avoid backslashes, which unbreaks the common case of an absolute path being passed like "C:/msys64/clang64/bin/ccache.EXE".

Downstream report:

g-ir-scanner internally uses setuptools/distutils, which with
the mingw target sometimes uses distutils.util.split_quoted()
and shlex.split() to split env vars, which uses Posix splitting rules.

In other cases it just passes strings to the subprocess module which
uses the Windows splitting rules.

This started being a problem with meson 1.10, since with 1.9 it passed
'CC=ccache cc' while with 1.10 it now passes
'CC=C:\msys64\clang64\bin/ccache.EXE cc' which results in is_cygwincc()
in distutils failing to find ccache.

Since it's hard to fix this in distutils/setuptools (there is no Windows split
function in the stdlib, and setuptools is barely maintained right now)
just try to avoid backslashes, which unbreaks the common case of an absolute
path being passed like "C:/msys64/clang64/bin/ccache.EXE".

Downstream report:
* msys2/MINGW-packages#26812
* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9208#note_2627068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant