Jump to content

How to make a 0ad AppImage


Recommended Posts

An appimage for 0.0.26-alpha is available

 

An appimage for 0.0.26-alpha (RC3-27067) release is available 0ad-0.0.26-rc3-27067-alpha AppImage

 

An appimage for the 0.0.25b-alpha release is available at 0ad-0.0.25b-alpha appimage

 

I've moved the how-to guide to the Wiki: https://trac.wildfiregames.com/wiki/BuildAndDeploymentEnvironment#LinuxAppImage

Edited by andy5995
  • Thanks 4
Link to comment
Share on other sites

5 hours ago, andy5995 said:

I don't have this working yet. I can build the appimage but when I run it:

 

Quote

./pyrogenesis: symbol lookup error: ./pyrogenesis: undefined symbol: _ZN4nvtt12InputOptions16setTextureLayoutENS_11TextureTypeEiiii

I've made edits to the post above, and using that info, the error directly above is gone.

 

Right now I think the only problem is the data can't be found when the appimage is run. I think that will be fixed after I rebuild specifying the relative path to --datadir.

Edited by andy5995
Link to comment
Share on other sites

This is where I'm at
 

Quote


$ ./0_A.D.-x86_64.AppImage
TIMER| InitVfs: 33.4227 ms
FILES| Main log written to '/home/andy/.config/0ad/logs/mainlog.html'
FILES| Interesting log written to '/home/andy/.config/0ad/logs/interestinglog.html'
TIMER| CONFIG_Init: 1.14333 ms
Sound: AlcInit success, using OpenAL Soft
ERROR: CVFSFile: file audio/sound_group.rng couldn't be opened (vfs_load: -110100)
ERROR: CXeromyces: failed adding validator for 'audio/sound_group.rng'
ERROR: CSoundManager: failed to load grammar file 'audio/sound_group.rng'
WARNING: Window icon not found.
ERROR: CVFSFile: file hwdetect/hwdetect.js couldn't be opened (vfs_load: -110100)
ERROR: Failed to load hardware detection script
TIMER| RunHardwareDetection: 821.107 us
FILES| Hardware details written to '/home/andy/.config/0ad/logs/system_info.txt'
TIMER| write_sys_info: 16.2474 ms
ERROR: CVFSFile: file gui/gui_page.rng couldn't be opened (vfs_load: -110100)
ERROR: CXeromyces: failed adding validator for 'gui/gui_page.rng'
ERROR: CGUIManager: failed to load GUI page grammar file 'gui/gui_page.rng'
ERROR: CVFSFile: file gui/gui.rng couldn't be opened (vfs_load: -110100)
ERROR: CXeromyces: failed adding validator for 'gui/gui.rng'
ERROR: CGUIManager: failed to load GUI XML grammar file 'gui/gui.rng'
WARNING: Unknown render path
ERROR: CVFSFile: file shaders/program.rng couldn't be opened (vfs_load: -110100)
ERROR: CXeromyces: failed adding validator for 'shaders/program.rng'
ERROR: CShaderManager: failed to load grammar shaders/program.rng
TIMER| InitRenderer: 11.0234 ms
ERROR: CVFSFile: file maps/scenario.rng couldn't be opened (vfs_load: -110101)
ERROR: CXeromyces: failed adding validator for 'maps/scenario.rng'
ERROR: Failed to open font file fonts/mono-10.fnt
ERROR: Failed to open font file fonts/sans-10.fnt
TIMER| ps_console: 92.442 us
TIMER| ps_lang_hotkeys: 208.402 us
ERROR: CCacheLoader failed to find archived or source file for: "gui/page_pregame.xml"
ERROR: Failed to open font file fonts/mono-stroke-10.fnt
Segmentation fault (core dumped)

 

 

Link to comment
Share on other sites

I can now run the appimage, get the main menu, and open the game setup menu.

 

Alt+Enter doesn't switch to full-screen, but I can do that by right-clicking the title bar and clicking on "full screen".

 

When I start a game, it loads, but I get many collada related errors.
 

Quote

 

ERROR: Error loading object variation (actor: art/actors/flora/trees/pine_maritime.xml)
ERROR: Failed to load COLLADA conversion DLL
ERROR: Could not load mesh 'art/meshes/gaia/pine_maritime_4.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/gaia/pine_maritime_4.dae failed to load
ERROR: Error loading object variation (actor: art/actors/flora/trees/pine_maritime.xml)
ERROR: Failed to load COLLADA conversion DLL
ERROR: Could not load mesh 'art/meshes/gaia/pine_maritime_3.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/gaia/pine_maritime_3.dae failed to load
ERROR: Error loading object variation (actor: art/actors/flora/trees/pine_maritime.xml)
ERROR: Failed to load COLLADA conversion DLL
ERROR: Could not load mesh 'art/meshes/gaia/pine_maritime_4.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/gaia/pine_maritime_4.dae failed to load
ERROR: Error loading object variation (actor: art/actors/flora/trees/pine_maritime.xml)
ERROR: Failed to load COLLADA conversion DLL
ERROR: Could not load mesh 'art/meshes/gaia/pine_maritime_2.dae'
ERROR: CObjectEntry::BuildVariation(): Model art/meshes/gaia/pine_maritime_2.dae failed to load
ERROR: Error loading object variation (actor: art/actors/flora/trees/pine_maritime.xml)

 

 

 

Edited by andy5995
Link to comment
Share on other sites

libCollada.so is dynamically loaded by 0ad and not via linker, so location must match 0ad-libdir for it to be found.

I never dealt with app images, but your --libdir and --bindir settings look wrong (libdir in particular). I'd assume you can use the default values just fine.

 

Edit: fix hard to parse typo

Edited by hyperion
  • Thanks 1
Link to comment
Share on other sites

@hyperionI don't think using --bindir  is needed at all for this actually, but haven't tried building without it yet. I'm going to do that now.

 

As for libdir, when linuxdeploy is run, it copies libraries into AppRun/usr/lib and that seems to be working well. It fixed a lot of problems I was having... except for libCollada.so. I copied it into the AppRun folder in 3 different places: the bin folder (alongside pyrogenesis), the AppRun/usr/lib/games/0ad folder, and AppRun/usr/lib. That didn't help anything.

Link to comment
Share on other sites

I tried without specifying any --libdir. I changed the install script (above) to install ActorEditor, libCollada.so, AtlasUi.so to AppRun/usr/bin.

 

Ran `linuxdeploy`. It failed saying the deps couldn't be found. Fixed by using patchelf on 5 files:

 

binaries/system{libmoz*,libnv*}

 

Example:

In AppRun/usr/bin

`patchelf --set-rpath libmozjs78-ps-release.so:/0ad/binaries/system pyrogenesis` (where /0ad/ is my source root)

 

Rebuilt the appimage and ran it. I got errors immediately about directory creation.

 

I copied default.cfg  dev.cfg  keys.txt to AppRun/user/data/config

 

Rebuilt the appimage and ran it

 

I got the same errors about Collada as before, but the full-screen problem was fixed.

Edited by andy5995
Link to comment
Share on other sites

10 hours ago, hyperion said:

Well, if you can't figure out the right path, worst case you could patch ColladaManager to not dlopen but to link directly to collada, then it would behave like the other deps.

I increased and took a closer look at my scrollback. Right before the DLL conversion errors, near the top of the console output is a fairly good clue:

 

Quote

ERROR: DllLoader: dlopen(libCollada.so) failed: libCollada.so: cannot open shared object file: No such file or directory; dlopen(libCollada_dbg.so) failed: libCollada_dbg.so: cannot open shared object file: No such file or directory;

I've looked at the code in DllLoader.cpp, but I don't see yet how I can have the complete path output to the console. The base filename is passed to dlopen(); doesn't really make sense to me yet.

Link to comment
Share on other sites

Consider setting, and exporting, the LD_LIBRARY_PATH=[absolute path to directory containing libraries] or LD_PRELOAD=[absolute path to specific library] environment variables in a shell script that is called before the pyrogenesis binary. See the manpage for `ld' at the documentation for the switch -rpath-link=dir for a description of the library search path order.

But, I haven't worked with AppImages before, so there might be reasons to not do this.

Also, you can use strace or ptrace to watch what directories are being searched for libCollada.so.

Search paths for shared libraries are configured in /etc/ld.so.conf.d/*

If you change the ld.so configuration then don't forget to run ldconfig as root to update the cache. However, changing such configuration might be an even worse idea, as it could have unintended effects on other binaries and libraries.

Edited by Norse_Harold
  • Thanks 1
Link to comment
Share on other sites

20 minutes ago, andy5995 said:

 

Quote

ERROR: DllLoader: dlopen(libCollada.so) failed: libCollada.so: cannot open shared object file: No such file or directory; dlopen(libCollada_dbg.so) failed: libCollada_dbg.so: cannot open shared object file: No such file or directory;

I've looked at the code in DllLoader.cpp, but I don't see yet how I can have the complete path output to the console. The base filename is passed to dlopen(); doesn't really make sense to me yet.

It looks like it's calling dlopen on merely the filename. That's a relative path that implies "search the current working directory for the file". You could control the current working directory before that point in the code with a bash script or C++ calls. Or, ensure that the installer places the library in the appropriate directory.

Link to comment
Share on other sites

It's working now (except for Atlas)!

 

Putting libAtlasUI.so and libCollada.so in AppRun/usr/lib did the trick.  (I thought I tried that already, as I mentioned above, but saw libCollada.so wasn't there).

 

I'll update the howto in a few minutes, but I'd say it's ready for someone who's familiar with your CI to start adding it. I think best to create the AppImage on systems with a slightly older version of libc than the bleeding edge. That assures it's more likely to run on newer, as well as older systems. But I'm a bit hazy about that yet.

Link to comment
Share on other sites

For Atlas, I expect that the linuxdeploy-plugin-gtk will be the best (maybe only) option. (more info about linuxdeploy plugins in the linuxdeploy user guide )

When I run the appimage with the '-editor' option, this is the output

Quote

 

TIMER| LoadDLL: 186.59 ms
Gtk-Message: 15:30:30.448: Failed to load module "canberra-gtk-module"
Gtk-Message: 15:30:30.448: Failed to load module "canberra-gtk-module"
TIMER| InitVfs: 3.80243 ms
FILES| Main log written to '/home/andy/.config/0ad/logs/mainlog.html'
FILES| Interesting log written to '/home/andy/.config/0ad/logs/interestinglog.html'
TIMER| CONFIG_Init: 2.9302 ms
Sound: AlcInit success, using OpenAL Soft

(atlas:56487): Gtk-WARNING **: 15:30:31.099: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Aborted (core dumped)

 

 

Link to comment
Share on other sites

On 30/08/2022 at 3:37 PM, andy5995 said:

For Atlas, I expect that the linuxdeploy-plugin-gtk will be the best (maybe only) option. (more info about linuxdeploy plugins in the linuxdeploy user guide )

Yes, this works. I'll update the wiki shortly. Everyone who has a GitHub account and loves Atlas should star the linuxdeploy-plugin-gtk project.

Link to comment
Share on other sites

  • 2 weeks later...
$ ./ActorEditor
/tmp/.mount_ActorEge8Yqx/usr/bin/ActorEditor: error while loading shared libraries: libthai.so.0: cannot open shared object file: No such file or directory

 

$ ./0ad-0.0.26-alpha-2210010553-x86_64.AppImage -editor
TIMER| LoadDLL: 53.6057 ms
Unable to open crashlog.txt for writing (please ensure the log directory is writable)
Location: debug.cpp:195 (debug_WriteCrashlog)

Call stack:

(0x5623a5de2b5e) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x5e2b5e) [0x5623a5de2b5e]
(0x5623a5d97361) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x597361) [0x5623a5d97361]
(0x5623a5d988eb) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x5988eb) [0x5623a5d988eb]
(0x5623a5d98569) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x598569) [0x5623a5d98569]
(0x5623a5d988fd) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x5988fd) [0x5623a5d988fd]
(0x5623a5a9b44b) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x29b44b) [0x5623a5a9b44b]
(0x5623a5a9b52a) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x29b52a) [0x5623a5a9b52a]
(0x5623a58a664c) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0xa664c) [0x5623a58a664c]
(0x5623a5893817) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0x93817) [0x5623a5893817]
(0x7f268c81934a) /lib64/libc.so.6(+0x2934a) [0x7f268c81934a]
(0x7f268c8193fc) /lib64/libc.so.6(__libc_start_main+0x7c) [0x7f268c8193fc]
(0x5623a58a4bba) /tmp/.mount_0ad-0.UaI40J/usr/bin/pyrogenesis(+0xa4bba) [0x5623a58a4bba]

errno = 30 (?)
OS error = ?

Btw, the game runs fine, no performance issues either.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...