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

Failed to build Sentry Native SDK #157

Closed
CharlotteFallices opened this issue Jun 21, 2022 · 3 comments
Closed

Failed to build Sentry Native SDK #157

CharlotteFallices opened this issue Jun 21, 2022 · 3 comments
Labels

Comments

@CharlotteFallices
Copy link

CharlotteFallices commented Jun 21, 2022

Just clone and build with cmake -P scripts/build.cmake:

ninja: error: loading 'build.ninja': No such file or directory
CMake Error at scripts/build.cmake:41 (message):
  Building failed with 1:
  ./dependencies/sentry-native/out/darwin/clang/ub/debug
Call Stack (most recent call first):
  scripts/build.cmake:345 (execute_build)
  scripts/build.cmake:575 (compile_sentry_native)
  scripts/build.cmake:700 (compile_all_repositories)

*There will be no problems if manually build the Sentry Native SDK:

cd dependencies/sentry-native
cmake -B xcodebuild -GXcode -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
xcodebuild build -project xcodebuild/Sentry-Native.xcodeproj
@CharlotteFallices
Copy link
Author

CharlotteFallices commented Jun 21, 2022

I checked the log ./dependencies/sentry-native/out/darwin/clang/ub/debug/CMakeFiles/CMakeError.log and got:

  1 Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
  2 Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c    c
  3 Build flags:
  4 Id flags:
  5 
  6 The output was:
  7 1
  8 ld: library not found for -lSystem
  9 clang: error: linker command failed with exit code 1 (use -v to see invocation)
 10 
 11 
 12 Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
 13 Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c    ++
 14 Build flags: -std=c++14
 15 Id flags:
 16 
 17 The output was:
 18 1
 19 ld: library not found for -lc++
 20 clang: error: linker command failed with exit code 1 (use -v to see invocation)

-lx This option tells the linker to search for libx.dylib or libx.a in the library search path. If string x is of the form y.o, then that file is searched for in the same places, but without prepending lib or appending .a or .dylib to the filename.
-Ldir Add dir to the list of directories in which to search for libraries. Directories specified with -L are searched in the order they appear on the command line and before the default search path. In Xcode4 and later, there can be a space between the -L and directory.

As for the manpage, -lSystem means a lib called libSystem and I found it in /Library/Developer/CommandLineTools/SDKs/MACOSX.sdk/usr/lib, so it should be:

ld -lSystem -L "/Library/Developer/CommandLineTools/SDKs/MACOSX.sdk/usr/lib"

But I don't know anything about cmake file so that I can't change how it work :(

@hkrn
Copy link
Owner

hkrn commented Jun 22, 2022

Did you run following command on top directory?

git submodule update --init --recursive

Because sentry-native requires recursive submodule checkout, building sentry-native may fail without recursive submodule checkout.

On the other hand, sentry-native is only needed for crash reports and can be disabled by setting the following environment variable. If this does not work, please try that.

export NANOEM_DISABLE_BUILD_SENTRY_NATIVE=1

@stale
Copy link

stale bot commented Aug 30, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Aug 30, 2022
@stale stale bot closed this as completed Sep 7, 2022
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