[Question] Rebase on CEF *and* Chromium changes

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

[Question] Rebase on CEF *and* Chromium changes

Postby ndesktop » Thu Oct 01, 2020 1:37 am

I am in the process of improving my CEF fork build and maintenance scripts, and I am unclear about one thing.
I am reading the ContributingWithGit page, specifically the Rebasing on Upstream Changes.

The page clearly describes how to get the additional commits which may happen to occur in CEF.

But I am not 100% sure what *exactly* I should do if there also are changes on CHROMIUM_BUILD_COMPATIBILITY.txt, bumping the Chromium version, say, from 86.0.4240.0 to 86.0.4240.22.
What extra commands do one need to run in order to update also the Chromium sources ?

My scenario is:
- CEF forked on Bitbucket, say there are now it's branches cef_M
- Chromium branched locally in a branch chromium_M (corresponding to cef_M build compatibility): I do have some patches in cef/ but some of them are quite big, and, being not so proficient on maintaining the content of patches/, I maintain also a Chromium local branch
- when a new CEF branch is release appear do
synchronize my fork (do what ContributingWithGit page says)
automate_git.py ... --branch=M --url=cef_M_fork_url ...
chromium src/ branch to chromium_N
add remote upstream chromium_M for src/
fetch src/
add remote upstream cef_M for src/cef/
fetch src/cef/
merge chromium_M to chromium_N
merge cef_M to cef_N
and from now on cef_create_projects etc.

So I am on branch N now, and CEF updates the N branch with a newer Chromium version. I am on my local Chromium branch chromium_N.
How should I correctly update my local Chromium branch to the newer version ?
ndesktop
Master
 
Posts: 748
Joined: Thu Dec 03, 2015 10:10 am

Re: [Question] Rebase on CEF *and* Chromium changes

Postby Czarek » Thu Oct 01, 2020 8:20 am

The automate-git.py has various options in regards to updates that may interest you. To force update of Chromium pass the --force-update flag.

Code: Select all
# Update-related options.
parser.add_option('--force-update',
                  action='store_true', dest='forceupdate', default=False,
                  help='Force a Chromium and CEF update. This will trigger a '+\
                       'new build and distribution.')
parser.add_option('--no-update',
                  action='store_true', dest='noupdate', default=False,
                  help='Do not update Chromium or CEF. Pass --force-build or '+\
                       '--force-distrib if you desire a new build or '+\
                       'distribution.')
parser.add_option('--no-cef-update',
                  action='store_true', dest='nocefupdate', default=False,
                  help='Do not update CEF. Pass --force-build or '+\
                       '--force-distrib if you desire a new build or '+\
                       'distribution.')
parser.add_option('--force-cef-update',
                  action='store_true', dest='forcecefupdate', default=False,
                  help='Force a CEF update. This will cause local changes in '+\
                       'the CEF checkout to be discarded and patch files to '+\
                       'be reapplied.')
parser.add_option(
    '--no-chromium-update',
    action='store_true',
    dest='nochromiumupdate',
    default=False,
    help='Do not update Chromium.')
parser.add_option(
    '--no-depot-tools-update',
    action='store_true',
    dest='nodepottoolsupdate',
    default=False,
    help='Do not update depot_tools.')
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: [Question] Rebase on CEF *and* Chromium changes

Postby magreenblatt » Thu Oct 01, 2020 12:00 pm

ndesktop wrote:So I am on branch N now, and CEF updates the N branch with a newer Chromium version. I am on my local Chromium branch chromium_N.
How should I correctly update my local Chromium branch to the newer version ?

If I'm understanding correctly, you've also forked the Chromium src.git repo. In that case you can specify --chromium-url to download your fork instead of the default repo.

So, I would suggest a 2-step process. (1) Rebase your forked CEF and Chromium repos on top of the upstream versions. (2) Use automate-git.py with --url, --chromium-url and --branch (or --checkout) options to build "in the normal way" but substituting your forked repos for the defaults.
magreenblatt
Site Admin
 
Posts: 12379
Joined: Fri May 29, 2009 6:57 pm

Re: [Question] Rebase on CEF *and* Chromium changes

Postby ndesktop » Thu Oct 01, 2020 2:10 pm

magreenblatt wrote:If I'm understanding correctly, you've also forked the Chromium src.git repo. In that case you can specify --chromium-url to download your fork instead of the default repo.

Yes, only it is not a true fork, just a regular git checkout -b from the version downloaded by CEF automate-git.py, where I am merging from the previously chromium branch obtained in the same way.

magreenblatt wrote:So, I would suggest a 2-step process. (1) Rebase your forked CEF and Chromium repos on top of the upstream versions.

The chromium rebase is the key question here. I need to do a rebase, but according to CHROMIUM_COMPPATIBILITY of CEF.

magreenblatt wrote:(2) Use automate-git.py with --url, --chromium-url and --branch (or --checkout) options to build "in the normal way" but substituting your forked repos for the defaults.
That is a good idea, providing I figure the exact way to rebase on the upstream chromium using the version specified from CEF compatibility.

I would have gone to your route using patches/, but I have to construct the correct patches first so I can incorporate them in my CEF for, so I have to do first the correct chromium rebase anyways. This is why I preferred (years ago, I admit) the chromium branch/fork route.
ndesktop
Master
 
Posts: 748
Joined: Thu Dec 03, 2015 10:10 am

Re: [Question] Rebase on CEF *and* Chromium changes

Postby magreenblatt » Thu Oct 01, 2020 2:15 pm

ndesktop wrote:
magreenblatt wrote:(2) Use automate-git.py with --url, --chromium-url and --branch (or --checkout) options to build "in the normal way" but substituting your forked repos for the defaults.
That is a good idea, providing I figure the exact way to rebase on the upstream chromium using the version specified from CEF compatibility.

I would have gone to your route using patches/, but I have to construct the correct patches first so I can incorporate them in my CEF for, so I have to do first the correct chromium rebase anyways. This is why I preferred (years ago, I admit) the chromium branch/fork route.

This will always be the major problem with forking Chromium (trying to rebase with so many commits), and the main reason why we took the patch approach with CEF. Are you seeking to automate this process (which could be hard due to merge conflicts), or are you just looking for some advice on how to manage it as a manual process?
magreenblatt
Site Admin
 
Posts: 12379
Joined: Fri May 29, 2009 6:57 pm

Re: [Question] Rebase on CEF *and* Chromium changes

Postby ndesktop » Thu Oct 01, 2020 3:18 pm

magreenblatt wrote:
ndesktop wrote:
magreenblatt wrote:(2) Use automate-git.py with --url, --chromium-url and --branch (or --checkout) options to build "in the normal way" but substituting your forked repos for the defaults.
That is a good idea, providing I figure the exact way to rebase on the upstream chromium using the version specified from CEF compatibility.

I would have gone to your route using patches/, but I have to construct the correct patches first so I can incorporate them in my CEF for, so I have to do first the correct chromium rebase anyways. This is why I preferred (years ago, I admit) the chromium branch/fork route.

This will always be the major problem with forking Chromium (trying to rebase with so many commits), and the main reason why we took the patch approach with CEF. Are you seeking to automate this process (which could be hard due to merge conflicts), or are you just looking for some advice on how to manage it as a manual process?

I will like for sure to automate the process, but yes, the merge part was and is in any scenario a pain.
For the moment being I will prefer the small and sure steps - mostly because I'm the sole maintainer and the CEF fork is just the half of the story - so the manual rebase process would do it for now. I guess at this time I will take any advice one can give me, because such decisions are usually reached after numerous attempts and large experience.

I will probably take the patch route after all, even if it means more extra steps, in the foreseeable future, but I thought it is worth to ask if there is already. I got everything else from initial checkout up to the deployment automatic, and this particular one was bothering me - but it seems the patch approach will be the way to go after all.
ndesktop
Master
 
Posts: 748
Joined: Thu Dec 03, 2015 10:10 am

Re: [Question] Rebase on CEF *and* Chromium changes

Postby magreenblatt » Thu Oct 01, 2020 3:25 pm

I discussed this with the Opera developers a while back and they were also using the patch approach. Opera is one of the earliest (most experienced) third-party browsers to fork Chromium, so if they're using the patch approach I suspect it's the best way to go unless you can find someone with experience to the contrary.
magreenblatt
Site Admin
 
Posts: 12379
Joined: Fri May 29, 2009 6:57 pm

Re: [Question] Rebase on CEF *and* Chromium changes

Postby Czarek » Thu Oct 01, 2020 4:30 pm

I've always used patches. I also wrote my own automate tools on top of automate-git.py. Such tool can integrate new Chromium and CEF patches without the need to fork CEF repo.
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


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 9 guests