Skip to content

windows-msvc builds very fragile #28018

Closed
@Diggsey

Description

@Diggsey

./configure for -msvc freely interchanges between windows/msys commands, which results in it being quite fragile: it's a good idea to treat msys as a purely unix-like environment, and then have a single escape-hatch to execute windows commands (eg. via cmd).

Ways this can currently break (these are just the ones I personally ran into):

  • Having cmake installed in msys. The msys version of cmake does not support visual studio - this is by design: http://www.cmake.org/Bug/view.php?id=14797
  • Having a program/script named reg on the path. This will cause ./configure's reg invocations to fail, as it expects them to call the windows reg utility.
  • Not having msys inherit PATH from windows: this is perfectly valid, and was at one point required to build rust in msys, if rust was installed on PATH in windows.
  • In several places, the escaping is broken and only works by chance. For example, on this line include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%"), msys path conversion will convert /c into C:\, and the value of %INCLUDE% will not include the additions that vcvarsall would normally make. As yet, I've been unable to determine the correct escape sequence to use (//c will produce the desired /c, but that will uncover a host of new escaping issues...)

The quick way to solve most of these problems is to run all commands intended to run in the windows environment via cmd: this eliminates potential for conflicts to a single item, cmd, and will ensure those commands find the windows versions of programs. However it does not solve the escaping issue.

Moving to a cargo-based build system and dropping the msys dependency altogether will of course fix this much more effectively!

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions