CEF source build for branch 2272 fails on Mac

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.

CEF source build for branch 2272 fails on Mac

Postby mic » Fri Jan 29, 2016 1:34 pm

I have a need to build a particular revision of CEF branch 2272 from source on the Mac. I'm using the automated workflow with a script that looks like this:

Code: Select all
#!/bin/sh

# no spaces in BUILD_ROOT
BUILD_ROOT="/path/to/build/folder"
export GYP_GENERATORS=ninja

# checkout=xxx is git hash for svn commit 1998
# see https://bitbucket.org/chromiumembedded/cef/commits/branch/2272
python "$BUILD_ROOT/automate-git.py" --download-dir="$BUILD_ROOT" --branch=2272 --checkout=824d06b --x64-build


My machine and internet connection are not fast, but the situation cannot be remedied. I'm running OS X 10.11.3 and Xcode 7.2.

After running the source build for approximately 20 hours, and downloading nearly 19 GB in the process, the build has failed with the following generic error toward the end:

Code: Select all
...
-------- Running "/path/to/build/folder/chromium/src/cef/cef_create_projects.sh" in "/path/to/build/folder/chromium/src/cef"...
-------- Running "ninja -C out/Debug cefclient" in "/path/to/build/folder/chromium/src"...
Traceback (most recent call last):
  File "/path/to/build/folder/automate-git.py", line 914, in <module>
    if options.buildlogfile else None)
  File "/path/to/build/folder/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', 'cefclient']' returned non-zero exit status 1


Prior to this, there are a number of similar build errors in various files related to the OS X SDK headers. They are associated with various build targets, but only complain about SDK headers. The full list is too numerous to include. Some typical examples are:

Code: Select all
@class NSArray<ObjectType>;
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: error: cannot find protocol declaration for 'ObjectType'
@class NSArray<ObjectType>;
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: error: cannot find protocol declaration for 'ObjectType'
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected identifier or '('
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:4: error: expected a type
- (nullable ObjectType)nextObject;
   ^


Since these errors are associated with the OS X 10.11 SDK headers, it is not appropriate to edit them to resolve the errors. Either I find SDK headers that work, or I can't build from source. The CEF build docs say that the Mac OS X build requirements for branch 2272 are:

OS X 10.6-10.10, 10.6+ deployment target, 10.9 base SDK, Xcode 3.2.6-6.x, Ninja, 64-bit only

However, I don't think that means I can't use Xcode 7.2, build in OS X 10.11, or use the OS X 10.11 SDK, especially since they are newer than the requirements, and I have built the CEF binary distribution and the Chromium tab library in the same environment. To do so, I did have to make changes to resolve errors similar to the ones that occur in this build, but the errors were not associated with any SDK headers. This is probably because I was using Xcode to do the actual compilation, which uses a different set of tools than the Chromium build process, which uses Ninja, et. al.

If the specified build requirements are exact, I would need to install OS X 10.10 and a version of Xcode 6.x that included the 10.9 SDK, before trying again. I'm not sure how to get older versions of Xcode or the SDKs, but I am looking into that now.

If I just had the 10.9 SDK, that might be enough to prevent the errors, I don't know. My research and study of the build process indicates that it will use the oldest SDK version I have located in a particular path that is more recent than 10.6, though some of the sub-projects may override the defaults. So, if I can get a copy of the 10.9 SDK and place it in the correct location, that may prevent the build errors.

However, I will also have to figure out how to resume the build/download rather than restart it, because it takes so long. If you have any insights on any of this, or would like further clarification, please let me know. Thanks in advance for any help you can provide.
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: CEF source build for branch 2272 fails on Mac

Postby magreenblatt » Fri Jan 29, 2016 2:12 pm

You can't build 2272 branch with Xcode 7.2. You'll need to use Xcode 6.x and the 10.9 SDK as described on the BranchesAndBuilding Wiki page.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF source build for branch 2272 fails on Mac

Postby mic » Fri Jan 29, 2016 2:19 pm

Thank you for your advice. Can you be more specific about the exact version of Xcode 6.x required? Downloading multiple versions takes a very long time, and I can find no information about which versions of Xcode include the 10.9 SDK.

Is there some reason that Xcode 6.x is required? If the SDK is the issue, can I not just use the 10.9 SDK with Xcode 7.2?

Either way, how should I restart the automated build after a failure like this, so that I don't have to re-download and rebuild everything?
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: CEF source build for branch 2272 fails on Mac

Postby magreenblatt » Fri Jan 29, 2016 2:35 pm

Xcode 6.4 should work. Xcode 7.2 does not include the 10.9SDK so you would need to get the SDK from somewhere else. If you have the 10.9SDK then building with 7.2 might work, however that is untested. Use the xcode-select tool to select Xcode 6.4 after installing it.

Assuming you successfully downloaded Chromium and CEF code the first time you should not need to re-download any source code. You will still need to re-build everything. Pass `--no-chromium-update --force-build` command-line flags to automate-git.py.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF source build for branch 2272 fails on Mac

Postby mic » Fri Jan 29, 2016 2:46 pm

Thank you. Is there a way to determine whether the automated workflow progressed far enough so that I can use the flags you mention? The process seems to download, build, download, build, etc., so I assume that if the build failed there might still be more to download.

Also, if I use the flags you mention, do I need to remove or change any of the flags in my original command?
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm

Re: CEF source build for branch 2272 fails on Mac

Postby magreenblatt » Fri Jan 29, 2016 2:53 pm

Did it give any errors before running the ninja command? If not, you should be fine with the download. Add the new arguments to your existing automate-git.py command line.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF source build for branch 2272 fails on Mac

Postby mic » Mon Feb 01, 2016 12:04 pm

There were no errors in the first build until after the initial "ninja:" output, i.e.:

Code: Select all
...
Generating CEF project files...

________ running '/usr/bin/python ../build/gyp_chromium cef.gyp -I cef.gypi' in '/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src/cef'
Updating projects from gyp files...
ninja: Entering directory `out/Debug'
[1/12552] ACTION Caching PLY lex & yacc lex/parse tables
[2/12552] CXX obj/base/allocator/allocator_extension_thunks.allocator_extension_thunks.o
...

[172/12552] OBJC obj/breakpad/src/client/mac/sender/crash_report_sender.crash_report_sender.o
FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/breakpad/src/common/mac/crash_report_sender.HTTPMultipartUpload.o.d -DV8_DEPRECATION_WARNINGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=223108 -DUSE_LIBJPEG_TURBO=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_WIFI_BOOTSTRAPPING=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DDEBUG -Igen -I../../breakpad/src -I../../breakpad/src/common/mac -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -O0 -gdwarf-2 -fvisibility=hidden -Werror -Wnewline-eof -mmacosx-version-min=10.6 -arch x86_64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -std=c99 -fcolor-diagnostics -fno-strict-aliasing -fstack-protector-all -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -Wobjc-missing-property-synthesis  -c ../../breakpad/src/common/mac/HTTPMultipartUpload.m -o obj/breakpad/src/common/mac/crash_report_sender.HTTPMultipartUpload.o
In file included from ../../breakpad/src/common/mac/HTTPMultipartUpload.m:30:
In file included from ../../breakpad/src/common/mac/HTTPMultipartUpload.h:35:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: error: expected a type
- (id)copyWithZone:(nullable NSZone *)zone;
...



Therefore, based on what you said, I assume all downloads were completed during the first build. After installing Xcode 6.4, I ran the following script:

Code: Select all
#!/bin/sh

BUILD_ROOT="/path/to/build/folder"
XCODE_PATH="/Applications/Xcode.app/Contents/Developer"
XCODE64_PATH="/Applications/Xcode6.4/Xcode.app/Contents/Developer"

sudo xcode-select -s "$XCODE64_PATH"

export GYP_GENERATORS=ninja
# checkout=xxx is git hash for svn commit 1998
# see https://bitbucket.org/chromiumembedded/cef/commits/branch/2272
python "$BUILD_ROOT/automate-git.py" --download-dir="$BUILD_ROOT" --branch=2272 --checkout=824d06b --x64-build --no-chromium-update --force-build

sudo xcode-select -s "$XCODE_PATH"


This attempt appears to have succeeded entirely. There were no errors of any kind reported, and the last few lines of build output are:

Code: Select all
-------- Running "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src/cef/cef_create_projects.sh" in "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src/cef"...
-------- Running "ninja -C out/Debug cefclient" in "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src"...
-------- Running "ninja -C out/Release cefclient" in "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src"...
-------- Running "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src/cef/tools/make_distrib.sh --ninja-build --x64-uild" in "/Users/mkm/develop/respondus/projects/ChromiumCEF/build-from-source/chromium/src/cef/tools"...


I'm not sure about the "--x64-uild" (vs the expected "--x64-build") in the last "Running" output, but there appears to be a complete binary distribution in the folder /path/to/build/folder/chromium/src/cef/binary_distrib/cef_binary_3.2272.1998_macosx64, with the debug and release versions of the CEF framework.

I think I have succeeded. Thank you for your assistance. Please let me know if there is anything else I should check.
mic
Mentor
 
Posts: 82
Joined: Fri Jan 29, 2016 12:59 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 51 guests