Skip to content

windows-msvc builds very fragile #28018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Diggsey opened this issue Aug 26, 2015 · 0 comments · Fixed by #28035
Closed

windows-msvc builds very fragile #28018

Diggsey opened this issue Aug 26, 2015 · 0 comments · Fixed by #28035
Labels
O-windows Operating system: Windows

Comments

@Diggsey
Copy link
Contributor

Diggsey commented Aug 26, 2015

./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!

@sfackler sfackler added the O-windows Operating system: Windows label Aug 26, 2015
bors added a commit that referenced this issue Sep 4, 2015
This fixes #28018 with the exception of the point about cmake, but that's really a limitation of `./configure` builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants