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

remote build blocked & distcc does not work #5174

Closed
zeroxer opened this issue Jun 1, 2024 · 7 comments
Closed

remote build blocked & distcc does not work #5174

zeroxer opened this issue Jun 1, 2024 · 7 comments
Labels
Milestone

Comments

@zeroxer
Copy link

zeroxer commented Jun 1, 2024

Xmake Version

2.9.2

Operating System Version and Architecture

Windows 10, x64

Describe Bug

Remote build blocked, my server is Win10 with VS2022 and my client is Win10 with VS2022.
Xmake's hello project build and run without any error both on client and server. But remote build dosen't work.

Expected Behavior

compile success on remote server

Project Configuration

xmake create hello

Additional Information and Error Logs

  • hello world project made by xmake create hello
  • connect server by xmake service --connect -vD
  • run xmake in client, get output log, blocking in remote_build_client, no error and compile log in server
# Client: Win10 MSVC
D:\test\hello
λ xmake -rvD
<remote_build_client>: run 'xmake -rvD' in 10.10.85.209:9693 ..
# Server: Win10 MSVC
λ xmake service -vvvvD
<remote_build_server>: listening 0.0.0.0:9691 ..
<remote_cache_server>: listening 0.0.0.0:9692 ..
<distcc_build_server>: listening 0.0.0.0:9693 ..
<distcc_build_server>: <socket: tcp4/948.0>: session connected
<distcc_build_server>: <socket: tcp4/948.0>: <session 1973af89>: on handle message(5)
{
  session_id = "1973af89",
  token = "ba70650cf0c14b45e12aabd29f83800a",
  code = 5,
  argv = {
    "-rvD"
  },
  program = "xmake"
}

<distcc_build_server>: <socket: tcp4/948.0>: <session 1973af89>: send ok
@zeroxer zeroxer added the bug label Jun 1, 2024
@waruqi
Copy link
Member

waruqi commented Jun 1, 2024

It works for me. But I don't know why you're connecting to the distcc server here, it's a distributed compilation and xmake service --connect shouldn't be trying to connect to it by default.

You can try to remove .xmake and build directory and connect it again.

@zeroxer
Copy link
Author

zeroxer commented Jun 1, 2024

Sorry for the mistake, my remote build port is wrong. remote build works now.

@zeroxer
Copy link
Author

zeroxer commented Jun 1, 2024

The distcc is what i truly want to use, remote build is just a test.

But another question, when i connect to distcc server.
the distcc server dosn't give eny log after run xmake.

but i got xmake build utitly keep running for long time.
image
the log pause at

D:\test\hello
λ xmake -vv
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.39.33523
checking for zig ... no
checking for zig ... no
checking for nim ... ok
checking for link.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
# blocking here

no log on server side.

@zeroxer zeroxer changed the title Remote build blocked remote build blocked & distcc does not work Jun 1, 2024
@waruqi
Copy link
Member

waruqi commented Jun 2, 2024

The distcc server was not connected successfully. Maybe the ip and port are not correct.

@zeroxer
Copy link
Author

zeroxer commented Jun 2, 2024

Ip and port is right, because it was conneted.

I use localhost/127.0.0.1 to test. It doesn't work either.

Connect Step

Client

λ xmake service --connect --distcc -vD
<client>: connect 127.0.0.1:9693 ..
{
  token = "f2761fb3569c3e5e423658e8c60d1498",
  status = true,
  njob = 18,
  code = 1,
  ncpu = 16,
  session_id = "691419ee",
  xmakever = "2.9.2"
}

<client>: 127.0.0.1:9693 connected!

Server

λ xmake service --distcc -vD
<distcc_build_server>: listening 0.0.0.0:9693 ..
<distcc_build_server>: <socket: tcp4/980.0>: session connected
<distcc_build_server>: <socket: tcp4/980.0>: <session 691419ee>: on handle message(1)
{ 
  session_id = "691419ee",
  code = 1,
  xmakever = "2.9.2",
  token = "f2761fb3569c3e5e423658e8c60d1498" 
}

<distcc_build_server>: <socket: tcp4/980.0>: <session 691419ee>: send ok
<distcc_build_server>: <socket: tcp4/980.0>: session end

Compile Step

Client

  • Blocking
D:\test\hello
λ xmake
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.39.33523

Server

  • no new log ouput.

@waruqi waruqi mentioned this issue Jun 4, 2024
@waruqi
Copy link
Member

waruqi commented Jun 4, 2024

try this patch. #5189

xmake update -s github:xmake-io/xmake#distcc

@waruqi waruqi added this to the v2.9.3 milestone Jun 4, 2024
@zeroxer
Copy link
Author

zeroxer commented Jun 4, 2024

It works now. Thanks.

λ xmake
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.39.33523
[ 92%]: compiling.release src\bar.cpp
[ 92%]: compiling.release src\foo.cpp
[ 92%]: compiling.release src\main.cpp
[ 92%]: compiling.release test\11.cpp 
[ 92%]: compiling.release test\14.cpp
[ 92%]: compiling.release test\15.cpp
[ 92%]: compiling.release test\11111.cpp
[ 92%]: compiling.release test\16.cpp
[ 92%]: compiling.release test\10.cpp
[ 92%]: compiling.release test\12.cpp
[ 92%]: compiling.release test\13.cpp
[ 92%]: distc compiling.release test\44444.cpp
[ 92%]: compiling.release test\17.cpp
[ 92%]: distc compiling.release test\6.cpp
[ 92%]: distc compiling.release test\8.cpp
[ 92%]: distc compiling.release test\7.cpp
[ 92%]: compiling.release test\22222.cpp
[ 92%]: compiling.release test\18.cpp
[ 92%]: distc compiling.release test\55555.cpp
[ 92%]: compiling.release test\33333.cpp
[ 92%]: compiling.release test\20.cpp
[ 92%]: distc compiling.release test\9.cpp
[ 96%]: linking.release hello.exe
[100%]: build ok, spent 9.438s

@zeroxer zeroxer closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants