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

error running on ubuntu 24.04 #44

Open
benitogf opened this issue May 6, 2024 · 7 comments
Open

error running on ubuntu 24.04 #44

benitogf opened this issue May 6, 2024 · 7 comments

Comments

@benitogf
Copy link

benitogf commented May 6, 2024

I tried running on ubuntu 24.04 and the binary fails to find the libraries

error while loading shared libraries: libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory

think 24.04 uses a different version

root@idx-benito-machine /h/idx# apt install libgtk-3-bin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgtk-3-bin is already the newest version (3.24.41-4ubuntu1).
libgtk-3-bin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@idx-benito-machine /h/idx# apt install libwebkit2gtk-4.1-0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libwebkit2gtk-4.1-0 is already the newest version (2.44.0-2).
libwebkit2gtk-4.1-0 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@SteffenL
Copy link
Contributor

SteffenL commented May 6, 2024

I had a quick peek and as you say, the packages for libwebkit2gtk-4.0 are unavailable for Ubuntu 24.04. Also, packages for libwebkit2gtk-4.1 are unavailable for Ubuntu 20.04.

If we change this line in webview.go:

-#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.0
+#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.1

Then the Go package can't work on Ubuntu 20.04.

So it seems like we need to do this:

-#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.0
+#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0

Or remove the whole line.

But that would break the normal Go workflow.

We would need to inform users on how to make this work by setting variables for "cgo" (CGO_CFLAGS, CGO_CXXFLAGS, CGO_LDFLAGS, CGO_ENABLED), or I imagine we would need to dynamically choose which webkit2gtk library to use.

If there's another, better way then I would love to learn more about it. Otherwise, I'm not sure how to make this work seamlessly for Go.

Maybe it isn't possible to make it seamless but I would love to be proven wrong.

Ideas as more than welcome.

@danielsatanik
Copy link

I don't have an issue setting env vars, how would that work?

@benitogf
Copy link
Author

benitogf commented May 7, 2024

20.04 eol is april 2025, maybe we can make a branch with this change to support 24.04 until then?

@nimeshnsat
Copy link

webkit2gtk-4.1 is available for 20.04 LTS is as well. One option is to specify webkit2gtk-4.1 as a dependency through the installer of the application (example: https://www.debian.org/doc/debian-policy/ch-relationships.html )

nimeshnsat added a commit to nimeshnsat/webview_go that referenced this issue May 13, 2024
Use webkit2gtk-4.1 instead of webkit2gtk-4.0
@SteffenL
Copy link
Contributor

@nimeshnsat Can you please explain how you determined that webkit2gtk-4.1 is available for Ubuntu 20.04?

@nimeshnsat
Copy link

My bad 😢 . Apperently, I've upgraded my 20.04 LTS to 22.04 LTS sometime back. So technically I'm on 22.04.1 now.

Today I've created a VM with 20.04 and tested from the scratch. I can confirm it doesn't support 4.1

Trace from my 22.04 (seems like it is available under security updates)

# uname -a

Linux ubuntu-20 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

# sudo apt search libwebkit2gtk-4.1

Sorting... Done

Full Text Search... Done

libwebkit2gtk-4.1-0/jammy-updates,jammy-security,now 2.44.0-0ubuntu0.22.04.1 amd64 [installed]

  Web content engine library for GTK



libwebkit2gtk-4.1-dev/jammy-updates,jammy-security,now 2.44.0-0ubuntu0.22.04.1 amd64 [installed]

  Web content engine library for GTK - development files

@SteffenL
Copy link
Contributor

All right, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants