ungoogled-chromium icon indicating copy to clipboard operation
ungoogled-chromium copied to clipboard

We need better compilation documentation

Open rwjack opened this issue 3 years ago • 10 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ... when I cannot compile the newest version straight out the box and there is no proper 0=>100 guide for neither windows nor linux.

Describe the solution you'd like A clear and concise description of what you want to happen. This project will die off if there isn't a simple way to compile newer versions.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Firefox? Not sure.

Additional context Add any other context or screenshots about the feature request here. I'd like to contribute and I'll try compiling again today. Will update this thread.

rwjack avatar Aug 05 '21 11:08 rwjack

This project will die off if there isn't a simple way to compile newer versions.

I was surprised no one actually mentioned this sooner. I have been think about this (and why there are so few contributions) for some time.

I am working on making a python script for compiling portable linux builds. It is not a substitution for documentations but hopefully it can make things easier.

wchen342 avatar Aug 05 '21 13:08 wchen342

See, I'm completely lost.

I tried to go into the windows build page, but the last tag was 89.x.x, so I basically cannot build the latest version.

I'm having a hard time figuring out the entire process. How we are supposed to merge the un-googled patch with actual chromium commits? And what comes after that, the actual build?

rwjack avatar Aug 05 '21 13:08 rwjack

The patches are not supposed to be merged to commit history. They are supposed to be applied directly on whatever source code you have on hand.

Have a look at this if you know BASH: https://github.com/ungoogled-software/ungoogled-chromium-android/blob/master/build.sh. It's for my Android build, but it may give you some idea how the building process actually works.

wchen342 avatar Aug 05 '21 13:08 wchen342

The patches are not supposed to be merged to commit history. They are supposed to be applied directly on whatever source code you have on hand.

Right, so how do I apply 92.x.x to the windows version?

Having enough processing power, I'd really like to help out and compile every release, but I'm unsure how to continue. Guessing if it was easy everyone would to it. :)

rwjack avatar Aug 05 '21 13:08 rwjack

Right, so how do I apply 92.x.x to the windows version?

I recommend that you bump this issue: https://github.com/ungoogled-software/ungoogled-chromium-windows/issues/91

and this PR (already got up to 91): https://github.com/ungoogled-software/ungoogled-chromium-windows/pull/84

Rebuilding for macOS has been working pretty smoothly for me.

brody4hire avatar Aug 05 '21 13:08 brody4hire

So basically the original chromium compiling prcoess works like this:

  1. You git clone the chromium source.
  2. You get depot tools from google.
  3. Run gclient sync on the chromium source to download a bunch of extra stuff.
  4. Make an output folder, normally under src/out, put GN options under it in args.gn and run gn gen "${output_folder}".
  5. After the generation, run ninja -C "${output_folder}" "${TARGET}" to build.

Now, in order to apply ungoogled-chromium change, there are two places that need to change for the fore-mentioned steps:

3.1. Run prune_binaries.py, patches.py and domain_substitution.py between step 3 and step 4. 3.2. Add flags in flags.gn into args.gn under the output folder.

The patches and flags in this repository are general among all platforms. In order to apply additional patches, like from ungoogled-chromium-windows, you need to apply them after step 3.1:

python3 ungoogled-chromium/utils/prune_binaries.py src ${path_to_series_in_windows_repo}.

That's the basic idea how building works.

wchen342 avatar Aug 05 '21 13:08 wchen342

Right, so how do I apply 92.x.x to the windows version?

I recommend that you bump this issue: ungoogled-software/ungoogled-chromium-windows#91

and this PR (already got up to 91): ungoogled-software/ungoogled-chromium-windows#84

Could you please define bumping issues? You mean just commenting over there?

Thanks @wchen342 !

rwjack avatar Aug 05 '21 14:08 rwjack

Could you please define bumping issues? You mean just commenting over there?

Yes and it is very controversial: https://blog.sindresorhus.com/issue-bumping-e3b9740e2a0

I just bumped these issues in my own way.

P.S. I am just an outside user, been very happy building and using the macOS version.

brody4hire avatar Aug 05 '21 15:08 brody4hire

Yeah the documentation to update both this repo and a platform repo is lacking. There's already documentation detailing how to update each repo individually, but not as a whole. Usually most people are working in Linux, so they update the patches until Portable Linux can build.

Eloston avatar Aug 22 '21 04:08 Eloston

Yes, for the case below, I have to dig into the patch to

  • find out the problem when patch
  • decide what to patch
  • decide where to patch for the new version

If there are good documents that guides patching manually, then it'll easy to write scripts for patching.

In the case below, though the patch step passes, but there are message like INFO: Path has no substitutions, there can be different reason for this:

  • the patch content is not out of time, but the position to patch changes
  • source code changed so that the patch should be decrypted

If there are better documents, every patch will be very clear.

Case

Failed

  1. fork from https://github.com/ungoogled-software/ungoogled-chromium-windows
  2. checkout tag 92.0.4515.159 of https://github.com/Eloston/ungoogled-chromium as submodule
  3. patch step failed

Succeeded

  1. fork from https://github.com/Nifury/ungoogled-chromium-windows which forks from https://github.com/ungoogled-software/ungoogled-chromium-windows, Nifury fixed something
  2. new branch from v92.0.4515.131
  3. follow case 1 step 2
  4. patch step passed

playgithub avatar Aug 25 '21 05:08 playgithub