Opened 6 months ago

Closed 6 months ago

#16291 closed defect (fixed)

New libraries shouldn't be added to "std" by default and webview should be removed from it

Reported by: ojwb Owned by: VZ
Priority: normal Milestone: 3.1.0
Component: WebView Version: 3.0.0
Keywords: Cc: steve.lamerton@…
Blocked By: Blocking:
Patch: no

Description

Here's the background to this issue:

In the latest upload of the debian packages of wxwidgets3.0, we enabled wxWebView. Because this pulls in a lot of extra dependencies (webkit, etc) we package this as separate binary packages, so only those wanting to use them need to install them. There are actually 3 packages: libwxgtk-webview3.0-0 (for the runtime library), libwxgtk-webview3.0-dev (for building apps using it), and libwxgtk-webview3.0-dbg (detached debug symbols).

Unfortunately, this change has caused many of the packages with build-dependencies on libwxgtk3.0-dev to fail to build from source (FTBFS) - the problem is that wx-config --libs without any libraries listed, or with std in the list of libraries, now includes the wx webview library in the list to link with, and that causes the link to fail unless libwxgtk-webview3.0-dev is also installed.

We don't want to merge libwxgtk-webview3.0-dev into libwxgtk3.0-dev, as libwxgtk-webview3.0-dev has to depend on libwxgtk-webview3.0-0 to work, which would require installing its large dependency stack to build any wx-using application.

It seems to me that webview shouldn't have been added to the list that "std" can expand to - even if you only consider builds from source, unless you use -Wl,--as-needed linking against the "std" libraries will result in your application being linked to all the libraries that expands to, which will increase the time it takes to load.

For similar reasons, I think it's better to encourage app authors to actually list the libraries their app needs when running wx-config --libs, so I would suggest that (contrary to the advice currently in docs/tech/tn0016.txt) new libraries should not be added to the std list. Perhaps in some cases it makes sense, but I'd suggest inclusion should be considered in each case.

I'd also suggest that the inclusion of webview in "std" be reconsidered for 3.0.1. I realise this is possibly controversial as it would mean an incompatible change for applications which link against webview and assume it's in the "std" list. But "webview" is new in wx3, so I doubt there are many users yet (the only one I know of so far is "boinc", and I've looked at a lot of wx-using apps as part of trying to eliminate wx 2.8 from Debian). Updating an app's build system to use wx-config --libs std,webview would work whether or not std included webview.

The alternative is that any binary package distro which enables webview will have to patch wx-config such that it expands "std" based on what wx development packages are installed. It seems that such a context-sensitive expansion of "std" is liable to surprise people (which is likely to mean that as upstream you'll end up fielding questions about it), and means what libraries get linked will behave differently depending on whether or not the wx webview development package is installed or not.

I've marked this for milestone 3.0.1 for now, since if webview is to be removed from std, that really needs to get done before more people start to use it.

I'm happy to provide patches for configure.in and/or docs/tech/tn0016.txt as appropriate - I've not done so yet, as what patches are needed depends on what of the above (if anything) you agree should be done.

Change History (5)

comment:1 Changed 6 months ago by ojwb

The alternative is that any binary package distro which enables webview will have to patch wx-config such that it expands "std" based on what wx development packages are installed. It seems that such a context-sensitive expansion of "std" is liable to surprise people (which is likely to mean that as upstream you'll end up fielding questions about it), and means what libraries get linked will behave differently depending on whether or not the wx webview development package is installed or not.

The build failures of packages using wxwidgets3.0 caused by this issue meant we needed to address this issue urgently, so for now I've implemented the idea above in Debian package version 3.0.0-4 - the patch to wx-config.in is here:

http://anonscm.debian.org/gitweb/?p=freewx/wx.git;a=blob;f=debian/patches/wx-config-conditionalise-webview-in-std.patch;h=f89e1d92b03a0526466c29073fd381fcff92442d;hb=4be375545823e8693c30e305effa92d030f643e0

I'd be happy to drop this for a better solution, but it is at least an improvement over lots of packages failing to build at all.

comment:2 Changed 6 months ago by vadz

  • Cc steve.lamerton@… added
  • Milestone changed from 3.0.1 to 3.1.0
  • Status changed from new to confirmed
  • Summary changed from New libraries shouldn't be added to "std" by default to New libraries shouldn't be added to "std" by default and webview should be removed from it

I totally agree that webview shouldn't be in std, I have no idea why was it added there, really. Maybe Steve (see r67705) really just followed docs/techn/tn0016.txt which indeed should be updated.

So I am pretty sure that we should remove "webview" from "std" in 3.1.0. But I'm much less certain about 3.0.1... Intentionally breaking compatibility like this just doesn't look like a good idea, even if it's simple to fix, we still want to be able to tell people that 3.0.1 is a drop in replacement for 3.0.0 -- and we'd be lying if we did this.

Any other thoughts?

comment:3 Changed 6 months ago by steve_lamerton

Yes, as far as I can remember I simply followed tn0016. I agree webview shouldn't be in the std library set and I would favour removing it even if it does cause some breakage for 3.0.1; it feels like we would have more problems in the long run if people get used to it being there.

comment:4 Changed 6 months ago by VZ

In 76615:

Don't advise people to make new libraries standard.

Update the instructions for adding the new library to not recommend to make
the new library standard, this is rarely, if ever, needed.

See #16291.

comment:5 Changed 6 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from confirmed to closed

In 76616:

Don't include "webview" in "standard" libraries.

This means wx-config --libs doesn't include webview in its output by default
any longer, it must be explicitly requested.

Closes #16291.

Note: See TracTickets for help on using tickets.