A Microsoft Store Python install's sys.executable points to an
AppExecutionAlias path: os.path.is_file() reports it as a regular file,
but opening it for data (Path.read_bytes(), Path.resolve(strict=True))
fails with OSError, and GCC's own process spawn for -wrapper fails the
same way with "CreateProcess: No such file or directory".
test_vulkan_validation_gate.py and test_job_reference_errors.py used
sys.executable only as a stand-in path that needed to exist, not run;
both now write a small placeholder file instead.
test_check_compile.py spawns sys.executable directly as a GCC -wrapper
program, so it now prefers the py launcher (a plain, non-virtualized
binary) when available, falling back to sys.executable otherwise.
AI-assisted: yes
After --, the next argument is the command even when it contains =;
taking -- as one more option would read compiler=tools/g++ as an
assignment and refuse -c. Suggested by veosett in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A compiler whose arguments happen to begin with -E env keeps the
ordinary rewrite; without the stem check it was taken for the launcher
and refused -c. Suggested by rooklz in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CMake writes a launcher that sets environment variables as a leading
`cmake -E env NAME=VALUE ... <launcher> <compiler>`, as the AGC
execution tests' ccache launcher does. check_compile took cmake for the
compiler, inserted -fsyntax-only before -E and dropped -E as a
preprocessing option, so every such source failed with
"CMake Error: Unknown argument". Keep the env prefix (NAME=VALUE,
--unset=, --modify and --) and rewrite only the command after it;
reject its other options and a prefix without a command.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each two-variant check_compile_modes case now runs one variant, and the
invalid compilation database entry case runs in four groups through a
shared helper. The same control compiles and check_compile runs are made.
test_library_directory_values_can_look_like_modes passed -L -E as mode
flags, so check_modes took the -E for a preprocessing mode and dropped -c.
Its control commands linked an executable with each compiler, which on
the Windows runner goes through link.exe; the case took about twice as
long as its -I -E counterpart and timed out in 6 Windows CI jobs. The
-L -E pair now goes through configure like the include directory case,
so the control only compiles. The command check_compile checks is the
same, since it drops -c.
test_response_options_compile_without_changing_build_outputs ran 30
check_compile invocations in one case. Its six response files are now
checked by three cases of two.