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

Cannot build on windows #35

Closed
kjeremy opened this issue Oct 3, 2019 · 8 comments
Closed

Cannot build on windows #35

kjeremy opened this issue Oct 3, 2019 · 8 comments
Labels
E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@kjeremy
Copy link

kjeremy commented Oct 3, 2019

Bug Report

Version

Master

Platform

64-bit Windows 10

Description

Cannot build on windows.

From a fresh checkout tried cargo run --bin helloworld-client

Got:

error: failed to run custom build command for openssl-sys v0.9.50

Caused by:
process didn't exit successfully: C:\projects\test\tonic\target\debug\build\openssl-sys-0c79ae8c49ce2a76\build-script-main (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR
X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR
X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
note: vcpkg did not find openssl as libcrypto and libssl: Could not find Vcpkg tree: No vcpkg.user.targets found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'
note: vcpkg did not find openssl as ssleay32 and libeay32: Could not find Vcpkg
tree: No vcpkg.user.targets found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this -sys crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the OPENSSL_DIR environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-pc-windows-msvc
$TARGET = x86_64-pc-windows-msvc
openssl-sys = 0.9.50

It looks like you're compiling for MSVC but we couldn't detect an OpenSSL
installation. If there isn't one installed then you can try the rust-openssl
README for more information about how to download precompiled binaries of
OpenSSL:

https://github.com/sfackler/rust-openssl#windows

', C:\Users\jkolb.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-sys-0.9.50\build\find_normal.rs:150:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

@LucioFranco
Copy link
Member

@kjeremy hi! Looks like its unable to find openssl. This is because the interop tests need this. I think besides installing openssl you may want to just comment out the tonic-interop entry in the Cargo.toml at the root of the repo.

@kjeremy
Copy link
Author

kjeremy commented Oct 3, 2019

@LucioFranco thanks. In order to install openssl I had to install vcpkg and then follow the instructions from this comment. That allowed me to cargo build and cargo test from cmd.exe (though building from git bash fails).

Note that when running (no firewall on the machine) I get:

c:\projects\test\tonic>cargo run --bin helloworld-client
Finished dev [unoptimized + debuginfo] target(s) in 0.38s
Running target\debug\helloworld-client.exe
Error: Status { code: Unknown, message: "Client: buffered service failed: error trying to connect: No connection could be made because the target machine actively refused it. (os error 10061)" }
error: process didn't exit successfully: target\debug\helloworld-client.exe (exit code: 1)

and

c:\projects\test\tonic>cargo run --bin helloworld-server
Finished dev [unoptimized + debuginfo] target(s) in 0.36s
Running target\debug\helloworld-server.exe
Error: Error(Server, Error(Accept, Error(Listen, Os { code: 10013, kind: PermissionDenied, message: "An attempt was made to access a socket in a way forbidden by its access permissions." })))
error: process didn't exit successfully: target\debug\helloworld-server.exe (exit code: 1)

@LucioFranco
Copy link
Member

@carllerche have you seen this type of error on TcpListener::accept on windows?

@steffengy
Copy link

Cannot reproduce on 1903, @kjeremy can you rule out the port (50051) being used by another program?

@kjeremy
Copy link
Author

kjeremy commented Oct 4, 2019

That port is not being used.

I went into my network adapters and disabled the "Npcap Loopback Adapter" from Wireshark and it started working. I re-enabled the adapter and it STILL works so I'm not really sure what the problem was.

@LucioFranco LucioFranco added the E-help-wanted Call for participation: Help is requested to fix this issue. label Oct 4, 2019
@LucioFranco
Copy link
Member

@kjeremy interesting. Are you still not able to reproduce?

@omac777
Copy link

omac777 commented Oct 7, 2019

Try this:

cd C:\dev\msys64\home\davidm
git clone https://github.com/hyperium/tonic

FIRST RUN the vc++ environment:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
cd C:\dev\msys64\home\davidm\vcpkg
powershell
.\bootstrap-vcpkg.bat
.\vcpkg install openssl:x64-windows

set VCPKG_ROOT=c:\dev\msys64\home\davidm\vcpkg
set VCPKGRS_DYNAMIC=1
cd C:\dev\msys64\home\davidm\tonic\
cargo build --release

PS C:\dev\msys64\home\davidm\vcpkg> .\vcpkg owns openssl
openssl-windows:x64-windows: x64-windows/tools/openssl/LIBEAY32.dll
openssl-windows:x64-windows: x64-windows/tools/openssl/SSLEAY32.dll
openssl-windows:x64-windows: x64-windows/tools/openssl/openssl.exe

PS C:\dev\msys64\home\davidm\tonic> [Environment]::SetEnvironmentVariable("PATH", "C:\dev\msys64\home\davidm\vcpkg\installed\x64-windows\tools\openssl;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program File
s (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Win
dows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studi
o\2017\BuildTools\Common7\Tools\;C:\ProgramData\Boxstarter;C:\VulkanSDK\1.1.106.0\Bin;C:\Program Files\ImageMagick-6.9.3-Q16;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\
system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Hewlett-Packard\HP Performance Advisor;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine
 Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Symantec.cloud\PlatformAgent\;
C:\ProgramData\chocolatey\bin;C:\Go\bin;C:\Users\davidm\.cargo\bin;C:\Users\davidm\AppData\Local\Microsoft\WindowsApps;C:\Users\davidm\go\bin;C:\Git;C:\Git\bin;C:\pipeline_virtenv\Scripts;L:\3D\Maya\Maya2015\scriptLib\bin;C:\ffmpeg;C:\radare2;C:\MSVsCode\bin;C:\Users\dav
idm\go\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja", "Process")

PS C:\dev\msys64\home\davidm\tonic> $Env:Path
C:\dev\msys64\home\davidm\vcpkg\installed\x64-windows\tools\openssl;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Micros
oft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\;C:\ProgramData\Boxstarter;C:\VulkanSDK\1.1.106.0\B
in;C:\Program Files\ImageMagick-6.9.3-Q16;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\
v1.0\;c:\Program Files (x86)\Hewlett-Packard\HP Performance Advisor;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:
\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Symantec.cloud\PlatformAgent\;C:\ProgramData\chocolatey\bin;C:\Go\bin;C:\Users\davidm\.cargo\bin;C:\Users\davidm\
AppData\Local\Microsoft\WindowsApps;C:\Users\davidm\go\bin;C:\Git;C:\Git\bin;C:\pipeline_virtenv\Scripts;L:\3D\Maya\Maya2015\scriptLib\bin;C:\ffmpeg;C:\radare2;C:\MSVsCode\bin;C:\Users\davidm\go\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\I
DE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja

PS C:\dev\msys64\home\davidm\tonic> start .\target\release\tls-server.exe
PS C:\dev\msys64\home\davidm\tonic> start .\target\release\tls-client.exe

@kjeremy
Copy link
Author

kjeremy commented Oct 8, 2019

This continues to work for me today so I think I will close the issue.

@kjeremy kjeremy closed this as completed Oct 8, 2019
brentalanmiller pushed a commit to brentalanmiller/tonic that referenced this issue Oct 6, 2023
hyperium#34 properly implement TLS-1.3 shutdown behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

4 participants