sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

Compile error on Mac OS 10.14 for 0.4.9

Open jracle opened this issue 3 years ago • 3 comments

Description

Compile error on Mac OS 10.14. It apparears SDKROOT returns empty string (FYI).

When does the problem happen

  • [ x] During build
  • [ ] During run-time
  • [ ] When capturing a hard crash

Environment

  • OS: Mac OS 10.4 (Mojave), Xcode 11.4 (AppleClang 11.0.3.11030032)

Steps To Reproduce

compile on Mojave

Log output

...clang: warning: no such sysroot directory: '/Users/builder/builds/F7Ri9TW5/0/xxx/yyy/build/other/sentry/sentry-native/crashpad_build/util/DKROOT' [-Wmissing-sysroot] ....crashpad/util/mach/child_port.defs:15:10: fatal error: 'mach/mach_types.defs' file not found #include <mach/mach_types.defs>

jracle avatar Apr 26 '21 10:04 jracle

export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

That is mentioned in the readme. Otherwise you need to correctly activate the xcode build tools, that is always a bit confusing.

Swatinem avatar Apr 27 '21 09:04 Swatinem

There is an issue with this solution. SDKROOT is an environment variable and injected to the cmake_add_custom_command. On some versions of CMake, this might not work properly, because they internally use make to execute commands (for example cmake 3.18) which requires escaping of $ with additional $. The more portable solution would be, at least, to expand this env variable in CMake file using $ENV{SDKROOT} and pass the actual value.

Dev-vlad avatar May 27 '21 05:05 Dev-vlad

Update of CMake to the latest version (3.20 for example) also fixes this issue, because it is no longer uses make, but it does not solve backward compatibility with other CMake versions.

Dev-vlad avatar May 27 '21 05:05 Dev-vlad