astroid icon indicating copy to clipboard operation
astroid copied to clipboard

Use GUri instead of libsoup-2.4 and use webkit2gtk-4.1

Open oreo639 opened this issue 11 months ago • 4 comments

This updates the URI parsing for astroid --mailto to use Glib instead of libsoup-2.0 (since the api was removed in libsoup-3.0).

https://libsoup.org/libsoup-3.0/migrating-from-libsoup-2.html https://github.com/astroidmail/astroid/issues/744

I tested the mailto parsing appears to work but please double check.

oreo639 avatar Mar 01 '24 21:03 oreo639

Does this WebKit version work?

gauteh avatar Mar 02 '24 18:03 gauteh

Does this WebKit version work?

As far as I can tell, but please double check. webkit2gtk-4.1 and webkit2gtk-4.0 are supposed to be, functionality wise and API wise, identical. (you have to explicitly opt in to -4.1 since it uses libsoup3 which cannot be loaded in to a process alongside libsoup2)

oreo639 avatar Mar 02 '24 20:03 oreo639

Would you prefer for both gui and soup2 to be supported? (e.g. --with-soup2) I did it this way to avoid ifdefs, but if you are still targeting Bionic I can add that. Or would you prefer the CI be updated to target newer releases?

(e.g. if --with-soup2 is specified, it will use soup-2.0 and disable the ability to use webkit2gtk-4.1 and without it, it will use guri and support both webkit2gtk-4.1 and webkit2gtk-4.0)

oreo639 avatar Apr 20 '24 01:04 oreo639

No need to support bionic.

lør. 20. apr. 2024, 03:29 skrev oreo639 @.***>:

Would you prefer for both gui and soup2 to be supported? (e.g. --with-soup2) I did it this way to avoid ifdefs, but if you are still targeting Bionic I can add that. Or would you prefer the CI be updated to target newer releases?

(e.g. if --with-soup2 is specified, it will use soup-2.0 and disable the ability to use webkit2gtk-4.1 and without it, it will use guri and support both webkit2gtk-4.1 and webkit2gtk-4.0)

— Reply to this email directly, view it on GitHub https://github.com/astroidmail/astroid/pull/745#issuecomment-2067501666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3637ZHVG4OYI5WY35ODY6HAI7AVCNFSM6AAAAABECOGH3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGUYDCNRWGY . You are receiving this because you commented.Message ID: @.***>

gauteh avatar Apr 20 '24 05:04 gauteh

This looks good, it works for me, with both webkit2gtk-4.1 and webkit2gtk-4.0. It is compatible with #734 and #747.

jorsn avatar Jun 03 '24 01:06 jorsn

Unfortunately, the CI is not active, here. I pushed it in my repo with some CI updates, and saw that it also breaks Debian bullseye (glib 2.66) and Ubuntu focal (2.64) (for versions see repology.

Should we support bullseye and/or focal? Both are still supported, but both glib versions are old and almost all distros seem to have glib >= 2.68.

jorsn avatar Jun 04 '24 07:06 jorsn

I recommend moving to Ubuntu and only supporting recent distros, we don't want to spend the effort we have available on oldish libraries.

gauteh avatar Jun 04 '24 07:06 gauteh

I recommend moving to Ubuntu and only supporting recent distros, we don't want to spend the effort we have available on oldish libraries.

Agreed, EOL distributions are of no interest to anyone.

ibuclaw avatar Jun 04 '24 22:06 ibuclaw

This looks to be identical to what I did as well to fix Astroid for webkit2gtk-4.1 (https://github.com/astroidmail/astroid/commit/cabdf83ec08c82f6eb44105667f62d3f287b334f), so this gets a :+1: from me.

ibuclaw avatar Jun 04 '24 22:06 ibuclaw

I submitted the competing #748. I'd be happy if you voice your opinions about it, compared to this one.

jorsn avatar Jun 04 '24 23:06 jorsn

Bullseye test fails because of missing G_URI_FLAGS_SCHEME_NORMALIZE, I added it because it is listed with the libsoup compatibility defines: https://gitlab.gnome.org/GNOME/libsoup/-/blob/a94a3a9a6ba14d6873c70f9931fe2d001442b14c/libsoup/soup-uri-utils.h#L40

However, for mailto links it should be useless as it only operates on these schemes: https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/guri.c#L760 https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/guri.c#L804 (e.g. it ensures that http://example.org becomes http://example.org:80/)

So I'll remove it.

oreo639 avatar Jun 04 '24 23:06 oreo639

When you change the PR, maybe you can also add the removal of ubuntu focal, since accepting this PR means dropping focal (which still has official support) from the CI.

jorsn avatar Jun 04 '24 23:06 jorsn

I merged my PR #748 now instead of this. Thank you for this, still! #748 was born out of a closer look at this PR, here, and noticing that there was mailto handling somewhere else that did not use soup/guri. So, I unified them, which solved also #744. I might not have noticed this without this PR.

jorsn avatar Jun 18 '24 23:06 jorsn