Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a platform plug-in should not need libWPEBackend-default.so #11

Closed
aperezdc opened this issue May 15, 2018 · 5 comments
Closed

Using a platform plug-in should not need libWPEBackend-default.so #11

aperezdc opened this issue May 15, 2018 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@aperezdc
Copy link
Member

Currently, even if a platform plug-in is loaded (e.g. passing --platform=fdo in the command line), it is still needed to have around a libWPEBackend-default.so shared object, which typically is a symlink to the actual WPE backend being used.

Ideally, when using a Cog platform plug-in, libWPEBackend-default.so should not be needed at all — though of course it could be still be used when running without any platform plug-in.

@aperezdc aperezdc added bug Something isn't working enhancement New feature or request labels May 15, 2018
@clopez
Copy link
Contributor

clopez commented May 15, 2018

I confirm the issue.
To get cog working with fdo I need to run on the live system:

ln -s /usr/lib/libWPEBackend-fdo-0.1.so.0 /usr/lib/libWPEBackend-default.so

And then run cog as

cog -P fdo http://igalia.com

If i try to rung without specifying a platform value causes it crashes with

# cog http://igalia.com
(cog:895): Cog-DEBUG: platform_setup: Platform name: (null)
(cog:895): Cog-DEBUG: Instantiating default WPE backend as fall-back.

** (cog:895): CRITICAL **: WebKitWebViewBackend* webkit_web_view_backend_new(wpe_view_backend*, GDestroyNotify, gpointer): assertion 'backend' failed

(cog:895): Cog-ERROR **: Could not instantiate any WPE backend.

I wonder why platform is null? shouldn't default to fdo when cog has been built with fdo support?

@clopez
Copy link
Contributor

clopez commented May 15, 2018

Ideally, when using a Cog platform plug-in, libWPEBackend-default.so should not be needed at all — though of course it could be still be used when running without any platform plug-in.

dyz installs this files:

/usr/bin/dyz
/usr/lib/libWPEBackend-default.so
/usr/lib/libWPEBackend-dyz.so
/usr/lib/libwlglue.so

So I guess cog should as well install a libWPEBackend-default.so symlink? This means installing dyz and cog at the same time in a image will cause a conflict and won't be possible.
But I guess that is ok meanwhile a better solution is not found ?

I guess the right solution will be for wpebackend to allow passing a name to the symlink (either via API call or environment variable) instead of hardcoding the value here https://github.com/WebPlatformForEmbedded/WPEBackend/blob/master/src/loader.c#L59 (note the code block above that allows passing use an environment variable, but that only gets built on debug).

// Adding @zdobersek to the CC

clopez added a commit to clopez/cog that referenced this issue May 15, 2018
 * When building with fdo support (-DCOG_PLATFORM_FDO=ON) create
   and install a libWPEBackend-default.so symlink pointing to
   libWPEBackend-fdo-0.1.so.0.

 * Also default to platform fdo is no other one is specified via
   command line argument.
@clopez
Copy link
Contributor

clopez commented May 15, 2018

@macpijan can you update meta-webkit, rebuild and retry ? Is it fixed?
I already pushed for cog recipe in meta-webkit the patch that I sent here as PR
Igalia/meta-webkit@e984bde

@aperezdc
Copy link
Member Author

After giving this some thought, and discussing with @clopez by chat, ideally we would want the Cog platform plug-in to tell libWPEBackend which WPE backend library it should load. While using the environment variable might work, support for reading it is only available for debug-builds of libWPEBackend. The environment variable is not a great option, and it would be highly desirable that libWPEBackend would provide some API to either tell it which shared object to load as WPE backend.

aperezdc added a commit that referenced this issue May 16, 2018
Also, change the FDO platform to set with an environment variable
that "libWPEBackend-fdo.so" is to be used as WPE backend library.

Note that this is a proof-of-concept and needs either a debug
build of libWPEBackend, or a patched version which enables it to
check the WPE_BACKEND_LIBRARY environment variable.

With this applied (and a suitable libWPEBackend) it is not needed
to have a libWPEBackend-default.so file, and the following command
lines will work fine provided that the FDO and RDK backends are
installed:

  % cog -P fdo $URI
  % cog -P nil:backend=libWPEBackend-rdk.so $URI

Note that when using the "nil" platform plug-in, if the "backend"
parameter is not specified, then "libWPEBackend-default.so" is still
used. On the other hand, the "fdo" platform plug-in forces usage of
"libWPEBackend-fdo-0.1.so" because it cannot work with anything else.

This is proof-of-concept implementation of #11
aperezdc added a commit that referenced this issue Jun 12, 2018
Also, change the FDO platform to set with an environment variable
that "libWPEBackend-fdo.so" is to be used as WPE backend library.

Note that this is a proof-of-concept and needs either a debug
build of libWPEBackend, or a patched version which enables it to
check the WPE_BACKEND_LIBRARY environment variable.

With this applied (and a suitable libWPEBackend) it is not needed
to have a libWPEBackend-default.so file, and the following command
lines will work fine provided that the FDO and RDK backends are
installed:

  % cog -P fdo $URI
  % cog -P nil:backend=libWPEBackend-rdk.so $URI

Note that when using the "nil" platform plug-in, if the "backend"
parameter is not specified, then "libWPEBackend-default.so" is still
used. On the other hand, the "fdo" platform plug-in forces usage of
"libWPEBackend-fdo-0.1.so" because it cannot work with anything else.

This is proof-of-concept implementation of #11
@aperezdc
Copy link
Member Author

Like I mentioned in #12 already, I would rather go with the implementation proposed by @carlosgcampos in WebKit#186841 and WebPlatformForEmbedded/libwpe#18, which adds API to set the path to the WPE backend library, and passing it down to WPEWebProcess.

@aperezdc aperezdc self-assigned this Jul 11, 2018
@elima elima closed this as completed in #60 Sep 6, 2018
elima pushed a commit that referenced this issue Sep 6, 2018
bykov34 pushed a commit to bykov34/cog that referenced this issue Mar 14, 2024
This brings in utility functions to connect to and handle the
WebKitWebView::web-process-crashed signal by exiting the UI process
as well. Unfortunately we cannot use g_application_quit() because it
provides no way of specifying the exit code to be returned to the
system.

Fixes Igalia#11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants