gnome: avoid backslashes on Windows when setting CC for g-ir-scanner #15387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: