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

Building with a skia renderer fails with a git error on Intel Mac #5043

Closed
mitioshi opened this issue Apr 11, 2024 · 8 comments
Closed

Building with a skia renderer fails with a git error on Intel Mac #5043

mitioshi opened this issue Apr 11, 2024 · 8 comments
Labels
a:documentation Improvements or additions to documentation (infrastructure and text itself) (mS,bT) enhancement New feature or request

Comments

@mitioshi
Copy link
Contributor

Building the Rust template project on Intel Mac with the following Cargo.toml

[dependencies]
slint = { version = "1.5.1", default-features = false, features = [
    "std",
    "renderer-skia",
    "backend-winit",
] }

[build-dependencies]
slint-build = "1.5.1"

I receive the following error:

  ...
  [1485/1490] compile ../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.71.0/skia/third_party/externals/icu/source/i18n/zonemeta.cpp
  [1486/1490] assemble gen/third_party/icu/icudtl_dat.S
  [1487/1490] link libicu.a
  [1488/1490] link libskunicode.a
  [1489/1490] link libskshaper.a
  [1490/1490] link libskparagraph.a
  cargo:rerun-if-changed=src/bindings.cpp
  cargo:rerun-if-changed=src/gl.cpp
  cargo:rerun-if-changed=src/metal.cpp
  cargo:rerun-if-changed=src/gpu.cpp
  cargo:rerun-if-changed=src/shaper.cpp
  cargo:rerun-if-changed=src/paragraph.cpp
  cargo:rerun-if-changed=/Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.71.0/skia/include
  HOST: x86_64-apple-darwin
  cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
  COMPILING BINDINGS: ["src/bindings.cpp", "src/gl.cpp", "src/metal.cpp", "src/gpu.cpp", "src/shaper.cpp", "src/paragraph.cpp"]
    DEFINES: NDEBUG= SK_ENABLE_PRECOMPILE= SK_ASSUME_GL=1 SK_GANESH= SK_DISABLE_TRACING= SK_USE_PERFETTO= SK_ENABLE_API_AVAILABLE= SK_GAMMA_APPLY_TO_A8= SK_ENABLE_AVX512_OPTS= SKIA_IMPLEMENTATION=1 SK_TYPEFACE_FACTORY_CORETEXT= SK_FONTMGR_CORETEXT_AVAILABLE= SK_GL= SK_METAL= SK_SUPPORT_PDF= SK_CODEC_DECODES_JPEG= SK_CODEC_DECODES_PNG= SK_HAS_WUFFS_LIBRARY= SK_XML= SKSHAPER_IMPLEMENTATION=1 SK_SHAPER_PRIMITIVE_AVAILABLE= SK_SHAPER_CORETEXT_AVAILABLE= SK_SHAPER_HARFBUZZ_AVAILABLE= SK_SHAPER_UNICODE_AVAILABLE= SK_UNICODE_AVAILABLE= SK_UNICODE_ICU_IMPLEMENTATION= SK_ENABLE_PARAGRAPH= SKUNICODE_IMPLEMENTATION=1 U_SHOW_CPLUSPLUS_API=0 U_USING_ICU_NAMESPACE=0 U_DISABLE_RENAMING= SK_USING_THIRD_PARTY_ICU= U_COMMON_IMPLEMENTATION= U_STATIC_IMPLEMENTATION= U_ENABLE_DYLOAD=0 U_I18N_IMPLEMENTATION= _XOPEN_SOURCE=0
    ARGS: -std=c++17 -fno-rtti -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
  cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
  cargo:warning=xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
  cargo:warning=macOS deployment target (10.7) too low, it will be increased
  cargo:warning=In file included from src/bindings.cpp:91:
  cargo:warning=/Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.71.0/skia/include/effects/SkImageFilters.h:72:49: error: 'value' is unavailable: introduced in macOS 10.13
  cargo:warning=                   (!this->has_value() || this->value() == *o);
  cargo:warning=                                                ^
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/optional:992:33: note: 'value' has been explicitly marked unavailable here
  cargo:warning=    constexpr value_type const& value() const&
  cargo:warning=                                ^
  cargo:warning=1 error generated.

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git


  error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-apple-darwin" "-mmacosx-version-min=10.7" "-I" "/Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.71.0/skia" "-Wall" "-Wextra" "-std=c++17" "-fno-rtti" "-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" "-DNDEBUG=" "-DSK_ENABLE_PRECOMPILE=" "-DSK_ASSUME_GL=1" "-DSK_GANESH=" "-DSK_DISABLE_TRACING=" "-DSK_USE_PERFETTO=" "-DSK_ENABLE_API_AVAILABLE=" "-DSK_GAMMA_APPLY_TO_A8=" "-DSK_ENABLE_AVX512_OPTS=" "-DSKIA_IMPLEMENTATION=1" "-DSK_TYPEFACE_FACTORY_CORETEXT=" "-DSK_FONTMGR_CORETEXT_AVAILABLE=" "-DSK_GL=" "-DSK_METAL=" "-DSK_SUPPORT_PDF=" "-DSK_CODEC_DECODES_JPEG=" "-DSK_CODEC_DECODES_PNG=" "-DSK_HAS_WUFFS_LIBRARY=" "-DSK_XML=" "-DSKSHAPER_IMPLEMENTATION=1" "-DSK_SHAPER_PRIMITIVE_AVAILABLE=" "-DSK_SHAPER_CORETEXT_AVAILABLE=" "-DSK_SHAPER_HARFBUZZ_AVAILABLE=" "-DSK_SHAPER_UNICODE_AVAILABLE=" "-DSK_UNICODE_AVAILABLE=" "-DSK_UNICODE_ICU_IMPLEMENTATION=" "-DSK_ENABLE_PARAGRAPH=" "-DSKUNICODE_IMPLEMENTATION=1" "-DU_SHOW_CPLUSPLUS_API=0" "-DU_USING_ICU_NAMESPACE=0" "-DU_DISABLE_RENAMING=" "-DSK_USING_THIRD_PARTY_ICU=" "-DU_COMMON_IMPLEMENTATION=" "-DU_STATIC_IMPLEMENTATION=" "-DU_ENABLE_DYLOAD=0" "-DU_I18N_IMPLEMENTATION=" "-D_XOPEN_SOURCE=0" "-o" "/Users/user/src/my-project/target/debug/build/skia-bindings-5e2d6c7d07d6df8a/out/skia/2e40c9e35e9506f4-bindings.o" "-c" "src/bindings.cpp" with args c++ did not execute successfully (status code exit status: 1).

Skia is apparently being built here due to the relevant prebuilt binary not being available in skia-binaries

@tronical
Copy link
Member

tronical commented Apr 12, 2024

Could you describe your build environment a little? It looks like there's an issue with the Xcode installation. Note the following two error messages from your log:

xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

What does xcrun --show-sdk-path --sdk macosx show for you? Does the directory it prints exist and have an SDK installed?

Perhaps you may want to switch to the default SDK using sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer ?

@tronical tronical added the needs info Further information from the reporter is requested label Apr 12, 2024
@mitioshi
Copy link
Contributor Author

@tronical Running xcrun --show-sdk-path --sdk macosx outputs /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk. It does have an sdk installed.
As for ninja, I installed it from homebrew

@tronical
Copy link
Member

Thanks for the quick response. Could you also try running xcrun --show-sdk-platform-version?

@mitioshi
Copy link
Contributor Author

@tronical Sure. Here's what it prints

▶ xcrun --show-sdk-platform-version
xcrun: error: unable to lookup item 'PlatformVersion' from command line tools installation
xcrun: error: unable to lookup item 'PlatformVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

@tronical
Copy link
Member

Ok, and that's the source of the build issue you're seeing. This command should not produce the error but print a version. It looks like the macOS SDK installed in /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk on your machine is incomplete somehow (or corrupted).

@tronical
Copy link
Member

Could you run ls -ld /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk? I wonder what your MacOSX.sdk symlink points to. It looks like 10.7 maybe? Do you have an explicit macOS deployment target configured?

@mitioshi
Copy link
Contributor Author

Do you have an explicit macOS deployment target configured?

I don't. Here's where the symlink points:

▶ ls -ld /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
lrwxr-xr-x  1 root  wheel  14 Feb  7 12:46 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -> MacOSX14.2.sdk
▶ realpath /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk

@tronical
Copy link
Member

Thanks. I can reproduce this. It seems that xcrun --show-sdk-path --sdk macosx is not supported with the command line tools alone (see also rust-lang/cc-rs#1001). If you run sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer the issue should be resolved and the build should work.

I'll add this to the known issues docs for the Skia renderer build.

@tronical tronical added a:documentation Improvements or additions to documentation (infrastructure and text itself) (mS,bT) enhancement New feature or request and removed needs info Further information from the reporter is requested labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:documentation Improvements or additions to documentation (infrastructure and text itself) (mS,bT) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants