Building Branch 2924 fails on Mac with Xcode 7.3.1

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Fri Mar 03, 2017 3:01 pm

I'm trying to build Branch 2924 commit 97389a9 on macOS 10.12.3 from source using the automated process, and I don't understand the error I'm seeing. Everything is downloading and the failure is occurring during the Ninja builds. I'm also using Xode 7.3.1 with the 10.10 SDK installed. I have 300GB free disk space, and 16GB of RAM installed.

My build script looks like this:

Code: Select all
#!/bin/sh

BUILD_ROOT="/path/to/cef_source_3.2924.1575.g97389a9"
XCODE731_PATH="/Applications/Xcode7.3.1/Xcode.app/Contents/Developer"

sudo xcode-select -s "$XCODE731_PATH"

export CEF_USE_GN=1
export GN_DEFINES="is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome"
export CEF_ARCHIVE_FORMAT=tar.bz2

# Target: CEF 3.2924.1575.g97389a9 / Chromium 56.0.2924.76
python "$BUILD_ROOT/automate-git.py" --download-dir="$BUILD_ROOT" --branch=2924 --checkout=97389a9 --x64-build

and the errors I'm seeing look like this:

Code: Select all
...

FAILED: obj/cef/cefclient_executable/cefclient_mac.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/cef/cefclient_executable/cefclient_mac.o.d -DV8_DEPRECATION_WARNINGS -DENABLE_NOTIFICATIONS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DDCHECK_ALWAYS_ON=1 -DNO_TCMALLOC -DUSE_EXTERNAL_POPUP_MENU=1 -DENABLE_WEBRTC=1 -DDISABLE_NACL -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=284979-2 -DCR_XCODE_VERSION=0731 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DTOOLKIT_VIEWS=1 -I../.. -Igen -I../../third_party/khronos -I../../gpu -I../../third_party/libwebp -I../../cef -Iincludes -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -arch x86_64 -Wall -Werror -Wextra -Wpartial-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -O2 -gdwarf-2 -fno-standalone-debug -isysroot /Applications/Xcode7.3.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.9 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -fno-threadsafe-statics -fvisibility-inlines-hidden -std=c++11 -stdlib=libc++ -fobjc-call-cxx-cdtors -Wobjc-missing-property-synthesis -fno-rtti -fno-exceptions -c ../../cef/tests/cefclient/cefclient_mac.mm -o obj/cef/cefclient_executable/cefclient_mac.o
../../cef/tests/cefclient/cefclient_mac.mm:22:29: error: property 'mainMenu' not found on object of type 'id'
  NSMenu* main_menu = NSApp.mainMenu;
                            ^
1 error generated.

...

ninja: build stopped: subcommand failed.

...

-------- Running "ninja -C out/Debug_GN_x64 cefclient" in "/path/to/cef_source_3.2924.1575.g97389a9/chromium/src"...
Traceback (most recent call last):
  File "/path/to/cef_source_3.2924.1575.g97389a9/automate-git.py", line 980, in <module>
    if options.buildlogfile else None)
  File "/path/to/cef_source_3.2924.1575.g97389a9/automate-git.py", line 55, in run
    shell=(sys.platform == 'win32'))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', '-C', 'out/Debug_GN_x64', 'cefclient']' returned non-zero exit status 1

I located the following post:

http://magpcss.org/ceforum/viewtopic.php?f=6&t=14954&p=34065&hilit=NSApp.mainMenu#p34065

which seems to indicate that changing "NSApp.mainMenu" to "[[NSApplication sharedApplication] mainMenu]" in cefclient_mac.mm might fix part of the problem, but that was for a different version of Xcode, and was based on the Spotify distribution (while I am building from source). For the rest of the errors, I've seen numerous similar cases in the forum, but none seem to apply to my situation.

Any idea what the problem is, or on possible solutions? Thanks for any help you can provide.
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby magreenblatt » Fri Mar 03, 2017 4:31 pm

Try the fix from the forum post you reference and see if that fixes the build for you.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Fri Mar 03, 2017 4:34 pm

Thanks. What's the best way to restart the build, in order to avoid unnecessary rebuilding?
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby magreenblatt » Fri Mar 03, 2017 4:39 pm

Run the same automate-git.py command again. Add the `--force-build` command-line flag if you need to.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Fri Mar 03, 2017 4:55 pm

It was necessary to add "--force-build" to get the script to actually try rebuilding, but unfortunately it seems to be rebuilding everything. Is there any way to get the build to restart at the point where it fails?
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby magreenblatt » Fri Mar 03, 2017 4:58 pm

It should only rebuild what needs to be rebuilt. You didn't complete building the first time so likely there are still many files to build.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Fri Mar 03, 2017 5:07 pm

It failed the first time beginning at [26146/26155]. The new build started back at [1/26155] and is now around [5000/26155].
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby magreenblatt » Fri Mar 03, 2017 5:10 pm

If you re-ran xcode-select then that might be the reason. You should only re-run the automate-git.py script.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Fri Mar 03, 2017 5:35 pm

Sorry, I misunderstood. The script I listed was actually abbreviated. It not only switches to Xcode 7.3.1 at the beginning, it also resets to the default Xcode at the end. I did this in order to avoid forgetting to do the switch before starting a lengthy build. I didn't realize this might affect the point at which the CEF build restarted after failing. I guess I'll have to eliminate some of the convenience for the next build if this one doesn't work.

The current build is around [8000/26155] now. I assume if I try to stop it now the Xcode switch will still happen at the end, and/or that won't be the problem, and I'll have to start over at [1/26155] again anyway. I guess I'll let this build run and if it fails, do without a script for the next build and see what happens. I'll update this topic again when the current build completes.
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: Building Branch 2924 fails on Mac with Xcode 7.3.1

Postby mic » Sat Mar 04, 2017 7:12 am

After making the change from "NSApp.mainMenu" to "[[NSApplication sharedApplication] mainMenu]" in cefclient_mac.mm, the branch 2924 build now completes successfully.

I'm grateful but a little surprised. I'm not sure how the Spotify automated builder completes this build without error, nor how my environment could be changed to make it work without the manual edit.

I did notice this issue created after my original post, apparently in connection with the earlier Xcode 5 post I mentioned above:

https://bitbucket.org/chromiumembedded/cef/issues/2116/cefclient-compile-error-with-xcode-5

I would add that the problem also seems to exist with Xcode 7.3.1 and the 10.10 SDK, although after studying the matter a little it looks to me like a third-party tool downloaded by the build process does the actual compiling in this case (i.e. chromium/src/third_party/llvm-build/Release+Asserts/bin/clang).

At any rate, after making the source change I can now proceed to working with the generated binary distribution. Thank you for your assistance and advice.
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 65 guests