Configure build fails in paths with spaces: extra escapes with python path to native
Summary
Attempting to run cmake as part of the build process incorrectly escapes PYTHONPATH and never finds asn2wrs
Steps to reproduce
take /home/jenkins/workspace/Wireshark Linux Build/ # or any path with spaces in it
git clone https://gitlab.com/wireshark/wireshark.git
mkdir build
cd build
cmake ../wireshark/
What is the current bug behavior?
CMake Error at cmake/modules/LocatePythonModule.cmake:47 (message):
Could NOT find python module asn2wrs
Call Stack (most recent call first):
cmake/modules/UseAsn2Wrs.cmake:11 (locate_python_module)
epan/dissectors/asn1/HI2Operations/CMakeLists.txt:34 (ASN2WRS)
-- Configuring incomplete, errors occurred!
Editing the file to scrape the environment, I see:
PWD=/home/jenkins/workspace/Wireshark Linux Build/build/
PYTHONPATH=/home/jenkins/workspace/Wireshark\ Linux\ Build/wireshark/tools
(note the escape slashes, they are incorrect)
What is the expected correct behavior?
Python configures, with PYTHONPATH=/home/jenkins/workspace/Wireshark Linux Build/wireshark/tools
(no escape slashes)
Notes
This is caused by the TO_NATIVE_PATH call here: https://github.com/wireshark/wireshark/blob/master/cmake/modules/LocatePythonModule.cmake#L25