intel / ozone-wayland

Wayland implementation for Chromium Ozone classes
BSD 3-Clause "New" or "Revised" License
218 stars 82 forks source link

Cannot aply patches #439

Open vrotenberg opened 8 years ago

vrotenberg commented 8 years ago

Hi! When I run ./src/ozone/patches/patch-chromium.sh I always get an error: Ozone-Wayland: patching Chromium Switched to branch 'master' Your branch is up-to-date with 'origin/master'. Deleted branch master-ozone (was 14c5a1f). Switched to a new branch 'master-ozone' Applying: Browser: Support Desktop Aura creation on Ozone Applying: Remove usage of DesktopFactory. Applying: Add support to provide external ozone files in views. Applying: Add support for checking DesktopWindow with Ozone and Ash. Applying: Media: Build VaapiPictureWayland as part of Media. Applying: Fix crash when switching to console(VT) mode Applying: Add needed support in PlatformWindow. Applying: Add file picker support using WebUI error: patch failed: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:337 error: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc: patch does not apply error: patch failed: chrome/common/url_constants.cc:602 error: chrome/common/url_constants.cc: patch does not apply Patch failed at 0008 Add file picker support using WebUI The copy of the patch that failed is found in: /home/shalom/git/chromium/src/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Please help! Thanks

joone commented 8 years ago

Your top commit of chromium should be e82a7af9d123ad8d8dd629a641d21f961e2b1346.

kalyankondapally commented 8 years ago

If its a fresh sync, make sure you are on master branch and not in detached head state.

vrotenberg commented 8 years ago

Thanks. How can I be sure I am on master branch and not in detached head state?

rakuco commented 8 years ago

If its a fresh sync, make sure you are on master branch and not in detached head state.

Don't you mean the opposite? If his Chromium checkout is tracking a named branch (like "master"), I think gclient sync will try to rebase whatever hash you've set in .DEPS.git on top of it, whereas if the checkout is detached (which should be the default if he's checking out Chromium via oz-wl's DEPS.git) things should just work.

vrotenberg commented 8 years ago

In the file src/ozone/.DEPS.git the parameter 'chromium_rev': 'e82a7af9d123ad8d8dd629a641d21f961e2b1346', but after gclient sync and trying to apply the patches I still get the same error!

rakuco commented 8 years ago

@vrotenberg: what do you get when you run git branch -v on src/ itself?

vrotenberg commented 8 years ago

I get master 42ab10e [behind 29] Add missing dependency from Blink IDLs to generated code aggregation

rakuco commented 8 years ago

OK, and did you add ozone-wayland into src/ after you had already checked out Chromium or did you start with ozone-wayland and check out Chromium as an ozone-wayland dependency?

Looking at the patching script, if your master branch is pointing at something other than the hash in "chromium_rev", patch-chromium.sh will create a "master-ozone" branch from it using this wrong hash. As a workaround, I suggest you:

  1. Check out your master branch
  2. Reset it to the right hash (git reset --hard e82a7af9d123ad8d8dd629a641d21f961e2b1346)
  3. Run patch-chromium.sh again

It will recreate the "master-ozone" branch using e82a7af9d123ad8d8dd629a641d21f961e2b1346 as a base. I haven't tried it locally, but it should work.

vrotenberg commented 8 years ago

Oh, thank you so much! Now the patching was successful! Thanks!!!

rakuco commented 8 years ago

I'm glad to know it worked; I'm leaving this issue open in case Kalyan or Joone want to do something to make patch-chromium.sh more resilient.

vrotenberg commented 8 years ago

If you can be so kind to answer another question? I want to build chrome for wayland for the 32 bit Linux machine. So in order to compile the chromium I run on x64 bit machine export GYP_DEFINES='component=static_library use_ash=1 use_aura=1 chromeos=0 use_ozone=1 use_xkbcommon=1 proprietary_codecs=1 ffmpeg_branding=Chrome target_arch=ia32' So as I understand because of parameter target_arch=ia32 everything should be correct?

rakuco commented 8 years ago

For a pure Chromium build, that should work, in particular if you use Chromium's sysroot approach (basically building within a Debian Wheezy i386 chroot instead of using your system's packages).

I'm not sure if the Ozone build is covered by that approach though, as it requires some library versions newer than the ones present in Debian Wheezy, plus Wayland is not part of the chroot.

Depending on what distro you are running, you might get away with just passing use_sysroot=0 to gyp and installing 32-bit versions of all required packages. From experience, I know the latter in particular is much easier on Fedora than in Debian-based distros, where several :i386 packages conflict with their amd64 counterparts.

vrotenberg commented 8 years ago

Thank you for reply. So my GYP_DEFINES should be like component=static_library use_ash=1 use_aura=1 chromeos=0 use_ozone=1 use_xkbcommon=1 proprietary_codecs=1 ffmpeg_branding=Chrome use_sysroot=0 instead of component=static_library use_ash=1 use_aura=1 chromeos=0 use_ozone=1 use_xkbcommon=1 proprietary_codecs=1 ffmpeg_branding=Chrome target_arch=ia32? What packeges are required for 32-bit version? Do you have any article about it? Can I run the building directly on the 32-bit machine. Specially I need chromium for Gentoo and Ubuntu distr.

rakuco commented 8 years ago

So my GYP_DEFINES should be like component=static_library use_ash=1 use_aura=1 chromeos=0 use_ozone=1 use_xkbcommon=1 proprietary_codecs=1 ffmpeg_branding=Chrome use_sysroot=0 instead of component=static_library use_ash=1 use_aura=1 chromeos=0 use_ozone=1 use_xkbcommon=1 proprietary_codecs=1 ffmpeg_branding=Chrome target_arch=ia32?

Yes, you need to set at least target_arch and use_sysroot.

What packeges are required for 32-bit version? Do you have any article about it? Can I run the building directly on the 32-bit machine. Specially I need chromium for Gentoo and Ubuntu distr.

Are you a distro packager? If that's the case I suggest not installing anything, seeing which software gyp complains about, then installing that, so on and so forth. You can check a minimal list of packages required by a Debian-based distro in src/build/linux/sysroot_scripts/packagelist*, or the src/build/install-build-deps.sh script, or even looking at the src/docs directory (which can be outdated).

With that said, if your intention is to create distro packages, you probably also want to disable Chromium's bundled clang with clang=0 and using your distro's compiler instead. Plus if you have enough memory, you can also try just building your 32-bit packages with a 32-bit userland/kernel too, which makes things easier.

rakuco commented 8 years ago

In any case, we're hijacking this issue with something totally unrelated :-) If you'd like to continue this discussion, I suggest the chromium-packager and chromium-dev mailing lists (which I also subscribe to).

vrotenberg commented 8 years ago

Thanks a lot!!!