attempting to git apply the patch.txt, getting "patch does not apply" errors

Post here any problems you may encounter
Post Reply
rrfox2
Posts: 3
Joined: Mon Nov 04, 2019 8:18 pm

attempting to git apply the patch.txt, getting "patch does not apply" errors

Post by rrfox2 » Mon Nov 04, 2019 8:26 pm

Hello,

I really like this browser, i've been consistently using it for more than a year.
My laptop has a linux and i got tired of using the vanilla chromium on it, so I decided to attempt to compile advanced chromium for linux, but I havent reached that part yet.
I've been unable to git apply the patch.txt to the chromium project correctly.

This is the first time I've messed with git apply, so I'll just list what i attempted to do and hopefully that'll be useful

So at first i just cloned the chromium project and tried to git apply the patch to it, but i was faced with a bunch of "patch does not apply" errors for a lot of files. i assume this is because a lot of code has changed overtime since version 74.0.3860.0 and the patch requires the removal of lines of code that no longer exist in the current master head of the project.

The next thing i tried doing is to figure out to which commit i should checkout in order to restore the code to version 74.0.3860.0, and hopefully then git apply will be able to merge everything correctly. Since the file "chromium\chrome\VERSION" has the "MAJOR" and "BUILD" versions i just decided to use git log to find the commits when they were changed.

I used

>git log -SMAJOR=74"

which searched for the text "MAJOR=74" accross commits, and revealed the commits where it was changed from 73 to 74 and from 74 to 75, but the "BUILD" version naturally wasn't the correct one so instead i tried the next command with the build version alone instead

> git log -SBUILD=3860

this revealed the following commit

commit 815baef489e2df3dac63ae2100dbfa770a9adb85
Date: Sun Jul 21 03:14:31 2019 +0000
Updating trunk VERSION from 3859.0 to 3860.0

it looked promissing, so i used git checkout to switch to it

> git checkout 815baef489e2df3dac63ae2100dbfa770a9adb85

and then i checked the "chromium\chrome\VERSION" file to make sure im on the correct version of the code, but unfortunatelly the major version was 77 (77.0.3860.0) I tried a few other log searches but could not find anything close to the current advanced chromium version

later i found the google repo page, where it lists the chromium versions. The current advanced chromium version doesn't seem to be there either

in any case, i tried to apply the patch to this 77 version as well as a few others, but to no avail, i still got the "patch does not apply" error on all attempts.

which is the last chromium commit to which i should checkout to before applying the patch?

also, is this even the correct way to proceed when applying older patches to projects that have moved on?

Thanks!

admin
Site Admin
Posts: 221
Joined: Wed Feb 06, 2013 7:47 pm

Re: attempting to git apply the patch.txt, getting "patch does not apply" errors

Post by admin » Fri Nov 08, 2019 11:13 am

Hello welcome to the forum, currently I am a little bit bussy so I haven't been able to start developing advanced chrome for linux, I also need a better browser than vanilla chromium for linux, for me should be easy but being the first linux build probably will have to tweak a lot of code to make it linux compatible, It won't build on first try because there are parts of the code I included that only work on windows.

About patch.txt git diff is really hard to apply because they move a lot of code, they refactor code every day, move functions, rename variables, and lots of crazy stuff so when you try to apply a git patch is really hard, I don't even use GIT anymore because of this.

What I have been doing to update advanced chrome to a newer version is comparing the code using the app "beyond compare" file by file, on the left side are shown all the files modified for advanced chrome and the right side are shown all the files of the newer stock chromium, is a tediuous task because the patch involves like 70 files that I must patch manually.

So the patch.txt is pretty useless at this point, I don't know how google chromium developers actually merge branches and stuff like that using git because most of the time git will fail doing the automated patch, also sometimes git won't fail and files are be patched "successfully" but the code won't work properly or won't build, at that point fixing the code will be very hard because you don't know where to start, thats why I stopped using git on projects where the code is moved a lot.

Do you know to code on C++? you can help me creating the linux build if you have the time..

rrfox2
Posts: 3
Joined: Mon Nov 04, 2019 8:18 pm

Re: attempting to git apply the patch.txt, getting "patch does not apply" errors

Post by rrfox2 » Tue Nov 12, 2019 11:16 am

Hello,

Thank you for the info! Yeah i know how to code in c++. I'll try out your method to manually patch files with beyond compare and see if i can get a successful compile on windows. I might aswell do that on a newer version on commit fb5cdeedb49e. Afterwards i can start changing up the bits that only work on windows to make them work for linux compiles as well.

admin
Site Admin
Posts: 221
Joined: Wed Feb 06, 2013 7:47 pm

Re: attempting to git apply the patch.txt, getting "patch does not apply" errors

Post by admin » Tue Nov 12, 2019 11:28 am

Do a checkout for commit a17d3798439660f1b1d4dc6a00eaafdff7425408, that is exactly 74.0.3860.0

Then just extract the file I sent over PM to you, It will build perfectly for windows, you can try building for linux to see how it goes.

rrfox2
Posts: 3
Joined: Mon Nov 04, 2019 8:18 pm

Re: attempting to git apply the patch.txt, getting "patch does not apply" errors

Post by rrfox2 » Tue Nov 12, 2019 11:34 am

oh perfect, thanks!

Post Reply