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

Ring 0.14.6 fails to build using VS 11.0 build tools #817

Closed
fuglede opened this issue May 6, 2019 · 4 comments
Closed

Ring 0.14.6 fails to build using VS 11.0 build tools #817

fuglede opened this issue May 6, 2019 · 4 comments

Comments

@fuglede
Copy link

fuglede commented May 6, 2019

When trying to build the cargo default "hello world" project with ring = "0.14.6" as the only dependency, the build fails with the output given below.

Presumably this happens because of the particular VS build tools that end up being used. I have multiple different sets installed, and it seems to pick one of the older (unsupported?) ones out-of-the-box. Notably, Visual C++ Build Tools 2015, as listed as a requirement in BUILDING.md, is installed on the machine but isn't being picked up.

cargo run
   Compiling cc v1.0.36
   Compiling libc v0.2.54
   Compiling winapi v0.3.7
   Compiling untrusted v0.6.2
   Compiling spin v0.5.0
   Compiling ring v0.14.6
error: failed to run custom build command for `ring v0.14.6`
process didn't exit successfully: `C:\Users\<username>\repos\ringtest\target\debug\build\ring-8e09475864d847ab\build-script-build` (exit code: 101)
--- stdout
=::: ::\
=C:: C:\Users\<username>\repos\ringtest
=EXITCODE: 00000000
CARGO: \\?\C:\Users\<username>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe
CARGO_CFG_DEBUG_ASSERTIONS:
CARGO_CFG_PROC_MACRO:
CARGO_CFG_TARGET_ARCH: x86_64
CARGO_CFG_TARGET_ENDIAN: little
CARGO_CFG_TARGET_ENV: msvc
CARGO_CFG_TARGET_FAMILY: windows
CARGO_CFG_TARGET_FEATURE: fxsr,sse,sse2
CARGO_CFG_TARGET_OS: windows
CARGO_CFG_TARGET_POINTER_WIDTH: 64
CARGO_CFG_TARGET_VENDOR: pc
CARGO_CFG_WINDOWS:
CARGO_FEATURE_DEFAULT: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_FEATURE_USE_HEAP: 1
CARGO_HOME: C:\Users\<username>\.cargo
CARGO_MAKEFLAGS: --jobserver-fds=__rust_jobserver_semaphore_2465172569 --jobserver-auth=__rust_jobserver_semaphore_2465172569
CARGO_MANIFEST_DIR: C:\Users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6
CARGO_MANIFEST_LINKS: ring-asm
CARGO_PKG_AUTHORS: Brian Smith <brian@briansmith.org>
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
CARGO_PKG_HOMEPAGE:
CARGO_PKG_NAME: ring
CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring
CARGO_PKG_VERSION: 0.14.6
CARGO_PKG_VERSION_MAJOR: 0
CARGO_PKG_VERSION_MINOR: 14
CARGO_PKG_VERSION_PATCH: 6
CARGO_PKG_VERSION_PRE:
HOST: x86_64-pc-windows-msvc
LD_LIBRARY_PATH: C:\Users\<username>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib
OUT_DIR: C:\Users\<username>\repos\ringtest\target\debug\build\ring-7fc09dbbec610e31\out
PATH: C:\Users\<username>\repos\ringtest\target\debug\deps;C:\Users\<username>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin;C:\Users\<username>\.cargo\bin;C:\Users\<username>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin;<removed>
RUSTC: rustc
RUSTDOC: rustdoc
RUSTUP_HOME: C:\Users\<username>\.rustup
RUSTUP_TOOLCHAIN: stable-x86_64-pc-windows-msvc
RUST_RECURSION_COUNT: 1
TARGET: x86_64-pc-windows-msvc
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = Some("true")
running "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\amd64\\cl.exe" "/nologo" "/MD" "/Z7" "/I" "include" "/W4" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Od" "/RTCsu" "-c" "/FoC:\\Users\\<username>\\repos\\ringtest\\target\\debug\\build\\ring-7fc09dbbec610e31\\out\\block.obj" "crypto/block.c"
block.c
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(206) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(206) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(206) : error C2085: 'constant_time_msb_w' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(206) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(211) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(211) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(211) : error C2085: 'constant_time_is_zero_w' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(211) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(226) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(226) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(226) : error C2085: 'constant_time_is_nonzero_w' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(226) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(231) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(231) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(232) : error C2085: 'constant_time_eq_w' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(232) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(239) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(239) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(241) : error C2085: 'constant_time_select_w' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(241) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(266) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(266) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(266) : error C2085: 'from_be_u32_ptr' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(266) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(276) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(276) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(276) : error C2085: 'to_be_u32_ptr' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(276) : error C2143: syntax error : missing ';' before '{'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(285) : warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(285) : error C2054: expected '(' to follow 'inline'
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(285) : error C2085: 'to_be_u64_ptr' : not in formal parameter list
c:\users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\crypto\internal.h(285) : error C2143: syntax error : missing ';' before '{'

--- stderr
cl : Command line warning D9014 : invalid value '5045' for '/wd'; assuming '4999'
cl : Command line warning D9002 : ignoring unknown option '/Zc:inline'
cl : Command line warning D9002 : ignoring unknown option '/Zc:rvalueCast'
thread 'main' panicked at 'execution failed', C:\Users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.14.6\build.rs:638:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
@fuglede
Copy link
Author

fuglede commented May 6, 2019

I believe I might have erroneously picked up the "Visual Studio Build Tools 2015" (and not the "Visual C++ Build Tools 2015"); after uninstalling Visual Studio 2012 entirely, I'm left with no cl.exe at all. As such, let me close this issue to avoid the noise pollution.

@fuglede fuglede closed this as completed May 6, 2019
@fuglede
Copy link
Author

fuglede commented May 7, 2019

FWIW, after setting up Visual Studio C++ Build Tools 2015, ring still won't compile, but for reasons that are probably on Rust itself (being unable to find the necessary libraries):

   Compiling ringtest v0.1.0 (C:\Users\<username>\repos\ringtest)
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.1i33hkqwhqe7gav2.rcgu.o" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.3i3xayxrzczp81y3.rcgu.o" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.3j3j86zasdn4ty2o.rcgu.o" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.4ebe7m8kp0upygn9.rcgu.o" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.4zojl5mkauwbt94g.rcgu.o" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.s78ukaok8co8ayg.rcgu.o" "/OUT:C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.exe" "C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps\\ringtest-8adf638647b0e9f1.3tsuohsqc3u0rm2t.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\deps" "/LIBPATH:C:\\Users\\<username>\\repos\\ringtest\\target\\debug\\build\\ring-7fc09dbbec610e31\\out" "/LIBPATH:C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-c1e537280a7eb2d9.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-fea7faaed3d25759.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace_sys-b0e97dc981603010.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-d93e4acd3f7f9acb.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-42249eebbc8b7bf7.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-9bb7faeb8ad341e3.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-ae07d6dbc61a1548.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-53d2dfe88d5ede66.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-797cfa1fd40eb75c.rlib" "C:\\Users\\<username>\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-8424507037470daf.rlib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
          

error: aborting due to previous error

error: Could not compile `ringtest`.

To learn more, run the command again with --verbose.

@fuglede
Copy link
Author

fuglede commented May 7, 2019

And just to wrap this one up for anybody who might come across this in the future, by following this comment, I did manage to get this running after including both the "VS 2015 C++ build tools" and the "Windows 10 SDK" from the Visual Studio Installer:

image

@everydayanchovies
Copy link

And just to wrap this one up for anybody who might come across this in the future, by following this comment, I did manage to get this running after including both the "VS 2015 C++ build tools" and the "Windows 10 SDK" from the Visual Studio Installer:

image

Yes fantastic, thank you! Made my day

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

No branches or pull requests

2 participants