Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/vcpkg-cmake/cmake_get_vars/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ foreach(incdir IN LISTS CMAKE_C_STANDARD_INCLUDE_DIRECTORIES)
endforeach()

foreach(flag CXX C SHARED_LINKER EXE_LINKER STATIC_LINKER RC)
if(MSVC)
if(MSVC AND "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
# Transform MSVC /flags to -flags due to bash scripts intepreting /flag as a path.
# This is imperfect because it fails on directories with trailing spaces, but those are exceedingly rare
string(REGEX REPLACE "(^| )/" "\\1-" ${flag}_FLAGS "${${flag}_FLAGS}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ras0219-msft I would be curious about the actual cases which motivated this line. Bash shouldn't treat paths different from other arguments, exept that it may do expansion of * or ~. (In a bash world, you would resolve this with single quotes.)
But MSYS2 has special treatment for converting Unix paths to Windows paths in command line arguments and environment variables. This could probably be resolved by setting enviroment variables to declare the known flags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash scripts

Means libtool and other stuff run via configure. Just try to remove it and see the vcpkg_configure_make world burn ;)

See #12936. Especially 65e71b1 (I aborted the CI run since I already saw it failing) vs 723b9d7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Means libtool and other stuff run via configure.

Means MSYS2 runtime, not bash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Illustration

$ /usr/bin/echo.exe /libpath/users
/libpath/users
$ /C/Windows/System32/findstr.exe a /libpath/users
FINDSTR: D:/msys64/libpath/users kann nicht geöffnet werden.
$ MSYS2_ARG_CONV_EXCL=/libpath /C/Windows/System32/findstr.exe a /libpath/users
FINDSTR: /libpath/users kann nicht geöffnet werden.

I see that the MSYS2_ARG_CONV_EXCL doesn't scale to all combinations of tools and parameters, even if scoped via wrappers.
But sometimes it is necessary to understand that the transformation is not in bash itself (cf. bash -> echo) but a MSYS2 service at the border between MSYS2 runtime (bash) and windows runtime (findstr).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Means MSYS2 runtime, not bash.

libtool is just a bash script. But I really don't care about the details anymore. vcpkg should just build the msys stuff all by itself and no longer have to deal with MSYS2 since it has often enough shown to be instable by removing downloadable stuff.

Expand Down
2 changes: 1 addition & 1 deletion ports/vcpkg-cmake/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vcpkg-cmake",
"version-date": "2022-04-07",
"version-date": "2022-04-12",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7293,7 +7293,7 @@
"port-version": 1
},
"vcpkg-cmake": {
"baseline": "2022-04-07",
"baseline": "2022-04-12",
"port-version": 0
},
"vcpkg-cmake-config": {
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-cmake.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7865bb6a8f7c708eaa93ff34e2c5ab0c97c479e3",
"version-date": "2022-04-12",
"port-version": 0
},
{
"git-tree": "3dcb01563c0de941013579456d19ce5b0bd08a6e",
"version-date": "2022-04-07",
Expand Down