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

Build failing on macOS #27

Closed
laher opened this issue Sep 23, 2023 · 14 comments
Closed

Build failing on macOS #27

laher opened this issue Sep 23, 2023 · 14 comments

Comments

@laher
Copy link

laher commented Sep 23, 2023

This is on a Silicon mac (Ventura 13.5.2).

Build dependencies as follows:

$ brew list --versions |egrep '(cmake|ninja)'
cmake 3.27.6
ninja 1.11.1
$ xcodebuild -version 
Xcode 15.0
Build version 15A240d

The Ninja command succeeded (cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -S . -B build).

Then:

$ cmake --build build

[5/218] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o
FAILED: libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DCEF_USE_SANDBOX -DWRAPPING_CEF_SHARED -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I/Users/xxx/dl/awrit/build/_deps/cef_minimal-src -O3 -DNDEBUG -std=gnu++20 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=10.13 -fno-strict-aliasing -fstack-protector -funwind-tables -fvisibility=hidden -Wall -Werror -Wextra -Wendif-labels -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -mmacosx-version-min=10.13 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fobjc-call-cxx-cdtors -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wsign-compare -Wno-undefined-var-template -O3 -MD -MT libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -MF libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o.d -o libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -c /Users/xxx/dl/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc
In file included from /Users/xxx/dl/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc:5:
In file included from /Users/xxx/dl/awrit/build/_deps/cef_minimal-src/include/base/cef_ref_counted.h:53:
/Users/xxx/dl/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:7: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);
      ^
/Users/xxx/dl/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:32: error: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);

I tried upgrading CEF_VERSION in CMakeLists.txt and following my nose. It seemed to get a bit further but I soon gave up once there weren't any more helpful messages.

@chase
Copy link
Owner

chase commented Sep 23, 2023

Bumping CEF or downgrading to an older SDK are your two options. If after upgrading CEF to the latest it still provides that exact same log, assume you have to use an older SDK. That error is caused by Apple deprecating something CEF uses.

If you're unfamiliar with how to use multiple versions of the SDK, the least intrusive way is to download Xcode 14.3 then before you run any commands, use export DEVELOPER_DIR=/Applications/Xcode14.3.app/Contents/Developer where /Applications/Xcode14.3.app is the path to the extracted Xcode.

@laher
Copy link
Author

laher commented Sep 23, 2023 via email

@blueneogeo
Copy link

same issue on M1 mac. perhaps for the meantime provide a release build that was built on an older platform if possible?

@chase
Copy link
Owner

chase commented Nov 3, 2023

I have an M2 with macOS 12, it builds fine. The SDK needs to be set to Xcode 14.3.1 with: export DEVELOPER_DIR=/Applications/Xcode14.3.1.app/Contents/Developer. Sonoma breaks a lot of things in general, so that might be a part of it.

same issue on M1 mac. perhaps for the meantime provide a release build that was built on an older platform if possible?

Not possible at the moment. You'll have to wait until Q1 2024.
actions/runner-images#8439 (comment)

Will M1 runners be available for free for public projects? I just tried to use it and got:

The job was not started because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings.

This will happen but the date is TBD. GitHub is responsible for the provisioning of all Mac hardware in Azure data centers. Our team is ramping up capacity in preparation for GA in Jan-Mar 2024 timeframe. Once we reach the GA milestone, we will start working on additional plans to support open source, along with new macOS runners.

@blueneogeo
Copy link

Thank you for checking and the response.

@VSuryaPrashanth
Copy link

Thanks, I got it working using that method

@blueneogeo
Copy link

How did you guys do this? I tried downloading 14.3.1 from Apple Developer and set export DEVELOPER_DIR=/Applications/Xcode14.3.1.app/Contents/Developer but I still get these errors when trying to build:

❯ cmake --build build
[1/211] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o
FAILED: libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DCEF_USE_SANDBOX -DWRAPPING_CEF_SHARED -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I/Users/christian/development/awrit/build/_deps/cef_minimal-src -O3 -DNDEBUG -std=gnu++20 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=10.13 -fno-strict-aliasing -fstack-protector -funwind-tables -fvisibility=hidden -Wall -Werror -Wextra -Wendif-labels -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -mmacosx-version-min=10.13 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fobjc-call-cxx-cdtors -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wsign-compare -Wno-undefined-var-template -O3 -MD -MT libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -MF libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o.d -o libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -c /Users/christian/development/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc
In file included from /Users/christian/development/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc:5:
In file included from /Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_ref_counted.h:53:
/Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:7: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);
      ^
/Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:32: error: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);

@chase
Copy link
Owner

chase commented Nov 30, 2023

How did you guys do this? I tried downloading 14.3.1 from Apple Developer and set export DEVELOPER_DIR=/Applications/Xcode14.3.1.app/Contents/Developer but I still get these errors when trying to build:

❯ cmake --build build
[1/211] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o
FAILED: libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DCEF_USE_SANDBOX -DWRAPPING_CEF_SHARED -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -I/Users/christian/development/awrit/build/_deps/cef_minimal-src -O3 -DNDEBUG -std=gnu++20 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=10.13 -fno-strict-aliasing -fstack-protector -funwind-tables -fvisibility=hidden -Wall -Werror -Wextra -Wendif-labels -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -mmacosx-version-min=10.13 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fobjc-call-cxx-cdtors -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wsign-compare -Wno-undefined-var-template -O3 -MD -MT libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -MF libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o.d -o libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/base/cef_ref_counted.cc.o -c /Users/christian/development/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc
In file included from /Users/christian/development/awrit/build/_deps/cef_minimal-src/libcef_dll/base/cef_ref_counted.cc:5:
In file included from /Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_ref_counted.h:53:
/Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:7: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);
      ^
/Users/christian/development/awrit/build/_deps/cef_minimal-src/include/base/cef_template_util.h:176:32: error: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Werror,-Wdeprecated-builtins]
      __has_trivial_copy(T) && __has_trivial_destructor(T);

From that log, it seems like you either did not install 14.3.1, did not rename it to Xcode14.3.1, or did not export immediately before the cmake commands.

/Applications/Xcode.app/Contents/Developer is the developer directory it is using. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk is not the correct SDK

@blueneogeo
Copy link

I did rename it, and did the export, however I cannot run XCode 14.3.1, and that may be the reason that it was not installed. Trying to run it, I get this error:

image

@chase
Copy link
Owner

chase commented Nov 30, 2023

I did rename it, and did the export, however I cannot run XCode 14.3.1, and that may be the reason that it was not installed. Trying to run it, I get this error:

You don't need to open it. You could try using xcode-select --switch /Applications/Xcode14.3.1.app, although that's what DEVELOPER_DIR does in a more temporary manner.

@blueneogeo
Copy link

It worked after xcode-select and clearing and rebuilding my build directory. Thank you for the assist.

@blueneogeo

This comment was marked as off-topic.

@blueneogeo

This comment was marked as off-topic.

@chase
Copy link
Owner

chase commented Nov 30, 2023

As an aside, as it does work and I realise this was written mostly for Kitty, on Wezterm

Yes, it was written for Kitty. Wezterm is not supported by default, last I checked you have to enable Kitty image protocol support and Kitty keyboard escape protocol support: https://wezfurlong.org/wezterm/config/lua/config/enable_kitty_keyboard.html?h=kitty

However that may break things in other software for Wezterm.

I don't really have time to maintain this project for Wezterm, since it's not the terminal I use. If you do get it working using whatever image protocol and keyboard protocol is supported in Wezterm, feel free to contribute a PR.

Repository owner locked as resolved and limited conversation to collaborators Nov 30, 2023
@chase chase closed this as completed Jan 1, 2024
@chase chase pinned this issue Jan 1, 2024
@chase chase changed the title build failing on Mac. cef_template_util.h error: builtin __has_trivial_copy is deprecated; use ... Build failing on macOS Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants