build: CC="cache gcc" breaks gobject-introspection for native win build.

After some recent patch added to Python on MSYS2, in the same time as
they bumped from Python 3.9.6 to 3.9.7, our native Windows build started
breaking.

This patch modified `cygwinccompiler.py` to use CC environment variable
as being necessarily a single executable whereas if it were made of 2
commands (such as "ccache gcc"), the call was failing because the code
now tries to find a single command with this name (as though the space
belongs to the file name).

Therefore the line:
>   File "C:/msys64/mingw64/lib/python3.9/distutils/cygwinccompiler.py", line 451, in is_cygwincc
>     out_string = check_output([cc, '-dumpmachine'])

Resulted in the error:
> FileNotFoundError: [WinError 2] The system cannot find the file specified

For now, let's just not set ccache this way, even though this method is
normally meant to work and is one of the 2 officially proposed methods
(the other being to use symlinks named as compilers in priority in
PATH).
Also I'm not even sure ccache is useful at all right now (is cache
finally stored/reused between CI runs? I remember we tried to make it
happen, but I can't remember if we really had this properly in the end).

See: https://github.com/msys2/MINGW-packages/issues/9677
This commit is contained in:
Jehan 2021-09-30 18:21:28 +02:00
parent b61dd873d5
commit 2da70b3fb7
1 changed files with 5 additions and 1 deletions

View File

@ -81,7 +81,11 @@ export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/"
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
export CC="ccache gcc"
# XXX Do not enable ccache this way because it breaks
# gobject-introspection rules. Let's see later for ccache.
# See: https://github.com/msys2/MINGW-packages/issues/9677
#export CC="ccache gcc"
ccache --zero-stats
ccache --show-stats