flypig.co.uk

List items

Items from the current list are shown below.

Gecko

1 Oct 2023 : Day 46 #
We hit an important milestone yesterday with the generation of our first set of complete rpm packages that could — theoretically — be installed on a device. I'll test that theory later today.

But before I get into that I want to fist give a big shout out to Thigg, who created (with a little AI help) this amazing picture showing the inside of the lab at flypig HQ.
 
A pig with wings dressed as a doctor fixing the limb of a gecko with a bandage on a surgery table. Comic style.

It's an astonishingly accurate representation! I want to give the description Thigg gave of the prompt in full because I think it's just brilliant.
 
"A pig with wings dressed as a doctor fixing the limb of a gecko with a bandage on a surgery table. Comic style" ... Did i specify pig without legs…?

I've said it before, but I'll say it again. Feedback like this is by far the best motivation. It reaffirms what I've always known to be true, which is that the Sailfish community is just great! I'm going to carry straight on because we have a lot to get through today.

So, from yesterday we have a set of packages, but the version numbering on the packages is incorrect because I set it running with a faulty build configuration.

Overnight I ran it with the configuration adjusted, and this morning I can see we have some better results.
Processing files: xulrunner-qt5-misc-91.9.1-1.aarch64
warning: absolute symlink: /usr/bin/xulrunner-qt5 -> /home/flypig/Programs/
         sailfish-sdk/sailfish-sdk/mersdk/targets/SailfishOS-devel-aarch64.default/
         usr/lib64/xulrunner-qt5-91.9.1/xulrunner-qt5
Provides: xulrunner-qt5-misc = 91.9.1-1 xulrunner-qt5-misc(aarch-64) = 91.9.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests)
                  <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: xulrunner-qt5-debuginfo-91.9.1-1.aarch64
Provides: debuginfo(build-id) = 19a5cafc6a2d227874330bb042601dcb29564851
          debuginfo(build-id) = 5d45fc4b8f12fda685eb62a8fe5f568f9510c8fa
          debuginfo(build-id) = 73026cf7982ef61f8707c3e0f1459f3892784c86
          debuginfo(build-id) = f309784dbe98020d6ab529f9d645caca0860d065
          debuginfo(build-id) = fa071e3777327733d34f625430b1a3cc5ce5f28c
          xulrunner-qt5-debuginfo = 91.9.1-1 xulrunner-qt5-debuginfo(aarch-64)
          = 91.9.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests)
                  <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Recommends: xulrunner-qt5-debugsource(aarch-64) = 91.9.1-1
Processing files: xulrunner-qt5-debugsource-91.9.1-1.aarch64
Provides: xulrunner-qt5-debugsource = 91.9.1-1
          xulrunner-qt5-debugsource(aarch-64) = 91.9.1-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests)
                  <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /home/flypig/Programs/sailfish-sdk/
                                 sailfish-sdk/mersdk/targets/
                                 SailfishOS-devel-aarch64.default/usr/lib/rpm/
                                 check-files /home/deploy/installroot
Wrote: /home/flypig/RPMS/SailfishOS-devel-aarch64/xulrunner-qt5-devel-91.9.1-1.aarch64.rpm
Wrote: /home/flypig/RPMS/SailfishOS-devel-aarch64/xulrunner-qt5-misc-91.9.1-1.aarch64.rpm
Wrote: /home/flypig/RPMS/SailfishOS-devel-aarch64/xulrunner-qt5-91.9.1-1.aarch64.rpm
Wrote: /home/flypig/RPMS/SailfishOS-devel-aarch64/xulrunner-qt5-debugsource-91.9.1-1.aarch64.rpm
Wrote: /home/flypig/RPMS/SailfishOS-devel-aarch64/xulrunner-qt5-debuginfo-91.9.1-1.aarch64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.9I0Dnw
+ umask 022
+ cd ${PROJECT}/gecko-dev
+ /bin/rm -rf /home/deploy/installroot
+ RPM_EC=0
++ jobs -p
+ exit 0
Let's take a quick look at those packages.
$ pushd ~/RPMS/SailfishOS-devel-aarch64/
$ ls -lh x*
-rw-rw-r-- 1 flypig 100000  34M Sep 27 00:08 xulrunner-qt5-91.9.1-1.aarch64.rpm
-rw-rw-r-- 1 flypig 100000 644M Sep 27 00:19 xulrunner-qt5-debuginfo-91.9.1-1.aarch64.rpm
-rw-rw-r-- 1 flypig 100000  26M Sep 27 00:08 xulrunner-qt5-debugsource-91.9.1-1.aarch64.rpm
-rw-rw-r-- 1 flypig 100000 6.5M Sep 27 00:07 xulrunner-qt5-devel-91.9.1-1.aarch64.rpm
-rw-rw-r-- 1 flypig 100000  16K Sep 27 00:07 xulrunner-qt5-misc-91.9.1-1.aarch64.rpm
$ mkdir temp
$ pushd temp
$ rpm2cpio ../xulrunner-qt5-91.9.1-1.aarch64.rpm | cpio -idmv
$ tree -sh
[4.0K]  .
└── [4.0K]  usr
    └── [4.0K]  lib64
        └── [4.0K]  xulrunner-qt5-91.9.1
            ├── [4.0K]  defaults
            ├── [  25]  dependentlibs.list
            ├── [  18]  dictionaries -> /usr/share/myspell
            ├── [ 66K]  liblgpllibs.so
            ├── [324K]  libmozavcodec.so
            ├── [259K]  libmozavutil.so
            ├── [ 95M]  libxul.so
            ├── [ 26M]  omni.ja
            ├── [  48]  platform.ini
            └── [451K]  plugin-container

4 directories, 9 files
$ rm -rf usr/
$ rpm2cpio ../xulrunner-qt5-debuginfo-91.9.1-1.aarch64.rpm | cpio -idmv
$ tree -sh
[4.0K]  .
└── [4.0K]  usr
    └── [4.0K]  lib
        └── [4.0K]  debug
            └── [4.0K]  usr
                └── [4.0K]  lib64
                    └── [4.0K]  xulrunner-qt5-91.9.1
                        ├── [205K]  liblgpllibs.so-91.9.1-1.aarch64.debug
                        ├── [1.3M]  libmozavcodec.so-91.9.1-1.aarch64.debug
                        ├── [595K]  libmozavutil.so-91.9.1-1.aarch64.debug
                        ├── [2.6G]  libxul.so-91.9.1-1.aarch64.debug
                        └── [10.0M]  plugin-container-91.9.1-1.aarch64.debug

6 directories, 5 files
$ popd
$ popd
Those are the content of the two most important packages. I'll skip the others because they contained a large number of small files; not very convenient or useful to show here.

Let's compare that with the latest version from the Jolla repositories. Just so you know, kolbe is the name of my phone.
$ ssh kolbe
$ mkdir cache
$ cd cache
$ zypper --pkg-cache-dir . download xulrunner-qt5 xulrunner-qt5-debuginfo xulrunner-qt5-debugsource xulrunner-qt5-devel xulrunner-q
t5-misc
$ cd jolla/oss/aarch64/
$ ls -lh
total 765M   
-rw-r--r--    1 defaultu defaultu   38.1M Sep 27 08:15 xulrunner-qt5-78.15.1+git33.2-1.21.1.jolla.aarch64.rpm
-rw-r--r--    1 defaultu defaultu  692.5M Sep 27 08:19 xulrunner-qt5-debuginfo-78.15.1+git33.2-1.21.1.jolla.aarch64.rpm
-rw-r--r--    1 defaultu defaultu   28.1M Sep 27 08:19 xulrunner-qt5-debugsource-78.15.1+git33.2-1.21.1.jolla.aarch64.rpm
-rw-r--r--    1 defaultu defaultu    6.3M Sep 27 08:19 xulrunner-qt5-devel-78.15.1+git33.2-1.21.1.jolla.aarch64.rpm
-rw-r--r--    1 defaultu defaultu   68.6K Sep 27 08:19 xulrunner-qt5-misc-78.15.1+git33.2-1.21.1.jolla.aarch64.rpm
$ mkdir temp
$ cd temp/
$ rpm2cpio ../xulrunner-qt5-78.15.1\+git33.2-1.21.1.jolla.aarch64.rpm | cpio -idmv

$ ~/tree -lh
[4.0K]  .
└── [4.0K]  usr
    └── [4.0K]  lib64
        └── [4.0K]  xulrunner-qt5-78.15.1
            ├── [4.0K]  defaults
            ├── [  10]  dependentlibs.list
            ├── [  18]  dictionaries -> /usr/share/myspell
            ├── [ 38K]  liblgpllibs.so
            ├── [260K]  libmozavcodec.so
            ├── [203K]  libmozavutil.so
            ├── [101M]  libxul.so
            ├── [ 25M]  omni.ja
            ├── [  49]  platform.ini
            └── [460K]  plugin-container

5 directories, 9 files
$ rm -rf usr/
$ rpm2cpio ../xulrunner-qt5-debuginfo-78.15.1\+git33.2-1.21.1.jolla.aarch64.rpm | cpio -idmv
$ ~/tree -lh
[4.0K]  .
└── [4.0K]  usr
    └── [4.0K]  lib
        └── [4.0K]  debug
            └── [4.0K]  usr
                └── [4.0K]  lib64
                    └── [4.0K]  xulrunner-qt5-78.15.1
                        ├── [214K]  liblgpllibs.so-78.15.1+git33.2-1.21.1.jolla.aarch64.debug
                        ├── [1.3M]  libmozavcodec.so-78.15.1+git33.2-1.21.1.jolla.aarch64.debug
                        ├── [621K]  libmozavutil.so-78.15.1+git33.2-1.21.1.jolla.aarch64.debug
                        └── [2.1G]  libxul.so-78.15.1+git33.2-1.21.1.jolla.aarch64.debug

7 directories, 4 files
$ cd ../../../../..
$ rm -rf cache/
The contents certainly look similar enough to be plausible. The key part is the libxul.so file. It'll be interesting to see what happens when we try to use this. I'm not expecting good results, most likely a complete failure of the executable when it tries to link against it. Even if it runs, I'm certainly not expecting it to render. But we have to take this one issue at a time. Baby steps (or as DrYak aptly puts it, "inching closer...").

So, let's give this a go and see what happens. I'm using a development Xperia 10 II rather than my daily phone. It's aarch64 running the latest Sailfish OS 4.5.0.24, so be able to run the code we've built.

Let's start by getting the packages on the phone:
$ scp xulrunner-qt5-*.rpm defaultuser@192.168.2.15:~
xulrunner-qt5-91.9.1-1.aarch64.rpm                 100%   33MB  19.5MB/s   00:01    
xulrunner-qt5-debuginfo-91.9.1-1.aarch64.rpm       100%  643MB  18.5MB/s   00:34    
xulrunner-qt5-debugsource-91.9.1-1.aarch64.rpm     100%   26MB  17.5MB/s   00:01    
xulrunner-qt5-devel-91.9.1-1.aarch64.rpm           100% 6604KB  17.7MB/s   00:00    
xulrunner-qt5-misc-91.9.1-1.aarch64.rpm            100%   16KB   6.8MB/s   00:00
Now let's try installing them while maintaining low expectations.
$ ssh defaultuser@192.168.2.15
Last login: Wed Sep  6 08:38:23 2023 from 192.168.2.7
,---
| Sailfish OS 4.5.0.24 (Struven ketju)
'---
$ ls -lh x*
-rw-r--r--    1 defaultu defaultu   33.5M Sep 27 18:55 xulrunner-qt5-91.9.1-1.aarch64.rpm
-rw-r--r--    1 defaultu defaultu  643.1M Sep 27 18:56 xulrunner-qt5-debuginfo-91.9.1-1.aarch64.rpm
-rw-r--r--    1 defaultu defaultu   25.7M Sep 27 18:56 xulrunner-qt5-debugsource-91.9.1-1.aarch64.rpm
-rw-r--r--    1 defaultu defaultu    6.4M Sep 27 18:56 xulrunner-qt5-devel-91.9.1-1.aarch64.rpm
-rw-r--r--    1 defaultu defaultu   15.6K Sep 27 18:56 xulrunner-qt5-misc-91.9.1-1.aarch64.rpm
$ devel-su 
$ rpm -U xulrunner-qt5-91.9.1-1.aarch64.rpm
error: Failed dependencies:
        libxul.so(xul78)(64bit) is needed by (installed) qtmozembed-qt5-1.53.25-1.23.1.jolla.aarch64
        libxul.so(xul78)(64bit) is needed by (installed) mapplauncherd-booster-browser-0.2.1-1.8.1.jolla.aarch64
That's an abrupt halt. It looks like I'll need to build QtMozEmbed and the browser booster against the new library. That sounds achievable. I'll do it by creating a new temporary snapshot and building them both in it.
cd qtmozembed
$ # Update the spec so it's forced to pull in the new xulrunner package
$ sed -i -e "s/60\.9\.1/90\.9\.1/g" rpm/qtmozembed-qt5.spec
$ sfdk -c snapshot=temp build -d -p
Unfortunately it won't immediately build because of the packages it needs installed. I'm never quite certain why it won't install them automatically (they're all available from the repos) but there it is.
error: Failed build dependencies:
        pkgconfig(Qt5QuickTest) is needed by qtmozembed-qt5-1.53.25+master.20230927180924.0decaf4-1.aarch64
        pkgconfig(nspr) >= 4.13.1 is needed by qtmozembed-qt5-1.53.25+master.20230927180924.0decaf4-1.aarch64
        pkgconfig(pixman-1) >= 0.19.2 is needed by qtmozembed-qt5-1.53.25+master.20230927180924.0decaf4-1.aarch64
        xulrunner-qt5-devel >= 90.9.1 is needed by qtmozembed-qt5-1.53.25+master.20230927180924.0decaf4-1.aarch64
Instead I'll have to install them manually.
$ sfdk engine exec
$ sb2 -R -m sdk-install -t SailfishOS-devel-aarch64.temp
$ cd /home/flypig/RPMS/SailfishOS-devel-aarch64
$ rpm -U nspr-devel-4.35.0-1.aarch64.rpm nspr-4.35.0-1.aarch64.rpm
$ zypper install qt5-qtdeclarative-qtquicktest-devel pixman-devel nss-devel
$ rpm -U xulrunner-qt5-devel-91.9.1-1.aarch64.rpm xulrunner-qt5-91.9.1-1.aarch64.rpm 
$ exit
$ exit
Now we can try the build again.
$ sfdk -c snapshot=temp -c no-pull-build-requires build -d -p
The build now fails, but at least in an interesting way. I've copied out some of the more interesting and representative errors below (but also left a load out given there were so many):
usr/include/xulrunner-qt5-91.9.1/mozilla/MaybeStorageBase.:16:
  Parse error at "mozilla"
make[1]: *** [Makefile:566: ../src/moc/release_static/moc_qmozview_p.cpp] Error 1
make[1]: *** Waiting for unfinished jobs....
qmozcontext.cpp:31:10: fatal error: mozilla/embedlite/EmbedInitGlue.h:
  No such file or directory
 #include "mozilla/embedlite/EmbedInitGlue.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:608: ../src/qmozcontext.o] Error 1
EmbedQtKeyUtils.cpp: In static member function ‘static int
  MozKey::QtKeyCodeToDOMKeyCode(int, int)’:
EmbedQtKeyUtils.cpp:365:21: error: ‘ArrayLength’ was not declared in this scope
     for (i = 0; i < ArrayLength(nsKeycodes); i++) {
                     ^~~~~~~~~~~
EmbedQtKeyUtils.cpp: In static member function ‘static int
  MozKey::DOMKeyCodeToQtKeyCode(int)’:
EmbedQtKeyUtils.cpp:386:17: warning: comparison of integer expressions of
  different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
     if (aKeysym >= dom::KeyboardEventBinding::DOM_VK_A && aKeysym <= dom::KeyboardEventBinding::DOM_VK_Z) {
         ~~~~~~~~^~~~~~
EmbedQtKeyUtils.cpp:386:67: warning: comparison of integer expressions of
  different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
     if (aKeysym >= dom::KeyboardEventBinding::DOM_VK_A && aKeysym <= dom::KeyboardEventBinding::DOM_VK_Z) {
                                                           ~~~~~~~~^~~~~~
EmbedQtKeyUtils.cpp:392:17: warning: comparison of integer expressions of
[...]
make[1]: *** [Makefile:630: ../src/EmbedQtKeyUtils.o] Error 1
qopenglwebpage.cpp: In destructor ‘virtual QOpenGLWebPage::~QOpenGLWebPage()’:
qopenglwebpage.cpp:76:36: error: no matching function for call to
  ‘mozilla::embedlite::EmbedLiteView::SetIsActive(bool)’
         d->mView->SetIsActive(false);
                                    ^
[...]
/home/flypig/Programs/sailfish-sdk/sailfish-sdk/mersdk/targets/
  SailfishOS-devel-aarch64.temp/usr/include/xulrunner-qt5-91.9.1/mozilla/
  embedlite/EmbedLiteView.h:83:16: note:
  candidate expects 2 arguments, 1 provided
make[1]: *** [Makefile:665: ../src/qopenglwebpage.o] Error 1
qmozview_p.cpp: In member function ‘void QMozViewPrivate::goBack()’:
qmozview_p.cpp:444:19: error: no matching function for call to
  ‘mozilla::embedlite::EmbedLiteView::GoBack()’
     mView->GoBack();
                   ^
[...]
make[1]: *** [Makefile:689: ../src/quickmozview.o] Error 1
make[1]: Leaving directory '/home/flypig/Documents/Development/jolla/qtmozembed/src'
make: *** [Makefile:45: sub-src-make_first-ordered] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.EBjdEW (%build)
It's immediately clear that these errors are due to the library interface having changed! In fact most of these errors are due to changes I made myself. That means there's going to be a bit more work to be done to fix these errors before it'll be possible to test the library.

That's okay, that's the whole point of doing these checks. But that's not going to be work for today, it's something that will have to wait until tomorrow.

As always, if you want to read more about all this gecko stuff, take a look at my full Gecko Dev Diary.

Comments

Uncover Disqus comments