flypig.co.uk

List items

Items from the current list are shown below.

Gecko

31 Aug 2024 : Day 336 #
After spending the last few days arranging commits I'm happy to have two rather exciting tasks to perform today. The first is to convert all of the commits into patches. Once I've done that I'll be able to do a complete build from beginning to end, including the "prepare" step that applies the patches. If that goes through I can create a pull request into Jolla's repositories. I'm not expecting this to be a final release version, but I'm hoping it will provide a suitably stable base to apply any other changes on top of.

The second thing I have to do is test out the new libhybris packages that Frajo has kindly built and provided me with. He actually sent them to me a couple of days back but I've been so wrapped up with the commits that I didn't yet have a chance to test them.

The new packages came about following a discussion on GitHub started by Affe Null (affenull2345) and then contributed to by Mal (mlehtima)) and Frajo (krnlyng). Affe is a secret porter, in that they've developed their own private Samsung Galaxy A40 port. Pretty cool! But Affe also hit an issue when testing ESR 91, in that it triggered the same Wayland EGL dynamic library loading crash in spite of the workaround being present in qtmozembed.

Some brilliant investigation by the three of them led to the tweaking of libhybris to avoid the crash. But, even more exciting for me, is that if I'm reading the discussion correctly this may also have fixed the "cover" crash that's been troubling me for so long.

As far as I'm concerned this cover crash is currently the most serious unresolved issue with the ESR 91 build. Not having a cover is fine, but sadly it doesn't just affect the browser: it affects WebView apps as well. That means that apps — like for example the email app — that change their covers also seem to crash if they've previously been displaying a WebView. The workaround I added to qtmozembed won't work for these apps because it has to be executed when the app starts up. That works for the browser and "pure" WebView apps, but apps like the browser don't initialise the WebView until much later on in their execution. A proper fix is needed for these.

The symptoms that result for the email app is that it'll crash if you move to the homescreen and then try to move back in to the app after having read an email. This is horrible of course and it absolutely needs to be fixed.

Now all these things may not be related, but if they are, then it would be great to have them fixed. And maybe, just maybe, these new libhybris packages will do the trick.

But first things first: patches. Well nearly patches at any rate. It turns out that in order to generate the patches I first need to sort out the commits in the gecko-dev repository. That's different to the gecko-dev-mirror repository. It's the latter that I need to generate patches for and all of the commits there have been arranged. The gecko-dev repository contains the gecko-dev-mirror repository as a submodule. The patches are stored in the gecko-dev repository where they're applied to the submodule at the start of a build.

But the new commits I've made in the gecko-dev repository are still in a bit of a messy state. For example, every few commits I've created a separate commit updating the submodule. That was necessary for me to do a rebuild, but I don't really want to keep them all in the tree. My plan is to merge the submodule updates into a single commit which, eventually, will be entirely removed.

Here are all of the submodule update commits:
$ git log --oneline HEAD...9cb2ba8396d2~ -- gecko-dev/
f270bad5788e (HEAD -> sailfishos-esr91) Update gecko-dev mirror
5a68997c8450 Update gecko-dev mirror
515537b61413 Update gecko-dev mirror
08f9959dc235 Update gecko-dev mirror
14a2700021e5 Update gecko-dev mirror
67927c0423df Update gecko-dev mirror
2fea2e212b35 Update gecko-dev mirror
09260531aceb Update gecko-dev mirror
d30cd18ee613 Update gecko-dev mirror
5b9c330998db Restore GLScreenBuffer and TextureImageEGL
96d960d6a455 Update gecko-dev mirror
f803db211dfc Update gecko-dev mirror
720b4f6574e7 Convert AddBoolVarCache variables to static prefs
638ae4117394 Update gecko-dev mirror
f659dbc79934 Update gecko-dev mirror
2df29a103c6f (tag: sailfishos/91.9.1+git1) Update gecko-dev mirror
9d155ca9394f Update gecko-dev mirror
98ac90c53a12 Update gecko-dev mirror
6ecb2bad664b Update gecko-dev mirror
46fc26b5752c Update gecko-dev mirror
4d365de6c475 Update gecko-dev mirror
72638c7a9872 Update gecko-dev mirror
04cd443a0a5f Update gecko-dev submodule
75c281796b78 Update gecko-dev mirror
e4cea9f962a0 Rename nsIdleService to nsUserIdleService
d53c33b45ca6 Update submodule to incorporate recent changes
12cef49647fa Update gecko-dev mirror
1603f42a923d Add freetype2 include directory
91c0e1a7eeee Update gecko-dev submodule
There are quite a few of them. This list makes it look like they're all consecutive, but they're not, it's just that the commits in between these have been skipped.

My first attempt to consolidate all of these submodule commits into a single commit involved first trying to shift them all so that they are all consecutive. I used a git rebase -i to do this. Unfortunately this approach failed. Why? Because while all of these commits update the submodule, some of them do other things as well.

To resolve this I've determined to take any commit that both updates the submodule and makes changes into two commits: one to update the submodule, the other to apply the other changes.

My process for doing this is as follows:
  1. Execute git rebase -i 9cb2ba8396d2~. The commit always stays the same because it's the last commit before I made changes.
  2. Set the commit that needs splitting to edit.
  3. Execute git reset HEAD~ to reset the changes.
  4. Add the changes that don't relate to the submodule using git add.
  5. Commit these changes using git commit with the same commit message as the commit being edited.
  6. Add the submodule change using git add gecko-dev.
  7. Commit these changes using git commit -m "Update gecko-dev mirror".
  8. Continue the rebase with git rebase --continue.
  9. At this point it'll complain about a conflict, so reset the submodule with git reset <commit> -- gecko-dev where <commit> is the hash of the conflicting commit.
  10. Finally git rebase --continue.
That's quite a sequence, which is actually as laborious as it sounds. But there are actually only four commits that need splitting this way, so it could be worse. Now this is done I can corral all of the submodule update commits so they're consecutive. It doesn't really matter where the final single commit lives in the sequence because eventually the submodule is going to need to be reset back to ESR 91 HEAD. The patches that go on top of it will take it to the same place as this commit. But for the time being this commit needs to stay.
git rebase -i 9cb2ba8396d2~
After squashing all of the submodule commits together apart from the first and last I'm left with this rather ominous looking list of commits:
$ git log --oneline HEAD...9cb2ba8396d2~~
ab9cf7698875 (HEAD -> sailfishos-esr91) Update gecko-dev mirror
8725b48c1cf1 Set MOZ_USE_NATIVE_POPUP_WINDOWS as an environment variable
54b7a119188e Update patches
209beaa1221c Restore GLScreenBuffer and TextureImageEGL
f366c03302b6 Ensure the Session History is initialised.
f573fce46416 Support LOAD_FLAGS_FROM_EXTERNAL flag
5797043901a7 Introduce window hidden flag and expose isForPrinting through it
bb9c40a96b42 Convert AddBoolVarCache variables to static prefs
9ffa340e2d21 Default keyword.enabled to true
f8f4df84b0a3 Add appinfo annotations
dffb82220d0a [sailfishos][embedlite] Fix AsyncPanZoomController fling state...
2b4c467f0d42 Disable patch &quot;Fix 32-bit builds&quot;
2db5567ddbcd Fix 32-bit builds
b693fa1db02c Use system python executable
bc78ac45646d Add Qt5Widgets build dependency
54c54a463e86 Help ensure the window is active
a1f85adebda5 Set correct submodule path
3ce0728ceb34 Set compositor preferences correctly
5179dd071280 Build with only a single process
7967765674f7 Fix specfile versions
08230a27decd Hide SetIsActive() aActiveId parameter
cbf00e47117f Add missing Fission methods to nsIXULRuntime
3bc37a85f5b7 Add missing GetChromeOuterWindowID() implementation
b51363671814 Update WebBrowserChrome to align with upstream
293dbb9e8810 Move active flag handling explicitly to BrowsingContext
a19eb4d211de Have the main thread double-check APZ's consumable state
e12784b8e2f5 Apply refactoring from upstream
7dfb178cf4dd Reintroduce NS_APP_DISTRIBUTION_SEARCH_DIR_LIST
8ec4aa2fd581 Use mMessageListeners.GetOrInsertNew()
6dbb1073118a Switch APZEnentResult::mStatus for GetStatus()
d3f9a43a17a1 Move mShouldSendWebProgressEventsToParent activation
1a575c80c4a9 Remove NS_LITERAL_CSTRING usage
4f3891a7a746 Switch CSSRect to ZoomTarget
1807b74962b0 Rename nsBaseHashtable::Put to InsertOrUpdate
0caddae65dc2 Add aActionId parameter to SetIsActive
1479b47c142c Add user interaction parameter to GoForward and GoBack
b42962a118c6 Remove AffectPrivateSessionLifetime call
207faaaf245c Get outerWindowID from docShell rather than DOMWindowUtils
9f9aae313e1a Switch use of MOZ_MUST_USE for [[nodiscard]]
a23bd2c76713 Specify the BrowsingContextGroup
f68fadb53c6d Make `IMEState::Enabled` an enum class
a853d8864c7b Remove plugin support from layout
4bb3ecf92186 Avoid unnecessary array copies in NotifyLayerTransforms and...
6de2af56afe2 Support the GetFrameUniformity API in content processes
12069f25adc4 Add flag to CompositorOptions to allow SW-WR on a per widget basis
9d2582254e30 Use a message router for primary child process channels
add5a1974d00 Switch GLScreenBuffer for SwapChain
cf26a8ce1fbd Add _WITH_DELETE_ON_EVENT_TARGET macros to nsISupportsImpl
2b0b1ef5c57a Remove all AddBoolVarCache usage
cdb168d9f5a3 Remove use of NS_LITERAL_STRING
d8b7845b563c Expose nsIThread to nsClipboard
05431db1eb64 Remove ChromeOuterWindowID from MessageManager override
b9dec65db14a Switch use of MOZ_MUST_USE for [[nodiscard]]
7f64138b89e5 Switch from using nsDataHashtable to nsTHashMap
1594ad5e797a Rename nsIdleService to nsUserIdleService
fec0b0d4789c Reduce optimisation to O1
3460285ab906 Add freetype2 include directory
75cb7986205c Update gecko-dev submodule
696c3801cdbd Update EmbedLite IPDL syntax
0eacc60a27ee Switch from disabling marionette to disabling webdriver
9e3dc13725a9 Update spec for ESR 91.9.0
902d36af8868 Enable dialog element
1ae9e714a3b6 (tag: sailfishos/78.15.1+git35) Merge pull request #153 from...
880b89ac0f8d [sailfishos][gecko] Backport support for ffmpeg 5.0. JB#60117...
It's ominous, but all of the changes individually actually look quite sane now. So I think I'm going to say this is where things should be. So now it's time to generate the patches from the commits in gecko-dev-mirror. First off I need to actually generate all of the patches. I'll keep a backup of the ESR 78 patches as well, but I don't plan to commit them to the repository. During the last upgrade they were kept, so maybe I'll need to commit them too in due course. Nevertheless, generating the patches turns out to be pretty straightforward:
$ cd rpm
$ mkdir esr78-patches
$ mv *.patch esr78-patches/
$ cd ../gecko-dev/
$ git format-patch -o ../rpm -N --no-signature --zero-commit 78d17b06b04f
$ git rebase -i 9cb2ba8396d2~
The next step is to copy all of the patch filenames into the spec file so that the rpm builder knows what to apply. Then I can create a commit that contains all of the new patches:
$ cd ../rpm
$ git add *.patch
$ git commit
$ cd ../gecko-dev
$ git checkout FIREFOX_ESR_91_9_X_RELBRANCH
$ cd ..
$ git commit -m &quot;Update gecko-dev mirror&quot;
$ git rebase -i 9cb2ba8396d2~
$ git clean -xdf
Notice that I've also created a commit that resets the submodule to the head of FIREFOX_ESR_91_9_X_RELBRANCH. I've committed this change to the repository as well. The patches should bring FIREFOX_ESR_91_9_X_RELBRANCH all the way up to the same commit as the HEAD of FIREFOX_ESR_91_9_X_RELBRANCH_sfos.

Now I'm ready to do the test build.
sfdk build -d -p --with git_workaround
Rather excitingly, all of the patches apply one on top of the other without any glitches.
[...]
+ unset DISPLAY
+ /bin/cat ${PROJECT}/rpm/
    0001-sailfishos-gecko-Add-symlink-to-embedlite.-JB-52893.patch
+ patch -p1 -s --fuzz=2 --no-backup-if-mismatch
[546bceac6ff5] *sfdk-prepare* Add symlink to embedlite. JB#52893
 1 file changed, 1 insertion(+)
+ /bin/cat ${PROJECT}/rpm/0002-sailfishos-qt-Bring-back-Qt-layer.-JB-50505.patch
+ patch -p1 -s --fuzz=2 --no-backup-if-mismatch
[4aa4f2c0af0c] *sfdk-prepare* Bring back Qt layer. JB#50505
 109 files changed, 4780 insertions(+), 89 deletions(-)
[...]
+ /bin/cat ${PROJECT}/rpm/
    0078-sailfishos-embedlite-egl-Fix-mesa-egl-display-and-bu.patch
+ patch -p1 -s --fuzz=2 --no-backup-if-mismatch
[70128c619c7e] *sfdk-prepare* Fix mesa egl display and buffer initialisation
 1 file changed, 228 insertions(+), 7 deletions(-)
+ echo 'Target is aarch64-unknown-linux-gnu'
Target is aarch64-unknown-linux-gnu
[...]
Originally I'd planned to sort out the patches this morning, run the build during the day and then test out Frajo's new libhybris packages this evening. But unfortunately I didn't quite get everything done this morning, which means I couldn't run the build during the day, which means that the build will now have to run overnight tonight instead.

That's fine, but it means unfortunately I won't have time to test out Frajo's packages today. It'll be something to look forward to in the morning instead.

If you'd like to read any of my other gecko diary entries, they're all available on my Gecko-dev Diary page.

Comments

Uncover Disqus comments