Simulator support for Ubuntu 24.04

I am uncertain if this can be considered a bug, or a feature request.

I initially posted detail of the issue in the SDK Get Help category:
https://devforum.play.date/t/issue-while-launching-the-playdate-simulator-on-ubuntu-24-04/

While running the latest SDK (2.4.2) on Ubuntu 24.04, attempting to launch the simulator results in the following error:

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

It appears that the package version requested is not part of the OS and appears to be unavailable from the Ubuntu 24.04 repositories.

I tried running:

sudo apt-get install libwebkit2gtk-4.0-37

Which gave:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libwebkit2gtk-4.0-37
E: Couldn't find any package by glob 'libwebkit2gtk-4.0-37'
E: Couldn't find any package by regex 'libwebkit2gtk-4.0-37'

Running the following command, to check what is available:

apt-cache search libwebkit

Returns:

libwebkit2gtk-4.0-doc - WebKitGTK documentation (transitional dummy package)
libwebkit2gtk-4.1-0 - Web content engine library for GTK
libwebkitgtk-6.0-4 - Web content engine library for GTK
libwebkitgtk-doc - Web content engine library for GTK - documentation
libwebkit2gtk-4.1-dev - Web content engine library for GTK - development files
libwebkitgtk-6.0-dev - Web content engine library for GTK - development files

main, universe, restricted and multiverse repositories are enabled.

Does the SDK need to be updated to work with the more recent version of libwebkit2gtk supplied as part of Ubuntu 24.04?

Thanks for your help!

2 Likes

Thanks for the report! I'll add it to our bug tracker.

3 Likes

Could an AppImage (https://appimage.org/) be a solution for the Simulator ?

I was able to fix this issue with the simulator on Linux Mint and it should work for you.

I had two errors:

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

I fixed this by creating a symbolic link to have the simulator think it was opening libwebkit2gtk-4.0.so.37 but it was really opening what I have installed.

sudo ln -s /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37

Then I got a second error, but fixable in the same way.

./PlaydateSimulator: error while loading shared libraries: libjavascriptcoregtk-4.0.so.18: cannot open shared object file: No such file or directory

Created a symbolic link

sudo ln -s /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18

Not an ideal situation, but now the simulator runs!

4 Likes

I just realized this was from a year ago... :upside_down_face:

Yeah yeah. It was me resurrecting an old thread.
Btw, I eventually made an appimage.

version: 1

script:
  - mkdir -p $TARGET_APPDIR/bin $TARGET_APPDIR/lib/x86_64-linux-gnu
  - cp "$PLAYDATE_SDK_PATH/bin/PlaydateSimulator" $TARGET_APPDIR/bin
  - cp "$(dirname $RECIPE)/../dependencies/hashlink/libhl.so" $TARGET_APPDIR/lib/x86_64-linux-gnu
  - cp -R "$PLAYDATE_SDK_PATH/Disk" $TARGET_APPDIR

AppDir:
  app_info:
    id: panic.PlaydateSimulator
    name: playdate-simulator
    version: 2.6.2
    exec: bin/PlaydateSimulator
    exec_args: $@

  apt:
    arch: amd64
    sources:
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse'
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse'

    include:
      - libwebkit2gtk-4.0-37
      - libjavascriptcoregtk-4.0-18
      - libgdk-pixbuf2.0-0
      - librsvg2-common
      - shared-mime-info
    exclude:
      - adwaita-icon-theme
      - humanity-icon-theme

  files:
    exclude:
      - usr/lib/x86_64-linux-gnu/gconv
      - usr/share/man
      - usr/share/doc/*/README.*
      - usr/share/doc/*/changelog.*
      - usr/share/doc/*/NEWS.*
      - usr/share/doc/*/TODO.*

  after_bundle: |
    cp $TARGET_APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so $TARGET_APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so

  runtime:
    env:
      APPDIR_LIBRARY_PATH: '$APPDIR/lib/systemd:$APPDIR/lib/x86_64:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu/security:$APPDIR/usr/lib/aspell/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu/caca:$APPDIR/usr/lib/x86_64-linux-gnu/enchant-2:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/x86_64-linux-gnu/libv4l:$APPDIR/usr/lib/x86_64-linux-gnu/libv4l/plugins:$APPDIR/usr/lib/x86_64-linux-gnu/pulseaudio:$APPDIR/lib/x86_64'

AppImage:
  arch: amd64

Just dropping in to say this is still an issue in 2.7.2, would be nice to see it fixed! Thanks @lodomodev for the workaround :slight_smile:

1 Like

Hey there! I'm also dropping by to say that this is an issue on 2.7.2

Thanks so much for this it fixed the issue for me

We realize this is still an issue but no LTS version of Ubuntu supports 4.1 and 25.04 doesn't support 4.0. Other distros manage to support both, but Ubuntu put us in a bit of a bind. Flatpak etc have limitations which we'd need to spend a decent amount of time finding solutions for and it's hard to put a ton of time into packaging. All that said, we'd like to get this solved once and for all.

I'm also running into this when trying to get started with Playdate development.

What I don't quite get though from your message @willco is the following:

Because 24.04. is the current Ubuntu LTS version. And yes, it would be nice if this was just installable as a flatpak (or snap for ubuntu) from the software center.

I also got it to work now with yet a different hack :smiley:

I noticed that the versioning difference between webkit2gtk 4.0 and 4.1 seems to be only the libsoup version they are compiled against (libsoup2 vs libsoup3). The PlaydateSimulator itself doesn't link to libsoup, which led me to believe that it doesn't actually matter with which libweb2gtk version it runs (which is also confirmed by @lodomodev above by providing the (also hacky) library symlinks above.)

I didn't want to globally link libwebkit2gtk-4.1 to 4.0 on my system, so I instead used patchelf to replace the dynamic library loader entry in the Simulator binary:

$ ldd $PLAYDATE_SDK_PATH/bin/PlaydateSimulator  | grep "not found"
	libwebkit2gtk-4.0.so.37 => not found
	libjavascriptcoregtk-4.0.so.18 => not found
$ locate libwebkit2gtk-4.1 | grep '^/usr/lib/'
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0.17.8
$ patchelf --replace-needed libwebkit2gtk-4.0.so.37 libwebkit2gtk-4.1.so.0.17.8 $PLAYDATE_SDK_PATH/bin/PlaydateSimulator

And then again for libjavascriptcoregtk:

$ patchelf --replace-needed libjavascriptcoregtk-4.0.so.18 libjavascriptcoregtk-4.1.so.0.8.6 $PLAYDATE_SDK_PATH/bin/PlaydateSimulator

I think this is a better option to modifying the system, as it only makes changes to the playdate simulator binaries. The simulator seems to run fine now.

8 Likes

I meant to type 25.04. The non LTS versions don't support 4.0 while the LTS versions only support 4.0. Patching the binary is a good workaround.

I think I still don't understand your reasoning and I think all versions of ubuntu you might care about come with libwebkit2gtk-4.1. :thinking:

I went through the list of supported ubuntu releases:

  • 24.10 is a previous interim release that's basically out of support, so let's discard that.
  • 25.04 is the current interim release and comes with libwebkit2gtk-4.1-0
  • (25.10/questing currently also has libwebkit2gtk-4.1-0 but that might change before the release in Oct.)

That's the non-LTS versions out of the way, on to the LTS ones:

  • 24.04 has libwebkit2gtk-4.1-0 (and somehow an old docs package :person_shrugging: )
  • 22.04 has both actually (4.1 and 4.0). So Ubuntu actually has done a full LTS release cycle shipping both versions.
  • 20.04 is not available anymore on that package search site but on another one it is. But unsurprisingly it only has 4.0 because libsoup 3 was only released after April 2020. This was also 2 years before the initial release of the playdate.

Technically older releases (back to 16.04) still receive security updates... but this is getting silly. :smiley:

(discourse somehow isn't showing this as a reply to you, so explicitly adding a mention @willco)

OK, my version numbers aren't right. At some point in the past, the non-LTS version only included 4.1 while the LTS version only included 4.0. :slight_smile:

Hey all. Bubu's patchelf solution worked for me. Upvoting, and thanks! :slightly_smiling_face:

1 Like

Thank you so much Bubu <3

Worked for me on Pop_os 24.04, thank you! :saluting_face: