You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These instructions are for updating CEF version in CEF Python. When building CEF from sources follow all steps. When using prebuilt binaries from Spotify Automated Builds then the steps for updating CEF are much easier, you can omit steps 1-5 can in such case.
Notes:
As of April 2017 up to 28 GB of memory may be used (RAM + virtual). Each year Chromium memory requirements go higher so I recommend reserving more.
As of May 2018 about 13 GB of internet transfer may be used
As of May 2018 CEF seems to raise exception when patching fails, so no need to manually check that (todo: update instructions below)
Important changes in upstream CEF
There is the CEF Announce mailing list where you can find announcements of any new important changes in CEF.
Update CEF version in cefpython
Make sure you have enough RAM to build Chromium. If you don't have enough RAM build may fail at the end during linking of libcef library. Also due to not enough RAM the build may slow down your computer so significantly that user interface won't be responding at all (noticed on Linux during last step of linking libcef which can take hours). You can use virtual memory if you have a fast SSD disk. If you installed Linux without swap then see "Linux swap" notes at the end that provide instructions on how to re-enable swap.
When not having enough RAM and using swap, to speed up last steps of linking libcef.so try using --ninja-jobs 1 flag set only one ninja job. If using more ninja jobs more of them will use slow swap memory.
It is recommended to update patches using upstream cef/tools/patch_updater.py tool. If patch_updater.py fails then you need to manually resolve the conflicts and re-run with the --resave flag.
Operation to be done in in chromium/cef/ . CEF expects chromium checkout in parent directory. However since you first need to update Chromium using automate.py you have no way to fix patches first. So you need to run it and see in the console if there are errors when applying patches and if so, terminate it, go back to this step 1 and then re-run automate.py in step 3.
After cef/tools/patch_updater.py was ran and succeeded, copy chromium/src/cef/patch/patches/issue*.patch patches to cefpython/patches/ and overwrite.
To resolve conflict in patch manually copy the patch to appropriate CEF or Chromium directory:
Apply the patch with patch -p0 < issue251.patch command. Conflicts will be saved to ".rej" files.
Delete the patch file and generate a new patch file with git diff --no-prefix --relative > issueXXX.patch command
Update the patch in the patches/ directory
Create the build directory, enter it and run the automate.py tool. Somewhere at the beginning of execution you should see messages about patches being applied, make sure they applied successfully - this is explained in step 3).
cd cefpython/
mkdir build
cd build/
python ../tools/automate.py --build-cef --ninja-jobs 6 --cef-branch 2883 --force-chromium-update
The --force-chromium-update flag needs to be specified when Chromium version changed since last update. When just rebuilding project files you don't need to specify it, it will slow down the process.
If the --cef-branch flag isn't specified then CEF branch is taken from the src/version/cef_version_xxx.h file
There is a --no-cef-update flag, but there may be issues when using this flag due to CEF Issue 1825
If you make changes to CEF and want to rebuilt with these changes applied to CEF then specify the --no-cef-update flag
If CEF did not change or if build was interrupted and you want to continue building, you can use the ---no-cef-update flag so that CEF repo is not fetched again
4b. If there is such an error:
Command: python -- /home/cz/github/cefpython/build/chromium/src/build/config/linux/pkg-config.py
-s /home/cz/github/cefpython/build/chromium/src/build/linux/debian_wheezy_arm-sysroot -a arm
gmodule-2.0 gtk+-3.0 gthread-2.0
Returned 1.
Then remove then remove the chromium/src/build/linux/debian_wheezy_arm-sysroot directory. See explanation here.
4c. If there is an error on one of last steps during linking of libcef library it might be caused by not enough RAM memory.
Make sure that cefpython patches were applied successfully. Currently when patch fails, CEF will continue building. You need to go through output and find messages about patches being applied, like below. In this case issue125 patch failed. Patches issue231 and issue251 succeeded. If you have problems finding these messages, after you've built new CEF, try running the automate.py script again (without the --force-chromium-update flag this time) and it should appear somewhere at the beginning.
Update the "src/version/cef_version_xxx.h" file (xxx is platform) with the contents of the "build/chromium/src/cef/binary_distrib/cef_binary_xxx/include/cef_version.h" file
Update src/include/ headers with CEF repo's include/ directory:
if API changed in CEF then additional modifications may be required in cefpython's code
Compare and synchronize changes between these files:
Compare "cefpython/subprocess/print_handler_gtk.cpp" with "cef/tests/cefclient/browser/print_handler_gtk.cc". See the .patch file in subprocess/ dir for required differences. Compare also corresponding .h files.
Compare "cefpython/src/client_handler/dialog_handler_gtk.cpp" with "cef/tests/cefclient/browser/dialog_handler_gtk.cc". See the .patch file in client_handler/ dir for required differences. Compare also corresponding .h files.
Compare "cefpython/src/subprocess/main_message_loop*" files with "cef/tests/shared/browser/main_message_loop*" files.
Steps for making a release
Run tools/build_distrib.py script on all platforms
Upload wheel packages to PyPI (use Python 3 to avoid SSL issues):
As of April 2017 Chromium can use up to 28 GB of RAM. If there is not enough RAM on Linux during last steps when linking libcef library and you didn't create swap partition (virtual memory) during Linux installation, then do these steps:
Download "gparted live CD" and burn on DVD
Boot from DVD and choose "Safe graphics" mode
Shrink partition from the end (from the right) - shrinking from the left can cause issues.
Create "linux-swap" partition from the unallocated space
Shutdown gparted.
Boot real OS. Assuming /dev/sda2 == swap partition
sudo mkswap /dev/sda2
sudo blkid /dev/sda2 --> to see UUID eg. 0d729c04-828e-4a0f-9bc2-44324e7fc3ee
CEF version: 3.3029.1602.g19201cd
Chromium version: 58.0.3029.33
Only Linux src/versions/ was updated.
Following update instructions from Issue #264.
Update patches.
Update docs.
Fix PaintBuffer deprecated methods.
Add --make-distrib flag in automate.py to re-make CEF binary distrib.
Update run_examples.py to run gtk3.py example.
These instructions are for updating CEF version in CEF Python. When building CEF from sources follow all steps. When using prebuilt binaries from Spotify Automated Builds then the steps for updating CEF are much easier, you can omit steps 1-5 can in such case.
Notes:
Important changes in upstream CEF
There is the CEF Announce mailing list where you can find announcements of any new important changes in CEF.
Update CEF version in cefpython
Make sure you have enough RAM to build Chromium. If you don't have enough RAM build may fail at the end during linking of libcef library. Also due to not enough RAM the build may slow down your computer so significantly that user interface won't be responding at all (noticed on Linux during last step of linking libcef which can take hours). You can use virtual memory if you have a fast SSD disk. If you installed Linux without swap then see "Linux swap" notes at the end that provide instructions on how to re-enable swap.
--ninja-jobs 1
flag set only one ninja job. If using more ninja jobs more of them will use slow swap memory.It is recommended to update patches using upstream
cef/tools/patch_updater.py
tool. If patch_updater.py fails then you need to manually resolve the conflicts and re-run with the--resave
flag.cef/tools/patch_updater.py
was ran and succeeded, copychromium/src/cef/patch/patches/issue*.patch
patches tocefpython/patches/
and overwrite.To resolve conflict in patch manually copy the patch to appropriate CEF or Chromium directory:
patch -p0 < issue251.patch
command. Conflicts will be saved to ".rej" files.git diff --no-prefix --relative > issueXXX.patch
commandCreate the build directory, enter it and run the automate.py tool. Somewhere at the beginning of execution you should see messages about patches being applied, make sure they applied successfully - this is explained in step 3).
--force-chromium-update
flag needs to be specified when Chromium version changed since last update. When just rebuilding project files you don't need to specify it, it will slow down the process.--cef-branch
flag isn't specified then CEF branch is taken from the src/version/cef_version_xxx.h file--no-cef-update
flag, but there may be issues when using this flag due to CEF Issue 1825--no-cef-update
flag---no-cef-update
flag so that CEF repo is not fetched again4b. If there is such an error:
Then remove then remove the
chromium/src/build/linux/debian_wheezy_arm-sysroot
directory. See explanation here.4c. If there is an error on one of last steps during linking of libcef library it might be caused by not enough RAM memory.
Make sure that cefpython patches were applied successfully. Currently when patch fails, CEF will continue building. You need to go through output and find messages about patches being applied, like below. In this case issue125 patch failed. Patches issue231 and issue251 succeeded. If you have problems finding these messages, after you've built new CEF, try running the automate.py script again (without the
--force-chromium-update
flag this time) and it should appear somewhere at the beginning.Update the "src/version/cef_version_xxx.h" file (xxx is platform) with the contents of the "build/chromium/src/cef/binary_distrib/cef_binary_xxx/include/cef_version.h" file
Update src/include/ headers with CEF repo's include/ directory:
Compare and synchronize changes between these files:
Steps for making a release
tools/build_distrib.py
script on all platformsExample commands
64-bit
32-bit
Rebuild manually.
Package manually. For 64-bit add --x64-build flag
Create prebuilt binaries and libraries for 32-bit. Must be done on 32-bit Linux.
Build libcef_dll_wrapper library on
Mac
when using binaries from Spotify Automated Builds:Linux swap
As of April 2017 Chromium can use up to 28 GB of RAM. If there is not enough RAM on Linux during last steps when linking libcef library and you didn't create swap partition (virtual memory) during Linux installation, then do these steps:
Other notes
The text was updated successfully, but these errors were encountered: