Coder Social home page Coder Social logo

Cannot build on windows about tonic HOT 8 CLOSED

hyperium avatar hyperium commented on June 21, 2024
Cannot build on windows

from tonic.

Comments (8)

steffengy avatar steffengy commented on June 21, 2024 1

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

from tonic.

LucioFranco avatar LucioFranco commented on June 21, 2024

@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.

from tonic.

kjeremy avatar kjeremy commented on June 21, 2024

@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)

from tonic.

LucioFranco avatar LucioFranco commented on June 21, 2024

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

from tonic.

kjeremy avatar kjeremy commented on June 21, 2024

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.

from tonic.

LucioFranco avatar LucioFranco commented on June 21, 2024

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

from tonic.

omac777 avatar omac777 commented on June 21, 2024

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

from tonic.

kjeremy avatar kjeremy commented on June 21, 2024

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

from tonic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.