FlightGear.yml-generated AppImage: FlightGear does not find its data #162

Open
probonopd opened this Issue Jan 1, 2017 · 11 comments

Projects

None yet

3 participants

@probonopd
Owner
probonopd commented Jan 1, 2017 edited

(Continuation from here)
Put the following into a text file called FlightGear.yml and run it (on an Ubuntu/debian system) like so:

wget -c "https://github.com/probonopd/AppImages/raw/master/recipes/meta/Recipe"
bash Recipe FlightGear.yml

It will generate an 1.2 GB AppImage that launches but does not find its data; why?

app: FlightGear
binpatch: true

ingredients:
  dist: trusty
  sources: 
    - deb http://archive.ubuntu.com/ubuntu/ trusty main universe
  ppas:
    - saiarcot895/flightgear

script:
  - mv usr/games/* usr/bin/ ; rm -r usr/games/
  - rm lib/x86_64-linux-gnu/libssl*
  - rm lib/x86_64-linux-gnu/libcrypto.so.1.0.0

# Does not find its data; why?
@probonopd probonopd referenced this issue in probonopd/AppImageKit Jan 1, 2017
Merged

update year #323

@kskarthik

That's weird. Maybe @saiarcot895 could help us with this issue :)

@saiarcot895

I'm not sure how AppImages are compiled/organized, but when Flightgear is compiled, the path to its data files is hardcoded in at compile-time to /usr/share/games/flightgear/. However, a different path can be chosen at run-time, I believe.

If the AppImage is 1.2 GB, then the data files are in there somewhere.

@probonopd
Owner

Yes, usr/share/games/flightgear/ is populated, but doesn't seem to be accepted as the location of the data. Which file specifically is it checking for?

@saiarcot895

Likely the version file, which is just a text file containing the version number.

@kskarthik

@saiarcot895 AppImages are basically ISO compressed files containing all dependencies within them which allows to use them on any Linux distro without need of any installation. More info https://en.m.wikipedia.org/wiki/AppImage

@saiarcot895
saiarcot895 commented Jan 3, 2017 edited

I've tried building an AppImage with the yaml file posted above, but it seems Flightgear is trying to use the system libraries and is failing. I'm on Ubuntu Yakkety, which has the file libgnutls.so.30, and when launching the AppImage, it's saying that a symbol referenced by that library is undefined. Ubuntu Trusty has libgnutls.so.26, so it's definitely trying to use the system libraries.

Is this a bug, or did I do something wrong in the creation?

@probonopd
Owner

@saiarcot895 you can observe which debs are getting downloaded. The yml file specifies that debs for trusty should be downloaded. Which libgnutls deb do you see in the FlightGear/ directory when running the Recipe? Using a yml file should not bundle anything from the host system into the AppImage. If it does, then it is a bug...

@saiarcot895

Figured out the issue. The AppImage does have libgnutls.so.26, but one of the simgear libraries depends on a curl library that isn't listed as a dependency for some reason. Therefore, since that library isn't in the AppImage, it's falling back to the system library paths. (AppImage itself is behaving correctly, but the package dependencies aren't correct.)

I need to figure out what I need to do to fix the dependencies.

@saiarcot895

I haven't fixed the dependency issue yet, but there's something else I realized. If I understand correctly, the AppImage is just a squashfs file (with some extra header info) that is then mounted in some directory. It's not run in a chroot, and the host filesystem can still be accessed. Is this correct?If so, then FlightGear will try to access /usr/share/games/flightgear/ of the host filesystem, not usr/share/games/flightgear/ of the AppImage. Since the data files aren't on the host system, this causes a problem.

@probonopd
Owner
probonopd commented Jan 5, 2017 edited

This is correct, which is why either FlightGear must be changed not to load from /usr but a relative path (relative to itself, e.g., using binreloc), or we have to binary-patch the binaries as discussed here (binpatch: true above does just that), or we have to use LD_PRELOAD trickery.

@probonopd
Owner

I need to figure out what I need to do to fix the dependencies.

Yes, please fix them and then possibly it will start to work automagically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment