3029 fails to build on Linux using defaults

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.

3029 fails to build on Linux using defaults

Postby bruth » Wed Apr 12, 2017 11:36 pm

python automate/automate-git.py --download-dir=/home/ubuntu/code/chromium_git --branch=3029 --force-build --x64-build --no-debug-build


Building on ubuntu 14.04

aws_instance.cef-build (remote-exec): [27110/27111] SOLINK ./libcef.so
aws_instance.cef-build (remote-exec): FAILED: libcef.so libcef.so.TOC
aws_instance.cef-build (remote-exec): python "/home/ubuntu/code/chromium_git/chromium/src/build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libcef.so" --tocfile="./libcef.so.TOC" --output="./libcef.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=gold -B../../third_party/binutils/Linux_x64/Release/bin -Wl,--threads -Wl,--thread-count=4 -Wl,--icf=all -m64 -pthread -Werror -Wl,--export-dynamic -Wl,-uhb_ft_face_create_cached,-uhb_glib_get_unicode_funcs -o "./libcef.so" -Wl,-soname="libcef.so" @"./libcef.so.rsp"
aws_instance.cef-build (remote-exec): ../../chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc:77: error: undefined reference to 'safe_browsing::SettingsResetPromptController::ShowSettingsResetPrompt(Browser*, safe_browsing::SettingsResetPromptController*)'
aws_instance.cef-build (remote-exec): clang: error: linker command failed with exit code 1 (use -v to see invocation)
aws_instance.cef-build (remote-exec): ninja: build stopped: subcommand failed.
aws_instance.cef-build (remote-exec): Traceback (most recent call last):
aws_instance.cef-build (remote-exec): File "automate/automate-git.py", line 980, in <module>
aws_instance.cef-build (remote-exec): if options.buildlogfile else None)
aws_instance.cef-build (remote-exec): File "automate/automate-git.py", line 55, in run
aws_instance.cef-build (remote-exec): shell=(sys.platform == 'win32'))
aws_instance.cef-build (remote-exec): File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
aws_instance.cef-build (remote-exec): raise CalledProcessError(retcode, cmd)
aws_instance.cef-build (remote-exec): subprocess.CalledProcessError: Command '['ninja', '-C', 'out/Debug_GN_x64', 'cefclient', 'chrome_sandbox']' returned non-zero exit status 1


I've done some digging and found this recent change: https://codereview.chromium.org/2701313002

What's causing the error, I think, is that settings_reset_prompt_controller.cc references settings_reset_prompt_dialog.cc, specifically SettingsResetPromptController::ShowSettingsResetPrompt (why that's defined in a different src file, I'll never know), but the problem is, settings_reset_prompt_dialog.cc in chrome/browser/ui/BUILD.gn, but only for windows: if (is_win) ...

it's a mystery to me how the builds for the above patchset passed with this configuration, it seems like it wouldn't be possible.

In any case, what's the fix for this?

Thanks!
Brice
bruth
Techie
 
Posts: 44
Joined: Mon Dec 09, 2013 5:45 pm

Re: 3029 fails to build on Linux using defaults

Postby Czarek » Wed Apr 12, 2017 11:39 pm

Was this a new clean build?
If this was an update to a new branch, have you passed --force-update flag?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: 3029 fails to build on Linux using defaults

Postby bruth » Thu Apr 13, 2017 2:16 pm

It should've been a clean branch, but I didn't explicitly pass force-update. I'll try that & report back.
bruth
Techie
 
Posts: 44
Joined: Mon Dec 09, 2013 5:45 pm

Re: 3029 fails to build on Linux using defaults

Postby bruth » Thu Apr 13, 2017 4:33 pm

That did the trick, thanks.
bruth
Techie
 
Posts: 44
Joined: Mon Dec 09, 2013 5:45 pm

Re: 3029 fails to build on Linux using defaults

Postby aleric » Thu Apr 13, 2017 6:23 pm

I ran into this as well after having done a complete new install of everything (very first time I compile this).
My solution was

Code: Select all
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc
index 1cce55e..c169ba6 100644
--- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc
+++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_controller.cc
@@ -27,6 +27,9 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "url/gurl.h"
 
+// Drag in SettingsResetPromptController to solve undefined reference to SettingsResetPromptController::ShowSettingsResetPrompt. -- Aleric
+#include "../../ui/views/settings_reset_prompt_dialog.cc"
+
 namespace safe_browsing {
 
 namespace {


Now I read here that passing a "--force-update" would fix this... but pass it where?
I'm following the manual build instructions (not automate-git.py) because I need
some form of control of the process - ie, I don't want to re-download the 7.26GB
of chromium repository every time, or start a compile over from scratch for 4 hours
long after I made a one-liner change in one .cc file, etc.

The commands that I used are basically:

Code: Select all
  mkdir -p $BASE/chromium_git/chromium
  cd $BASE/chromium_git/chromium
  fetch --nohooks chromium
  cd src
  gclient sync --nohooks --with_branch_heads
  git fetch
  git fetch --tags
  git clone https://bitbucket.org/chromiumembedded/cef.git
  pushd cef
    git checkout -t origin/$BRANCH
  popd
  git checkout $(sed -n -e "s/.*'\(refs[^']*\)'.*/\1/p" cef/CHROMIUM_BUILD_COMPATIBILITY.txt)
  gclient sync --jobs 16
  pushd cef
    ./cef_create_projects.sh
  popd
  sudo rm -f "$CHROME_DEVEL_SANDBOX"
  ninja -C out/Release_GN_x64 chrome_sandbox
  BUILDTYPE=Release_GN_x64 ./build/update-linux-sandbox.sh
  ninja -C out/Debug_GN_x64 cef


with the above linker error.

Where in this did I make an error? Where to pass --force-update?
Thanks!
aleric
Newbie
 
Posts: 8
Joined: Thu Apr 13, 2017 6:04 pm

Re: 3029 fails to build on Linux using defaults

Postby Czarek » Thu Apr 13, 2017 11:26 pm

I think that gclient sync can sometimes fail and forcing Chromium update helps.

The automate-git.py will download Chromium only the first time. On subsequent launches it only downloads new files. See automate-git.py sources for what it does when --force-update flag is passed.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: 3029 fails to build on Linux using defaults

Postby aleric » Fri Apr 14, 2017 4:30 am

I'm afraid my python-fu is very low :(
I was hoping someone can point out what exactly is wrong/missing with
the series of commands that I posted.

But of course I can just run the blackbox 'automate-git.py' once,
Do I just run:

Code: Select all
python automate/automate-git.py --download-dir=$BASE/chromium_git --branch=3029 --force-update


Does that NOT build anything? I really prefer to run ninja myself to compile.

Is it possible to tell me what magic the above will do in terms of running git and/or
lower level scripts that would fix linker errors and stuff? I'm afraid I can't figure that out
by just looking at automate-git.py.
aleric
Newbie
 
Posts: 8
Joined: Thu Apr 13, 2017 6:04 pm

Re: 3029 fails to build on Linux using defaults

Postby magreenblatt » Fri Apr 14, 2017 7:35 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: 3029 fails to build on Linux using defaults

Postby aleric » Fri Apr 14, 2017 9:29 am

Yes, and that's what I did - as I posted. The steps that I did are from that page and I posted those steps here to show exactly what I did just in case.
Nevertheless it gave me that link error. So if then I'm missing a run with automate-git.py --force-update that whatever that does is not described
on https://bitbucket.org/chromiumembedded/ ... uilding.md as far as I know.

Please tell me which command I missed.
aleric
Newbie
 
Posts: 8
Joined: Thu Apr 13, 2017 6:04 pm

Re: 3029 fails to build on Linux using defaults

Postby aleric » Sat Apr 15, 2017 6:28 am

After I got it to compile with automate-git.py, I made a diff to see what now really had changed,
using

Code: Select all
diff -ru --exclude='.git' --exclude 'build*' --exclude 'binary_distrib' --exclude '*~' --exclude '*.pyc' --exclude '*_GN_x64' 3p-llceflib-before-automate/chromium_git/chromium/src 3p-llceflib/chromium_git/chromium/src


The output of which was

Code: Select all
diff -ru '--exclude=.git' --exclude 'build*' --exclude binary_distrib --exclude 'out' --exclude '*~' --exclude '*.pyc' --exclude '*_GN_x64' 3p-llceflib-before-automate/chromium_git/chromium/src/DEPS 3p-llceflib/chromium_git/chromium/src/DEPS
--- 3p-llceflib-before-automate/chromium_git/chromium/src/DEPS  2017-04-13 18:20:23.986439814 +0200
+++ 3p-llceflib/chromium_git/chromium/src/DEPS  2017-04-14 16:56:47.455042527 +0200
@@ -1166,12 +1166,12 @@
   'src/buildtools',
   'src/third_party/android_tools',
   [
-    'DEPS.chromium',
-    'src/third_party/angle'
+    'src/third_party/angle',
+    'DEPS.chromium'
   ],
   [
-    'DEPS',
-    'src/third_party/swiftshader'
+    'src/third_party/swiftshader',
+    'DEPS'
   ]
 ]
 
Only in 3p-llceflib/chromium_git/chromium/src/third_party/deqp: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/freetype: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/glslang-angle: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/libprotobuf-mutator: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/spirv-headers: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/spirv-tools-angle: src
Only in 3p-llceflib/chromium_git/chromium/src/third_party/vulkan-validation-layers: src


I'm not sure what caused this difference, but it still leaves me with
the feeling that the manual-build instructions on the wiki are incomplete :?

Kind regards,
Aleric
aleric
Newbie
 
Posts: 8
Joined: Thu Apr 13, 2017 6:04 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 99 guests