Port ubiquity to libsoup3 - ubiquity crashes if gir1.2-soup-3.0 is installed in live system

Bug #1987454 reported by Jeremy Bícha
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ubiquity (Baltix)
Confirmed
Critical
Unassigned
ubiquity (Ubuntu)
Fix Released
High
Unassigned

Bug Description

libsoup3 is a new major API-incompatible release of libsoup. We want to remove libsoup2.4 from main. Even if we drop ubiquity from main, we want to remove libsoup2.4 from Ubuntu completely (Fedora for instance hopes to do this by late 2023.)

Therefore, ubiquity needs to switch to the newer library.

Prerequisites
-------------
You'll need libtimezonemap ported to libsoup3 (this was done in Debian Experimental but reverted because it was "broken")

Update debian/control to require that version.
Update debian/control and ubiquity/frontend/gtk_ui.py to use the 4.1 API of webkit2gtk instead of 4.0. Fortunately, there are no other changes required: the 4.1 API is the same as 4.0 except we're using libsoup3.

And update debian/control to use gir1.2-soup-3.0 instead of 2.4
There's another file d-i/update-control which should have its package versions updated too.

Error
-----
libsoup is only directly used briefly in ubi-timezone.py.

Traceback (most recent call last):
  File "/usr/lib/ubiquity/plugins/ubi-timezone.py", line 112, in changed
    self.geoname_session = Soup.SessionAsync()
  File "/usr/lib/python3/dist-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Soup' object has no attribute 'SessionAsync'

libsoup3 has dropped the SessionAsync methods. The documentation suggests that we should use GLib.MainLoop instead. Some of the examples I've seen also use dbus.mainloop.glib to help with using the glib loop.

Documentation
-------------
- https://libsoup.org/libsoup-3.0/client-basic.html
- https://libsoup.org/libsoup-3.0/migrating-from-libsoup-2.html
- https://gitlab.gnome.org/GNOME/libsoup/-/issues/218

Tags: patch

Related branches

summary: - Port ubiquity to libsoup3
+ Port ubiquity to libsoup3 - ubiquity crashes if gir1.2-soup-3.0 is
+ installed in live system
Changed in ubiquity (Baltix):
importance: Undecided → Critical
Changed in ubiquity (Baltix):
status: New → Confirmed
description: updated
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I'm working on this but during test time it fails with

  (run:58714): libsoup-ERROR **: 08:18:44.901: libsoup2 symbols detected. Using libsoup2 and libsoup3 in the same process is not supported.

despite having changed gir1.2-soup-2.4->gir1.2-soup-3.0 in debian/control and using gi.require_version('Soup', '3.0'). Any idea what is the problem and how to circumvent it?

I attach what I have so far but it's completely untested.

By the way, does Ubiquity have a VCS?

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "ubiquity-soup.diff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Jeremy Bícha (jbicha) wrote :

Nathan, I believe you will need libtimezonemap ported to use libsoup3 also. For testing, you could try using libtimezonemap 0.4.6-5 (which was uploaded to Debian Experimental but never to Ubuntu because of the incompatibility with ubiquity).

description: updated
Revision history for this message
Jeremy Bícha (jbicha) wrote :

Debian's libtimezonemap dropped the libsoup3 port because of issues identified at https://bugs.debian.org/1037940

Revision history for this message
Brian Murray (brian-murray) wrote :

I'm unsubscribing the Ubuntu Sponsors team given the current state of this work.

Revision history for this message
COLIN Stéphane (bigbob-fun) wrote :

This bug is completely blocking my ubuntu « OEM » image creation & deployment...

I work every day in « OEM » mode on a computer and use it as new image to install for new colleague hired.

I clone the current « OEM » mode on new computer then use the « Prepare for shipping to end user » icon on desktop to reboot on the wizard for new user...

But as of today, when executing the wizard, it hang at the timezone selection and I can't finish the process, ending with a bricked installation.

Do you have any workaround to be able to finish the wizard ?

Revision history for this message
COLIN Stéphane (bigbob-fun) wrote :

OK, found the countermeasure :

Switch to TTY and « sudo apt purge gir1.2-soup-3.0 ».

Then no more error inside the wizard...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 24.04.5

---------------
ubiquity (24.04.5) noble; urgency=medium

  [ Dave Jones ]
  * plugins/ubi-timezone.py: Update to support libsoup3 API (LP: #1987454)

 -- Steve Langasek <email address hidden> Sun, 14 Apr 2024 11:21:18 -0700

Changed in ubiquity (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.