Samsung / netcoredbg

NetCoreDbg is a managed code debugger with MI interface for CoreCLR.
MIT License
800 stars 103 forks source link

Failure to build tag 2.2.0-974 on Manjaro/Arch Linux #122

Closed KiLLeRRaT closed 1 year ago

KiLLeRRaT commented 1 year ago

Currently running on Manjaro Linux, and the latest version (tag: 2.2.0-974) is failing to build:

[ 45%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/managedcallback.cpp.o
[ 46%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/manageddebugger.cpp.o
[ 47%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/threads.cpp.o
[ 48%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/stepper_async.cpp.o
[ 50%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/stepper_simple.cpp.o
[ 51%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/steppers.cpp.o
[ 52%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/valueprint.cpp.o
[ 53%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/variables.cpp.o
[ 55%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/waitpid.cpp.o
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:23:9: error: use of undeclared identifier 'abort'
        abort();
        ^
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:78:13: error: use of undeclared identifier 'WIFEXITED'
        if (WIFEXITED(*status))
            ^
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:80:56: error: use of undeclared identifier 'WEXITSTATUS'
            netcoredbg::hook::waitpid.SetExitCode(pid, WEXITSTATUS(*status));
                                                       ^
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:82:18: error: use of undeclared identifier 'WIFSIGNALED'
        else if (WIFSIGNALED(*status))
                 ^
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:84:122: error: use of undeclared identifier 'WTERMSIG'
            LOGW("Process terminated without exiting; can't get exit code. Killed by signal %d. Assuming EXIT_FAILURE.", WTERMSIG(*status));
                                                                                                                         ^
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:84:122: error: use of undeclared identifier 'WTERMSIG'
/home/albert/source-github/netcoredbg/src/debugger/waitpid.cpp:85:56: error: use of undeclared identifier 'EXIT_FAILURE'
            netcoredbg::hook::waitpid.SetExitCode(pid, EXIT_FAILURE);
                                                       ^
7 errors generated.
make[2]: *** [src/CMakeFiles/netcoredbg.dir/build.make:414: src/CMakeFiles/netcoredbg.dir/debugger/waitpid.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:229: src/CMakeFiles/netcoredbg.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

This is mentioned on the ARCH AUR page too: https://aur.archlinux.org/packages/netcoredbg

Is there something that we need to do to get this building again? I tried on older tags, e.g. 2.2.0-945, but that fails due to:

mkdir build && cd build && CC=clang CXX=clang++ cmake .. && make && make install
-- The C compiler identification is Clang 15.0.7
-- The CXX compiler identification is Clang 15.0.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Detected Linux x86_64
-- Found Git: /usr/bin/git (found version "2.40.1")
fatal: couldn't find remote ref release/3.1
CMake Error at fetchdeps.cmake:15 (message):
  Fatal error when fetching release/3.1 branch
Call Stack (most recent call first):
  CMakeLists.txt:42 (include)

More details on the OS version:

OS: Manjaro Linux x86_64
Host: MS-7C56 1.0
Kernel: 6.2.16-2-MANJARO
Shell: zsh 5.9
WM: i3
Terminal: tmux
CPU: AMD Ryzen 7 5800X (16) @ 3.800GHz
GPU: NVIDIA GeForce GTX 1050 3GB
Memory: 33978MiB / 64228MiB
viewizard commented 1 year ago

Looks like some headers related issue with new gcc/clang, could you please try with added after this line https://github.com/Samsung/netcoredbg/blob/db69338cf1606d8d327de0eaaf1694d8463af135/src/debugger/waitpid.cpp#L8

#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>

Upd.: added sys/types.h.

KiLLeRRaT commented 1 year ago

Hi @viewizard that seems to have done the trick! Thanks for helping out.

Will you make the PR or did you need me to make the PR for this?

Regards,

viewizard commented 1 year ago

Will you make the PR or did you need me to make the PR for this?

I will add this changes in our internal repo, will be in public repo with next sync.

KiLLeRRaT commented 1 year ago

Will you make the PR or did you need me to make the PR for this?

I will add this changes in our internal repo, will be in public repo with next sync.

Excellent, thanks for that. I will now close this and call it done :)