Skip to content

Conversation

dudaka
Copy link
Contributor

@dudaka dudaka commented Oct 3, 2025

Add quotes around PATH variable expansion in grass_env_command for Unix systems to properly handle Windows paths with spaces when running GRASS in WSL. This prevents path parsing issues that can occur when WSL mounts Windows directories containing spaces (e.g., 'Program Files') in the PATH.

@HuidaeCho

dudaka added 3 commits October 3, 2025 09:25
Add quotes around PATH variable expansion to properly handle paths with spaces
in the grass_env_command for non-Windows systems. This ensures consistent
path handling across different Unix-like environments.
…ries

Add quotes around PATH variable expansion in grass_env_command for Unix systems to properly handle Windows paths with spaces when running GRASS in WSL. This prevents path parsing issues that can occur when WSL mounts Windows directories containing spaces (e.g., 'Program Files') in the PATH.
@github-actions github-actions bot added the CMake label Oct 3, 2025
@echoix
Copy link
Member

echoix commented Oct 3, 2025

Is CMake 3.25 finally available to us? If so, we could use the env modification feature, https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-E-arg-env, https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html#prop_test:ENVIRONMENT_MODIFICATION

and use the portable path_list_append/path_list_prepend.

Also, maybe using some path handling CMake utilities like https://cmake.org/cmake/help/latest/command/cmake_path.html#cmake-path-to-native-path-list. I thought I had already read something that mentioned the space handling, but I couldn’t refind it yet

@HuidaeCho
Copy link
Member

path_list_append/path_list_prepend is in 3.22: https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html, but I'm not sure how we can use this feature for compilation and how it handles spaces.

@HuidaeCho
Copy link
Member

HuidaeCho commented Oct 17, 2025

Found this:
https://gitlab.kruess.com/kruess-public/clone_catch2/-/blob/v3.5.2/extras/CatchAddTests.cmake?ref_type=tags#L120

list(APPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants