Details
Description
I'm performing a clean build from the 5.9.1 sources on Windows 10 using VS 2017 Cummunity x64. I have Strawberry Perl 5.26 and Python 2.7 installed and in the PATH.
VS 2017 is installed into C:\vs2017.
When the build gets to qtwebengine, it fails because the value of the visual_studio_path argument passed to gn.exe is not quoted.
The argument looks like:
visual_studio_path=C:\vs2017\
but it should have been:
visual_studio_path=\"C:\vs2017\"
since gn.exe expects all the string arguments inside --args="..." to be quoted.
The problem is that qtwebengine\src\core\config\windows.pri tried to quote the argument using shell_quote().
gn_args += visual_studio_path=$$shell_quote($$VS_PATH)
Unfortunately, based on how shell_quote is implemented, it will only enclose the argument in quotes if it contains special characters like a space. Since my VS path does not have spaces, then arg does not get surrounded by quotes and gn.exe is unable to deal with the unquoted VS path.
Build output:
C:\vs2017\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\nmake.exe -f Makefile.core_generator.Debug Microsoft (R) Program Maintenance Utility Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. ( if not exist Makefile.gn_run C:\qt-src\qtbase\bin\qmake.exe -o Makefile.gn_run C:\qt-src\qtwebengine\src\core\gn_run.pro ) && C:\vs2017\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\nmake.exe -f Makefile.gn_run Project MESSAGE: Running: C:\qt-src\qtwebengine\src\3rdparty\chromium\tools\gn\out\Release\gn.exe gen C:\qt-src\qtwebengine\src\core\Debug_x64 --script-executable=python --args="use_qt=true is_component_build=false is_shared=true enable_media_router=false enable_nacl=false enable_remoting=false enable_web_speech=false use_experimental_allocator_shim=false use_allocator=\"none\" v8_use_external_startup_data=false treat_warnings_as_errors=false enable_basic_printing=true enable_print_preview=true enable_pdf=true enable_plugins=true enable_widevine=true enable_spellcheck=true enable_webrtc=true remove_webcore_debug_symbols=true remove_v8base_debug_symbols=true is_clang=false use_sysroot=false use_kerberos=true enable_notifications=false enable_session_service=false ninja_use_custom_environment_files=false is_multi_dll_chrome=false win_linker_timing=true use_incremental_linking=false visual_studio_version=2017 visual_studio_path=C:\vs2017\ windows_sdk_path=\"C:\Program Files ^(x86^)\Windows Kits\10\\\\\" target_cpu=\"x64\" qtwebengine_target=\"C:\qt-src\qtwebengine\src\core\Debug_x64:QtWebEngineCore\"" --root=C:\qt-src\qtwebengine\src\3rdparty\chromium ERROR at the command-line "--args":1:762: Invalid token. use_qt=true is_component_build=false is_shared=true enable_media_router=false enable_nacl=false enable_remoting=false enable_web_speech=false use_experimental_allocator_shim=false use_allocator="none" v8_use_external_startup_data=false treat_warnings_as_errors=false enable_basic_printing=true enable_print_preview=true enable_pdf=true enable_plugins=true enable_widevine=true enable_spellcheck=true enable_webrtc=true remove_webcore_debug_symbols=true remove_v8base_debug_symbols=true is_clang=false use_sysroot=false use_kerberos=true enable_notifications=false enable_session_service=false ninja_use_custom_environment_files=false is_multi_dll_chrome=false win_linker_timing=true use_incremental_linking=false visual_studio_version=2017 visual_studio_path=C:\vs2017\ windows_sdk_path="C:\Program Files (x86)\Windows Kits\10\" target_cpu="x64" qtwebengine_target="C:\qt-src\qtwebengine\src\core\Debug_x64:QtWebEngineCore"