Skip to content
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

Windows -gnu target (MinGW) compilation error #330

Closed
Philipp91 opened this issue Nov 5, 2016 · 9 comments
Closed

Windows -gnu target (MinGW) compilation error #330

Philipp91 opened this issue Nov 5, 2016 · 9 comments

Comments

@Philipp91
Copy link
Contributor

TL;DR: MinGW and VS2015 toolchains both produce different errors, solving each leads to new errors in the next part of the compile process. I'm mostly posting the full error logs here not for you to read, but for others to find through search engines. Please tell me which toolchain should be used preferably, so I can dig further in the right direction.

Version info:

rustc 1.12.0 (3191fbae9 2016-09-23)
GNU Make 4.0 Built for x86_64-w64-mingw32
Latest mingw64 installed by Git for Windows, plus win-builds. mingw32-make.exe renamed to make.exe, no other make.exe installed anywhere.
yasm 1.3.0
This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-msys-thread-multi

Ouptut:

$ cargo build --release
   Compiling ring v0.5.3 (file:///C:/.../ring-test/ring)
error: failed to run custom build command for `ring v0.5.3 (file:///C:/.../ring-test/ring)`
process didn't exit successfully: `C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\build-script-build` (exit code: 101)
--- stdout
LANG: de_DE.UTF-8
COMPUTERNAME: PHILIPP-PC
ANSICON_DEF: 7
PSMODULEPATH: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
SHLVL: 1
GUROBI_HOME: C:\gurobi652\win64
TERM: cygwin
PROCESSOR_LEVEL: 6
HOST: x86_64-pc-windows-gnu
CONSOLEZVERSION: 1.17.0.16129
CARGO_PKG_VERSION: 0.5.3
COMMONPROGRAMFILES(X86): C:\Program Files (x86)\Common Files
PRINTER: Brother MFC-J4410DW Printer (Kopie 1)
ALLUSERSPROFILE: C:\ProgramData
CARGO_PKG_VERSION_PATCH: 3
CARGO_PKG_VERSION_MINOR: 5
CARGO_FEATURE_DEFAULT: 1
PUBLIC: C:\Users\Public
PATH: C:\Git\bin\;C:\Users\Philipp\bin;C:\Git\mingw64\bin;C:\Git\usr\local\bin;C:\Git\usr\bin;C:\Git\usr\bin;C:\Git\mingw64\bin;C:\Git\usr\bin;C:\Users\Philipp\bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Git\usr\bin;C:\Program Files\apache-maven-3.3.9\bin;C:\Program Files\PHP7;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs;C:\Users\Philipp\ansicon;C:\Program Files\Rust stable GNU 1.12\bin;C:\Users\Philipp\AppData\Local\Android\sdk\platform-tools;C:\Users\Philipp\AppData\Roaming\Composer\vendor\bin;C:\Users\Philipp\AppData\Roaming\npm;C:\Users\Philipp\AppData\Local\Microsoft\WindowsApps;C:\Git\usr\bin\vendor_perl;C:\Git\usr\bin\core_perl;C:\Git\opt\windows_64\bin\;C:\...\ring-test\ring\target\release\deps
SHELL: C:\Windows\System32\cmd.exe
WINDIR: C:\WINDOWS
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_111
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
COMSPEC: C:\WINDOWS\system32\cmd.exe
COMMONPROGRAMFILES: C:\Program Files\Common Files
CONSOLEZSETTINGSDIR: C:\Users\Philipp\AppData\Roaming\Console\
HOMEDRIVE: C:
PS1: \[\033[01;32m\]\u\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)")\[\033[01;34m\]$\[\033[00m\]
HOSTNAME: Philipp-PC
MANPATH: C:\Git\mingw64\share\man;C:\Git\usr\local\man;C:\Git\usr\share\man;C:\Git\usr\man;C:\Git\share\man
PROFILE: release
LOCALAPPDATA: C:\Users\Philipp\AppData\Local
CONSOLEZSNIPPETSDIR: C:\Users\Philipp\AppData\Roaming\Console\Snippets\
PROCESSOR_REVISION: 5e03
HOME: C:\Users\Philipp
HOMEPATH: \Users\Philipp
PKG_CONFIG_PATH: C:\Git\mingw64\lib\pkgconfig;C:\Git\mingw64\share\pkgconfig
COMMONPROGRAMW6432: C:\Program Files\Common Files
CARGO_PKG_AUTHORS: Brian Smith <[email protected]>
TMP: C:\Users\Philipp\AppData\Local\Temp
OS: Windows_NT
VS140COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
PLINK_PROTOCOL: ssh
CARGO_PKG_VERSION_PRE:
DISPLAY: needs-to-be-defined
LOGONSERVER: \\PHILIPP-PC
SYSTEMROOT: C:\WINDOWS
PROGRAMW6432: C:\Program Files
CARGO_PKG_VERSION_MAJOR: 0
NUM_JOBS: 4
PROGRAMDATA: C:\ProgramData
TARGET: x86_64-pc-windows-gnu
ACLOCAL_PATH: C:\Git\mingw64\share\aclocal;C:\Git\usr\share\aclocal
CARGO_PKG_HOMEPAGE:
SYSTEMDRIVE: C:
PROGRAMFILES(X86): C:\Program Files (x86)
SSH_AGENT_PID: 17304
APPDATA: C:\Users\Philipp\AppData\Roaming
SSH_ASKPASS: C:/Git/mingw64/libexec/git-core/git-gui--askpass
TMPDIR: C:\Users\Philipp\AppData\Local\Temp
SSH_AUTH_SOCK: C:/Users/Philipp/AppData/Local/Temp/ssh-Lu1c34cFDOXz/agent.8976
PROCESSOR_ARCHITECTURE: AMD64
_: C:/Program Files/Rust stable GNU 1.12/bin/cargo
SESSIONNAME: Console
MSYSTEM: MINGW64
EXEPATH: C:\Git\bin
USERPROFILE: C:\Users\Philipp
OUT_DIR: C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out
RUSTC: rustc
PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROGRAMFILES: C:\Program Files
ANDROID_HOME: C:\Users\Philipp\AppData\Local\Android\sdk
CARGO_FEATURE_USE_HEAP: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_PKG_NAME: ring
TEMP: C:\Users\Philipp\AppData\Local\Temp
PWD: C:/.../ring-test/ring
USERDOMAIN: PHILIPP-PC
CONSOLEZBASEDIR: C:\Program Files\Console2\
NUMBER_OF_PROCESSORS: 4
CARGO_MANIFEST_DIR: C:\...\ring-test\ring
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
=C:: C:\Users\Philipp
INFOPATH: C:\Git\usr\local\info;C:\Git\usr\share\info;C:\Git\usr\info;C:\Git\share\info
VBOX_MSI_INSTALL_PATH: C:\Program Files\Oracle\VirtualBox\
!EXITCODE: 00000000
PROMPT: $P$G
RUSTDOC: rustdoc
ANSICON: 157x5000 (157x52)
USERNAME: Philipp
OPT_LEVEL: 3
DEBUG: false
USERDOMAIN_ROAMINGPROFILE: PHILIPP-PC
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/lib/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/chacha/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/cipher/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rand/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rsa/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/sha/asm/
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/test/

--- stderr
make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007FFC7686FE04)
thread 'main' panicked at 'make execution failed with args ["-j4", "TARGET=x86_64-pc-windows-gnu", "CMAKE_BUILD_TYPE=RELWITHDEBINFO", "BUILD_PREFIX=C:\\...\\ring-test\\ring\\target\\release\\build\\ring-3ef0c1e9e9d049d8\\out/"]', build.rs:230
note: Run with `RUST_BACKTRACE=1` for a backtrace.

The path abbreviated with "..." does not contain any spaces. 0xc0000005 apparently is a permissions error or segfault, I think. I wasn't able to find out which part of the make script causes that error.

My initial first attempt (before the one reported above) failed because make was missing. I then installed GNUWin32's make and used the "Developer command prompt for VS2015" with the following tools:

Microsoft (R)-Buildmodul, Version 14.0.25123.0
GNU Make 3.81 This program built for i386-pc-mingw32
rustc 1.12.0 (3191fbae9 2016-09-23)
yasm 1.3.0
This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32-x64-multi-thread

Output:

cargo build --release
   Compiling ring v0.5.3 (file:///C:/.../ring-test/ring)
   Compiling untrusted v0.3.1
error: failed to run custom build command for `ring v0.5.3 (file:///C:/.../ring-test/ring)`
process didn't exit successfully: `C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\build-script-build` (exit code: 101)
--- stdout
PSMODULEPATH: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
CARGO_PKG_VERSION_PRE:
LIB: C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86;
SYSTEMDRIVE: C:
DEBUG: false
NUMBER_OF_PROCESSORS: 4
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
USERNAME: Philipp
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio 14.0\
SYSTEMROOT: C:\WINDOWS
PUBLIC: C:\Users\Public
FRAMEWORKDIR32: C:\Windows\Microsoft.NET\Framework\
CARGO_PKG_VERSION_MAJOR: 0
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
=C:: C:\...\ring-test\ring
NETFXSDKDIR: C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\
DEVENVDIR: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\
ALLUSERSPROFILE: C:\ProgramData
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_111
VISUALSTUDIOVERSION: 14.0
PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_ARCHITECTURE: AMD64
WINDOWSSDKVERSION: \
WINDOWSSDKLIBVERSION: winv6.3\
VBOX_MSI_INSTALL_PATH: C:\Program Files\Oracle\VirtualBox\
CARGO_PKG_VERSION_MINOR: 5
CARGO_PKG_AUTHORS: Brian Smith <[email protected]>
HOMEDRIVE: C:
COMPUTERNAME: PHILIPP-PC
SESSIONNAME: Console
VS140COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
HOST: x86_64-pc-windows-gnu
ANDROID_HOME: C:\Users\Philipp\AppData\Local\Android\sdk
PROGRAMFILES(X86): C:\Program Files (x86)
TEMP: C:\Users\Philipp\AppData\Local\Temp
=EXITCODE: 00000000
WINDOWSSDK_EXECUTABLEPATH_X64: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\
TARGET: x86_64-pc-windows-gnu
COMMONPROGRAMFILES(X86): C:\Program Files (x86)\Common Files
FSHARPINSTALLDIR: C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\
GUROBI_HOME: C:\gurobi652\win64
WINDOWSLIBPATH: References\CommonConfiguration\Neutral
CARGO_PKG_HOMEPAGE:
FRAMEWORKVERSION: v4.0.30319
PROCESSOR_LEVEL: 6
PROFILE: release
CARGO_FEATURE_DEFAULT: 1
CARGO_PKG_VERSION: 0.5.3
PROGRAMDATA: C:\ProgramData
LIBPATH: C:\Windows\Microsoft.NET\Framework\v4.0.30319;
LOCALAPPDATA: C:\Users\Philipp\AppData\Local
PROCESSOR_REVISION: 5e03
COMSPEC: C:\WINDOWS\system32\cmd.exe
LOGONSERVER: \\PHILIPP-PC
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
NUM_JOBS: 4
FRAMEWORK40VERSION: v4.0
CARGO_PKG_NAME: ring
INCLUDE: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;
RUSTC: rustc
COMMONPROGRAMW6432: C:\Program Files\Common Files
APPDATA: C:\Users\Philipp\AppData\Roaming
PROMPT: $P$G
OUT_DIR: C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out
VCINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\;C:\Program Files (x86)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\;C:\gurobi652\win64\bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Git\bin;C:\Program Files\apache-maven-3.3.9\bin;C:\Program Files\PHP7;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\Philipp\ansicon;C:\Program Files\Rust stable GNU 1.12\bin;C:\Users\Philipp\AppData\Local\Android\sdk\platform-tools;C:\Program Files (x86)\GnuWin32\bin;C:\Strawberry\perl\bin;C:\Users\Philipp\AppData\Roaming\Composer\vendor\bin;C:\Users\Philipp\AppData\Roaming\npm;C:\Users\Philipp\AppData\Local\Microsoft\WindowsApps;;C:\...\ring-test\ring\target\release\deps
USERDOMAIN: PHILIPP-PC
OPT_LEVEL: 3
WINDOWSSDK_EXECUTABLEPATH_X86: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
CARGO_PKG_VERSION_PATCH: 3
HOMEPATH: \Users\Philipp
RUSTDOC: rustdoc
CARGO_FEATURE_USE_HEAP: 1
TMP: C:\Users\Philipp\AppData\Local\Temp
FRAMEWORKVERSION32: v4.0.30319
WINDIR: C:\WINDOWS
FRAMEWORKDIR: C:\Windows\Microsoft.NET\Framework\
USERDOMAIN_ROAMINGPROFILE: PHILIPP-PC
PROGRAMW6432: C:\Program Files
OS: Windows_NT
USERPROFILE: C:\Users\Philipp
COMMONPROGRAMFILES: C:\Program Files\Common Files
PROGRAMFILES: C:\Program Files
CARGO_MANIFEST_DIR: C:\...\ring-test\ring
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/lib
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/chacha/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/cipher
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rand
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rsa
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/sha/asm
mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/test

--- stderr
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/lib, ...) failed.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto, ...) failed.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes, ...) failed.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/aes/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/bn/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/chacha/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/cipher, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/curve25519/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/ec/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/modes/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/poly1305/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rand, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/rsa, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/sha/asm, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/test, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
make (e=2): Das System kann die angegebene Datei nicht finden.
make: *** Warte auf noch nicht beendete Prozesse...
make (e=2): Das System kann die angegebene Datei nicht finden.
make (e=2): Das System kann die angegebene Datei nicht finden.
thread 'main' panicked at 'make execution failed with args ["-j4", "TARGET=x86_64-pc-windows-gnu", "CMAKE_BUILD_TYPE=RELWITHDEBINFO", "BUILD_PREFIX=C:\\...\\ring-test\\ring\\target\\release\\build\\ring-3ef0c1e9e9d049d8\\out/"]', build.rs:230
note: Run with `RUST_BACKTRACE=1` for a backtrace.

where Das System kann die angegebene Datei nicht finden. is file not found.
Note that I changed build.rs to also include the args of the failing make call. The mkdir being executed is the Windows one (German error message). It doesn't know the -p switch and doesn't like forward slashes. When I run the mkdir -p C:\...\ring-test\ring\target\release\build\ring-3ef0c1e9e9d049d8\out/obj/crypto/test manually, however, it fails with a syntax error. There seems to be a lot of confusion about which mkdir is used. When I change the makefile to mkdir -p "$@" (note the extra quotation marks), it uses the MinGW one and it works, but the subsequent cc command fails...

So please let me know which toolchain you recommend on Windows.

@briansmith
Copy link
Owner

Thanks for the bug report.

What's the error from the MSVC toolchain?

-msvc is the Windows target that I've actively supported so far. I'm also open to making changes to ensure that -gnu works.

@briansmith
Copy link
Owner

Note that #321 might help solve this. In the interim, I'd accept a PR that quotes the argument to mkdir. That's the cc error that you?

@Philipp91
Copy link
Contributor Author

Philipp91 commented Nov 7, 2016

TL;DR: Visual Studio .sln works, outputs .obj files. Makefile with quotes for mkdir fails at cc call with "file not found", probably also an issue with slashes. Maybe would have to add quotes to the cc call, too. But then: Should cargo call the makefile for an msvc build, or should it call msbuild, which it doesn't? #321 looks promising for -gnu build, I'm trying that now.
// EDIT: Just realised that there is a difference between Rust GNU ABI and Rust MSVC ABI. I must have installed the former, so I'll check out #321.

I tried to open the ring.sln in Visual Studio and it complained about a missing C++ support for Windows XP. So I installed that, now the project loads and it builds without errors in Visual Studio. Output is a bunch of obj files, not sure how to use those with Rust.

For the cargo-Build: I now put C:\Windows\Microsoft.NET\Framework64\v4.0.30319 on my PATH, as it seems to be the latest msbuild.exe in there. So now, using regular Windows shell:

> msbuild /version
Microsoft (R)-Buildmodul, Version 4.6.1586.0
[Microsoft .NET Framework, Version 4.0.30319.42000]

All other versions are the same as reported in the second part of my initial post. I'm using the latest master-branch.

> cargo clean
> cargo build --release

I still get the output from my first post. Repeating only relevant parts:

   Compiling ring v0.6.0 (file:///C:/.../ring-test/ring)
   Compiling untrusted v0.3.1
error: failed to run custom build command for `ring v0.6.0 (file:///C:/.../ring-test/ring)`
process didn't exit successfully: `C:\...\ring-test\ring\target\release\build\ring-4ffd1c9aa2836aab\build-script-build` (exit code: 101)
.......
--- stderr
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-4ffd1c9aa2836aab\out/lib, ...) failed.
process_begin: CreateProcess(NULL, mkdir -p C:\...\ring-test\ring\target\release\build\ring-4ffd1c9aa2836aab\out/obj/crypto, ...) failed.
......
make (e=2): Das System kann die angegebene Datei nicht finden.
make (e=2): Das System kann die angegebene Datei nicht finden.
make: *** Warte auf noch nicht beendete Prozesse...
make (e=2): Das System kann die angegebene Datei nicht finden.
make (e=2): Das System kann die angegebene Datei nicht finden.
thread 'main' panicked at 'make execution failed with args ["-j4", "TARGET=x86_64-pc-windows-gnu", "CMAKE_BUILD_TYPE=RELWITHDEBINFO", "BUILD_PREFIX=C:\\...\\ring-test\\ring\\target\\release\\build\\ring-4ffd1c9aa2836aab\\out/"]', build.rs:230
note: Run with `RUST_BACKTRACE=1` for a backtrace.

My build.rs:230 is: panic!("{} execution failed with args {:?}", command_name.as_ref().to_str().unwrap(), args);.
I don't know why it uses the -gnu build here. But when I execute

> make -j4 TARGET=x86_64-pc-windows-msvc CMAKE_BUILD_TYPE=RELWITHDEBINFO BUILD_PREFIX=C:\\...\\ring-test\\ring\\target\\release\\build\\ring-4ffd1c9aa2836aab\\out/

manually, I get the exact same mkdir failures. And indeed, "mkdir -p" is not something that I would expect Windows to understand. Cargo seems to believe that -gnu is the proper build target. Is the makefile even the right way to build ring on Windows (msvc) in the first place, or should cargo be calling something else (msbuild)?

Makefile with quotes leads to file-not-found errors in the cc call, probably also caused by the forward slashes:

... (all mkdir succeed) ...
process_begin: CreateProcess(NULL, cc -std=c1x -Wbad-function-cast -Wmissing-field-initializers -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -fpic -fdata-sections -ffunction-sections -g3 -pedantic -pedantic-errors -Wall -Werror -Wextra -Wcast-align -Wcast-qual -Wenum-compare -Wfloat-equal -Wformat=2 -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wredundant-decls -Wshadow -Wsign-compare -Wundef -Wuninitialized -Wwrite-strings -fstack-protector -DNDEBUG -O3 -MMD -Iinclude -D_XOPEN_SOURCE=700 -DBORINGSSL_IMPLEMENTATION -fno-strict-aliasing -fvisibility=hidden -Wno-cast-align -march=x86-64 -m64 -c -o C:\...\ring-test\ring\target\release\build\ring-4ffd1c9aa2836aab\out/obj/crypto/aes/aes.o crypto/aes/aes.c, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
make: *** [C:\\...\\ring-test\\ring\\target\\release\\build\\ring-4ffd1c9aa2836aab\\out/obj/crypto/aes/aes.o] Fehler 2

@Philipp91
Copy link
Contributor Author

Philipp91 commented Nov 7, 2016

Most of the errors reported in this issue are due to my unawareness of separate Rust toolchains that can be installed and switched with rustup. I now properly switched to the "-msvc" toolchain and it works pretty much out of the box. Maybe BUILDING.md should be more specific, so "Building ring on Windows" could become "Building ring on Windows with the *-windows-msvc toolchain"?

With the #321 code and the -gnu toolchain, I run into this check: https://github.com/briansmith/ring/pull/321/files#diff-a7b0a2dee0126cddf994326e705a91eaR687

@briansmith thank you for your help!

@briansmith briansmith reopened this Nov 7, 2016
@Philipp91 Philipp91 changed the title Windows (MinGW) compilation error Windows -gnu target (MinGW) compilation error Nov 7, 2016
@briansmith
Copy link
Owner

I'll make this issue be "The build doesn't work for the -gnu toolchain on Windows."

Note that you don't need to run MSBuild yourself or do anything with Visual Studio yourself. The build.rs script will do all the Visual Studio/MSBuild stuff automatically.

Note that support for the -gnu toolchain on Windows will likely be done by people other than me and I'll only support it minimally. I recommend everybody use the -msvc toolchain.

With the #321 code and the -gnu toolchain, I run into this check: https://github.com/briansmith/ring/pull/321/files#diff-a7b0a2dee0126cddf994326e705a91eaR687

It seems like that's because that PR is targeting non-Windows builds. I guess a follow-up PR will address that.

Thanks for all the info in this bug report. It's very helpful. I filed #335 about improving the documentation in BUILDING.md, and #336 about getting the build to work even when the XP compatibility stuff isn't installed.

Thanks again!

@briansmith
Copy link
Owner

This is something that would be good to do after #321 and #340 completely rewrite the build script.

@briansmith
Copy link
Owner

After rust-lang/prev.rust-lang.org#602 and rust-lang/prev.rust-lang.org#341, this seems like a low-priority issue now. People should just use the -msvc toolchain. But, I'll take PRs after #321 and #340 land.

@briansmith
Copy link
Owner

Closing this. MinGW and cygwin aren't Tier 1 for ring. I will accept non-obtrusive and easy-to-maintain PRs that make it work. Note that #321 and #340 were fixed so things may be (close to) working now.

@briansmith
Copy link
Owner

This may be working now as of ring 0.7.5, thanks to some contributed patches and some minor fixing-up.

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

No branches or pull requests

2 participants