Page MenuHomeFreeBSD

Mk/Uses/gnome.mk: Switch to graphics/librsvg2-rust on tier 1 archs
Needs ReviewPublic

Authored by tobik on Jan 17 2019, 6:12 PM.

Details

Reviewers
None
Group Reviewers
gnome
Contributor Reviewers (ports)
O5: Ports Framework(Owns No Changed Paths)
portmgr
Summary

graphics/librsvg2 is stuck on the 2.40 branch due to newer versions requiring a Rust toolchain which we do not have on all tier 2 archs. I packaged a newer librsvg2 version as graphics/librsvg2-rust. It is now on a stable version 2.46.0 which was just released [1]. Let's switch to it on tier 1 archs. OpenBSD has been doing something similar for over a year now.

2.46.0 is ABI compatible with 2.40. However newer APIs are only implemented in newer librsvg2 versions and I suspect it is only a matter of time until someone runs into trouble porting some applications.

[1] https://download.gnome.org/sources/librsvg/2.46/librsvg-2.46.0.news

Test Plan

exp-run

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26379
Build 24839: arc lint + arc unit

Event Timeline

tobik created this revision.Jan 17 2019, 6:12 PM
tobik edited the summary of this revision. (Show Details)Jan 17 2019, 6:16 PM
mat added a comment.Jan 22 2019, 3:16 PM

Wouldn't it be better to have a USE_GNOME=librsvg2 that would do the right thing depending on the architecture, with some obscure knob that one could switch if they really want the non rust version on rust supported architectures.

tobik added a comment.Jan 22 2019, 6:31 PM
In D18878#404051, @mat wrote:

Wouldn't it be better to have a USE_GNOME=librsvg2 that would do the right thing depending on the architecture, with some obscure knob that one could switch if they really want the non rust version on rust supported architectures.

I have no way of knowing if switching all ports to USE_GNOME=librsvg2 instead of having librsvg2 in LIB_DEPENDS is the right thing to do. The way USE_GNOME=librsvg2 it's setup, it adds a couple of extra direct dependencies to those. Probably it would be fine, but I opted to do the dumb, safe thing here first.

As for LIBRSVG2_DEFAULT instead of an obscure knob: Why invent some non-standard knob when we have DEFAULT_VERSIONS? I though the ports framework is reducing its use of obscure knobs or similar not inventing new ones. Switching the default based on the architecture happens with LINUX_DEFAULT already. LINUX_DEFAULT is also only ever used in one place in USES=linux AFAICT.

mat added a comment.Jan 23 2019, 8:57 AM

First, USE_GNOME is standard, already exists, and is not obscure. It says "I need these GNOME components".

Then, of course, USE_GNOME=librsvg2 would need to add the correct dependencies wether it uses the legacy version or the new rust version, so this is not really an argument.

Adding a LIBRSVG2_DEFAULT means that both versions are interchangeable, like php, perl, python... If you do not know if graphics/librsvg2-rust works with the ports currently depending on graphics/librsvg2, then, well, I don't understand why you want to provide a knob that changes it globally, as it will possibly break everything.

tobik added a comment.Jan 23 2019, 9:43 AM

First, USE_GNOME is standard, already exists, and is not obscure. It says "I need these GNOME components".

What did you mean by the "obscure knob that one could switch if they really want the non rust version on rust supported architectures" you mentioned previously then?

In the first paragraph of my previous comment I'm only explaining why I did not switch all consumers to USE_GNOME=librsvg2 yet.

Then, of course, USE_GNOME=librsvg2 would need to add the correct dependencies wether it uses the legacy version or the new rust version, so this is not really an argument.

And how would it switch between the legacy and Rust version? You previously mentioned introducing an obscure knob for this, but something like LIBRSVG2_DEFAULT is IMHO a lot better.

Adding a LIBRSVG2_DEFAULT means that both versions are interchangeable, like php, perl, python... If you do not know if graphics/librsvg2-rust works with the ports currently depending on graphics/librsvg2, then, well, I don't understand why you want to provide a knob that changes it globally, as it will possibly break everything.

Since when are the different PHP, Perl, Python, SSL defaults completely interchangeable?

librsvg2-rust should be API and even ABI compatible [1] with librsvg2, so yes they are interchangeable. Even more so than LibreSSL vs. OpenSSL.

I'm not changing the default from graphics/librsvg2 at all here, so this breaks nothing. This is about making it possible to use graphics/librsvg2-rust if users want to opt into it and to make testing easier and nothing else. As mentioned in the summary.

[1] https://abi-laboratory.pro/?view=timeline&l=librsvg

mat added a comment.Jan 24 2019, 8:33 AM

Ok, so if the new is ABI compatible, why not simply add a USE_GNOME=librsvg2 and have gnome.mk choose which one to use depending on the arch? I only talked about an obscure knob because I did not know they were compatible. Is there a reason someone would want to use the legacy version and not the new one?

(I'm not talking about people who complain that jdk has a build depends on cups, or who are still backporting things to work with 8.4, I'm talking people we actually want to listen to.)

I am not against a LIBRSVG2_DEFAULT, I am just saying that the default choice should be done depending on the architecture, and wondering why someone would want to switch back.

tobik abandoned this revision.Apr 15 2019, 4:38 PM
tobik reclaimed this revision.Sep 10 2019, 7:05 AM

Reclaim after rP511743. librsvg2-rust is now at 2.46.0 (a stable version).

tobik updated this revision to Diff 61872.Sep 10 2019, 7:33 AM
  • Adopt approach suggested by @mat: Hook it up in USES=gnome only and use librsvg2-rust on tier 1 archs
  • Add :build and :run support for the librsvg2 component in USES=gnome. A couple of ports only need it at build or runtime.
  • Switch all consumers to USE_GNOME=librsvg2
  • Add librsvg2-rust to qa.sh
tobik retitled this revision from Mk/bsd.default-versions.mk: Add LIBRSVG2_DEFAULT to Mk/Uses/gnome.mk: Switch to graphics/librsvg2-rust on tier 1 archs.Sep 10 2019, 7:48 AM
tobik edited the summary of this revision. (Show Details)
tobik edited the test plan for this revision. (Show Details)
tobik updated this revision to Diff 61881.Sep 10 2019, 1:26 PM
  • Fix qa.sh integration
  • Use run dependency only in deskutils/shutter like before
tobik updated this revision to Diff 62031.Sep 13 2019, 12:51 PM
  • Rebase