Samsung / netcoredbg

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

Fail to build on macOS 11.6 xcode 13.0 all requirement fulfilled #70

Open EGYPHARAOH opened 2 years ago

EGYPHARAOH commented 2 years ago

it gives the following error [ 59%] Building CXX object src/CMakeFiles/netcoredbg.dir/debugger/waitpid.cpp.o /Users/admin/Documents/repos/netcoredbg-1.2.0-825/src/debugger/waitpid.cpp:71:18: error: exception specification in declaration does not match previous declaration extern "C" pid_t waitpid(pid_t pid, int status, int options) noexcept ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/sys/wait.h:249:9: note: previous declaration is here pid_t waitpid(pid_t, int , int) __DARWIN_ALIAS_C(waitpid); ^ 1 error generated. make[2]: [src/CMakeFiles/netcoredbg.dir/debugger/waitpid.cpp.o] Error 1 make[1]: [src/CMakeFiles/netcoredbg.dir/all] Error 2 make: *** [all] Error 2 admin@admins-MacBook-Pro build %

alpencolt commented 2 years ago

@EGYPHARAOH looks Apple changed signature of waitpid in latest SDK. We cannot check it right now but Mac build worked on older versions of SDK and XCode, try to switch to them.

If it will not help need to change declaration in src/debugger/waitpid.cpp to:

pid_t waitpid(pid_t, int *, int) __DARWIN_ALIAS_C(waitpid);

Additionally including of bsd/sys/cdefs.h header with __DARWIN_ALIAS_C might be required. https://opensource.apple.com/source/xnu/xnu-1228.15.4/bsd/sys/cdefs.h

matthewblott commented 2 years ago

I'm having an issue building on macOS too. My machine has an M1 processor so I don't know if that's the issue:

dotnet-install: Temporary zip file /var/folders/ch/v9k5sf_n15d6c5nwgqbmjrqm0000gn/T//dotnet.S409LnFm7 was removed
dotnet_install: Error: Could not find `.NET Core SDK` with version = 5.0.403
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
CMake Error at fetchdeps.cmake:63 (message):
  Fatal error when installing dotnet
Call Stack (most recent call first):
  CMakeLists.txt:42 (include)

-- Configuring incomplete, errors occurred!
See also "/Users/Matt/Dev/exercises/dotnet/netcoredbg/build/CMakeFiles/CMakeOutput.log".
See also "/Users/Matt/Dev/exercises/dotnet/netcoredbg/build/CMakeFiles/CMakeError.log".

The error message is a bit cryptic to me. I have an orthodox install of .NET 5.0 (installed via the main package from the vendor's website).

I had a read through the logs but there wasn't anything there that made sense to me. CMakeError.log referenced Xcode a lot and doesn't relate to the main message. CMakeOutput.log contained very little. I did try an older OSX binary from the releases page which I could at least run but it's out of sync with the documentation on the home page and it's not usable. Any help appreciated :-)

ashaurtaev commented 2 years ago

@matthewblott Your issue is caused by temporary problems on Microsoft Azure servers when downloading the NET Core SDK, there are two ways to solve the problem 1) Please try to build netcoredbg again using cmake 2) There is an alternative path - you can manually download CoreCLR(git clone --progress --depth 1 https://github.com/dotnet/runtime -b release/6.0 then mv ./runtime/src/coreclr ./coreclr_6.0) and dotnet SDK(curl -sSL "https://dot.net/v1/dotnet-install.sh" | bash /dev/stdin --channel 6.0 --install-dir ./dotnet_6.0 --verbose), then specify the paths for cmake, it will look something like this CC=clang CXX=clang++ cmake .. -DDOTNET_DIR=/path/to/dotnet/dir/ -DCORECLR_DIR=/path/to/coreclr/dir/. After configuration has finished, you can build netcoredbg

I hope these ways will solve your problem.