Problem with clone CEF 4240 in win10

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.

Problem with clone CEF 4240 in win10

Postby zoro » Tue Oct 19, 2021 1:57 am

Hello!

I trying to build CEF from source code.
My main goal is build CEF with proprietary codecs (h264/h265) supporting.
But I can't clone CEF in base configuration.

Code: Select all
python automate-git.py --download-dir=F:\cef\chromium_git --depot-tools-dir=F:\cef\depot_tools --branch=4240 --no-build --no-distrib --force-clean


Full output
Code: Select all
F:\cef>python automate-git.py --download-dir=F:\cef\chromium_git --depot-tools-dir=F:\cef\depot_tools --branch=4240 --no-build --no-distrib --force-clean
--> Download Directory: F:\cef\chromium_git
--> Depot Tools Directory: F:\cef\depot_tools
--> Updating depot_tools
-------- Running "update_depot_tools.bat" in "F:\cef\depot_tools"...
--> Removing directory F:\cef\chromium_git\cef
--> CEF Branch: 4240
--> CEF URL: https://bitbucket.org/chromiumembedded/cef.git
--> CEF Source Directory: F:\cef\chromium_git\cef
-------- Running "F:\cef\depot_tools\git.bat clone https://bitbucket.org/chromiumembedded/cef.git F:\cef\chromium_git\cef" in "F:\cef\chromium_git"...
Cloning into 'F:\cef\chromium_git\cef'...
Receiving objects: 100% (70891/70891), 28.56 MiB | 11.60 MiB/s, done.
Resolving deltas: 100% (60138/60138), done.
-------- Running "F:\cef\depot_tools\git.bat rev-parse HEAD" in "F:\cef\chromium_git\cef"...
-------- Running "F:\cef\depot_tools\git.bat rev-parse origin/4240" in "F:\cef\chromium_git\cef"...
--> CEF Current Checkout: 07bc800f0080f62e0d299d3e1a878510085bebc3
--> CEF Desired Checkout: 85e79d418db1999bb22fdead4c178e1b0694bb4c (origin/4240)
-------- Running "F:\cef\depot_tools\git.bat checkout --force origin/4240" in "F:\cef\chromium_git\cef"...
Note: switching to 'origin/4240'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 85e79d418 Update to Chromium version 86.0.4240.198
--> Reading F:\cef\chromium_git\cef\CHROMIUM_BUILD_COMPATIBILITY.txt
-------- Running "F:\cef\depot_tools\git.bat checkout --force 5dba9c97fb" in "F:\cef\depot_tools"...
Previous HEAD position was 650f853c Disable print for git for-each-ref in git_cache
HEAD is now at 5dba9c97 Pass large -j value to ninja when use_rbe = true
--> CEF Output Directory: F:\cef\chromium_git\out_4240
-------- Running "F:\cef\depot_tools\git.bat config --get remote.origin.url" in "F:\cef\chromium_git\chromium\src"...
--> Chromium URL: https://chromium.googlesource.com/chromium/src.git
-------- Running "F:\cef\depot_tools\git.bat fetch" in "F:\cef\chromium_git\chromium\src"...
remote: Finding sources: 100% (5115/5115)
remote: Total 5115 (delta 1633), reused 4494 (delta 1633)
Receiving objects: 100% (5115/5115), 22.00 MiB | 16.69 MiB/s, done.
Resolving deltas: 100% (1633/1633), completed with 685 local objects.
From https://chromium.googlesource.com/chromium/src
   0970bb2d96541..7c46fde7fcfbb  lkgr                   -> origin/lkgr
   d5ca8e2e14cbd..91685a8a37903  lkgr-android-internal  -> origin/lkgr-android-internal
   5a60b623c0692..d5c9e0a1568bc  main                   -> origin/main
   5a60b623c0692..d5c9e0a1568bc  master                 -> origin/master
   a0e85d5212e34..4e30c5d92be7e  refs/branch-heads/4515 -> branch-heads/4515
   72e0823d9193b..23387e3403762  refs/branch-heads/4577 -> branch-heads/4577
   c03dd9db7b432..d142c0eb7c891  refs/branch-heads/4606 -> branch-heads/4606
   5479cabec3395..5cb28462a3ee9  refs/branch-heads/4638 -> branch-heads/4638
   94bcc1d116adc..e6cc1e7600718  refs/branch-heads/4664 -> branch-heads/4664
   8e89e81925cc5..7590e8b0cf43f  refs/branch-heads/4673 -> branch-heads/4673
-------- Running "F:\cef\depot_tools\git.bat fetch --tags" in "F:\cef\chromium_git\chromium\src"...
remote: Finding sources: 100% (21/21)
remote: Total 21 (delta 14), reused 21 (delta 14)
Unpacking objects: 100% (21/21), 4.66 KiB | 6.00 KiB/s, done.
From https://chromium.googlesource.com/chromium/src
 * [new tag]                     93.0.4577.122 -> 93.0.4577.122
 * [new tag]                     94.0.4606.104 -> 94.0.4606.104
 * [new tag]                     95.0.4638.57  -> 95.0.4638.57
 * [new tag]                     96.0.4664.14  -> 96.0.4664.14
 * [new tag]                     96.0.4664.15  -> 96.0.4664.15
 * [new tag]                     97.0.4673.2   -> 97.0.4673.2
 * [new tag]                     97.0.4673.3   -> 97.0.4673.3
-------- Running "F:\cef\depot_tools\git.bat rev-parse HEAD" in "F:\cef\chromium_git\chromium\src"...
-------- Running "F:\cef\depot_tools\git.bat rev-parse refs/tags/86.0.4240.198" in "F:\cef\chromium_git\chromium\src"...
--> Chromium Current Checkout: 5a60b623c0692654bb2c7ce8e8a94ac0481bc648
--> Chromium Desired Checkout: 5f8e74b8f1dab431a1a57d84101185f0e8da33d4 (refs/tags/86.0.4240.198)
-------- Running "gclient revert --nohooks" in "F:\cef\chromium_git\chromium"...
Syncing projects: 100% ( 1/ 1) src

src (ERROR)
----------------------------------------
[0:00:00] Started.
----------------------------------------
Traceback (most recent call last):
  File "F:\cef\depot_tools\metrics.py", line 267, in print_notice_and_exit
    yield
  File "F:\cef\depot_tools\gclient.py", line 3195, in <module>
    sys.exit(main(sys.argv[1:]))
  File "F:\cef\depot_tools\gclient.py", line 3181, in main
    return dispatcher.execute(OptionParser(), argv)
  File "F:\cef\depot_tools\subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "F:\cef\depot_tools\gclient.py", line 2817, in CMDrevert
    return client.RunOnDeps('revert', args)
  File "F:\cef\depot_tools\gclient.py", line 1779, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options,
  File "F:\cef\depot_tools\gclient_utils.py", line 965, in flush
    reraise(e[0], e[1], e[2])
  File "F:\cef\depot_tools\gclient_utils.py", line 67, in reraise
    raise value
  File "F:\cef\depot_tools\gclient_utils.py", line 1042, in run
    self.item.run(*self.args, **self.kwargs)
  File "F:\cef\depot_tools\gclient.py", line 953, in run
    self.ParseDepsFile()
  File "F:\cef\depot_tools\gclient.py", line 792, in ParseDepsFile
    deps_to_add = self._deps_to_objects(
  File "F:\cef\depot_tools\gclient.py", line 643, in _deps_to_objects
    should_process = should_process and gclient_eval.EvaluateCondition(
  File "F:\cef\depot_tools\gclient_eval.py", line 626, in EvaluateCondition
    return _convert(main_node)
  File "F:\cef\depot_tools\gclient_eval.py", line 561, in _convert
    return EvaluateCondition(
  File "F:\cef\depot_tools\gclient_eval.py", line 626, in EvaluateCondition
    return _convert(main_node)
  File "F:\cef\depot_tools\gclient_eval.py", line 593, in _convert
    value = _convert(node.operand)
  File "F:\cef\depot_tools\gclient_eval.py", line 586, in _convert
    bool_values.append(_convert(value))
  File "F:\cef\depot_tools\gclient_eval.py", line 608, in _convert
    left = _convert(node.left)
  File "F:\cef\depot_tools\gclient_eval.py", line 561, in _convert
    return EvaluateCondition(
  File "F:\cef\depot_tools\gclient_eval.py", line 537, in EvaluateCondition
    main_node = ast.parse(condition, mode='eval')
  File "F:\cef\depot_tools\bootstrap-2@3_8_10_chromium_20_bin\python3\bin\Lib\ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 0

    ^
SyntaxError: unexpected EOF while parsing
Traceback (most recent call last):
  File "automate-git.py", line 1367, in <module>
    run("gclient revert --nohooks", chromium_dir, depot_tools_dir)
  File "automate-git.py", line 70, in run
    args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
  File "F:\cef\depot_tools\bootstrap-2@3_8_10_chromium_20_bin\python\bin\lib\subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gclient', 'revert', '--nohooks']' returned non-zero exit status 1
zoro
Techie
 
Posts: 15
Joined: Tue Jun 09, 2020 8:20 pm

Re: Problem with clone CEF 4240 in win10

Postby ndesktop » Tue Oct 19, 2021 2:50 am

4240 is an unsupported branch.
However, here is how I do an old branch build (88.2.1 in this example):
- create an empty directory for building, such as C:\cef\88.2.1
- note where Python 2.7 (x64) and Visual Studio are installed (make sure VS is installed with all the required features)
- save automate-git.py inside that directory
- create a file cbt.bat inside the same directory with this content:
Code: Select all
@echo off

:: CEF                  88.2.1
:: CEF checkout         0b18d0bc60b26027ebcada7e3644c020d30b583b
:: Chromium             88.0.4324.146

set CEFOP=
if [%1%] EQU [checkout] set CEFOP=checkout
if [%1%] EQU [make] set CEFOP=make
if [%1%] EQU [build] set CEFOP=build
if [%1%] EQU [distrib] set CEFOP=distrib
goto run

:run
if [%CEFOP%] EQU [] goto usage

:: ensure we're using Python 2.7 x64
set PATH=C:\bin\python\x64\27;%PATH%

:: common
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
set GYP_MSVS_VERSION=2017
set VS2017_INSTALL=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community

if [%CEFOP%] EQU [checkout] goto checkout
if [%CEFOP%] EQU [make] goto make
if [%CEFOP%] EQU [build] goto build
if [%CEFOP%] EQU [distrib] goto distrib
goto end

:: checkout
:checkout
@echo Performing checkout.
python automate-git.py --download-dir=C:\cef\88.2.1 --branch=4324 --checkout=0b18d0bc --chromium-checkout=refs/tags/88.0.4324.146 --no-build --no-distrib --no-distrib-docs --no-distrib-archive --no-debug-tests --no-release-tests
goto end

:: make
:make
@echo Performing project creation.
set PATH=C:\cef\88.2.1\depot_tools;%PATH%
cd chromium\src\cef
cef_create_projects.bat
cd C:\cef\88.2.1
goto end

:: build
:build
@echo Performing build.
set PATH=C:\cef\88.2.1\depot_tools;%PATH%
cd chromium\src
ninja -C out\Release_GN_x86 cefclient cefsimple ceftests
cd C:\cef\88.2.1
goto end

:distrib
@echo Performing distribution creation.
python automate-git.py --download-dir=C:\cef\88.2.1 --branch=4324 --no-update --no-chromium-update --no-depot-tools-update --no-build --no-debug-build --no-debug-tests --no-release-tests --force-distrib --client-distrib --no-distrib-archive --distrib-subdir=C:\cef\88.2.1\distrib\x86
cd C:\cef\88.2.1
goto end

:usage
@echo usage:
@echo   cbt checkout^|make^|build^|distrib
@echo checkout  Retrieves the CEF, Chromium ^& tools source code.
@echo make      Creates CEF projects and configure the build.
@echo build     Performs the actual build.
@echo distrib   Creates the binary distribution from the previously created build.
goto end

:end

- update the path to your installation of Python 2.7 (in the cbt.bat file is C:\bin\python\x64\27)
- update the set GN_ARGUMENTS to use vs2019 if needed
- update set GYP_MSVS_OVERRIDE_PATH to your VS path if needed
- update set GYP_MSVS_VERSION=2017 if needed
- update set VS2017_INSTALL to your VS path if needed

Then the usage is straigtforward.
Open a command prompt on the directory C:\cef\88.2.1 (replace with yours) and then:
- cbt checkout to get the sources
- cbt make to generate the projects
- cbt build to build the binaries
- cbt distrib to create the binary distribution
- if you need other flags in GN_DEFINES (by default is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome builds with codecs enabled) add these as well
Note. This example builds only x86 Release.
Modify accordingly build and distrib if you need other configurations to be built.

Maybe this can help.
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: Problem with clone CEF 4240 in win10

Postby zoro » Tue Oct 19, 2021 3:27 am

Why is 4240 an unsupported branch? Is there any reason?
zoro
Techie
 
Posts: 15
Joined: Tue Jun 09, 2020 8:20 pm

Re: Problem with clone CEF 4240 in win10

Postby ndesktop » Tue Oct 19, 2021 4:10 am

Because it's old. But mostly because Chromium does not have a stable API and the effort of maintaining such a large number of branches and changes would quick become next to impossible.
(I am maintaining for update purposes between 2 and 7 branches and it is no fun, although the forks modification done to Chrome and CEF are largely the same, it's still very time consuming).
CEF is doing exactly that (stable API) and still is constantly changing, although not on the Chromium scale.

The listed supported and unsupported legacy branches are listed on the wiki Branches and Building page.
The page states:
"Building legacy branches is not supported. If you choose to build a legacy branch you will need to solve any build errors on your own."
As you can see, supported are 4606 and 4638.
4240 is September 2020 (more than a year). Already 4577 from July 2021 is legacy.
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 55 guests