unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: Christophe Pisteur <christophe.pisteur@fsfe.org>
Cc: help-guix@gnu.org
Subject: Re: Appimage: cannot run binary file
Date: Wed, 10 Feb 2021 19:59:17 +0100	[thread overview]
Message-ID: <875z2zzr3u.fsf@nckx> (raw)
In-Reply-To: <a47a9e27b763704a56d045ab75320e0a76417899.camel@fsfe.org>

[-- Attachment #1: Type: text/plain, Size: 3145 bytes --]

Bonjour Christophe!

Christophe Pisteur 写道:
> bash: .: 
> /home/christophe/Téléchargements/FreeCAD_0.19-23578-Linux-
> Conda_glibc2.12-x86_64.AppImage : ne peut exécuter le fichier 
> binaire

This unclear error message means that the dynamic linker/loader 
was not found.

It's an absolute file name, hard-coded in the executable.  In this 
case:

  λ file FreeCAD_0.19-23578-Linux-Conda_glibc2.12-x86_64.AppImage 
  ...ELF 64-bit LSB executable, x86-64, version 1 (SYSV)...
  ...dynamically linked, interpreter 
  /lib64/ld-linux-x86-64.so.2...
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Like Flatpaks (and all binaries, really), AppImages are 
distro-specific: they expect this file to exist at this exact 
location or they won't be able to start.  It won't run on my Guix 
System even though I have a compatibility symlink in /lib:

  (service special-files-service-type
           `(("/lib/ld-linux-x86-64.so.2"
              ,(file-append (canonical-package glibc)
                            "/lib/ld-linux-x86-64.so.2"))
             ...))

After adding one for /lib64 as well, this happens:

  λ ./FreeCAD_0.19-23578-Linux-Conda_glibc2.12-x86_64.AppImage 
  ...: error while loading shared libraries: libz.so.1: cannot 
  open
  shared object file: No such file or directory

Of course: there is no libz.so in /lib{,64} either!

Rather than add more compatibility links for every library and its 
sister, we create a Guix environment and hackily point our 
AppImage towards it:

  λ guix environment --ad-hoc zlib fuse -- bash -c \
    'LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib \
    ./FreeCAD_0.19-23578-Linux-Conda_glibc2.12-x86_64.AppImage'

  fusermount: mounting over filesystem type 0xca451a4e is 
  forbidden

  Cannot mount AppImage, please check your FUSE setup.
  You might still be able to extract the contents of this AppImage 
  if you run it with the --appimage-extract option. 
  See https://github.com/AppImage/AppImageKit/wiki/FUSE 
  for more information
  open dir error: No such file or directory

At this point I got a disgusting hunch:

  ~/linux λ grep -r 0xca451a4e *
  ... #define BCACHEFS_STATFS_MAGIC 0xca451a4e

A hard-coded file system whitelist[0]!  What could go wrong?

You'll probably get a different error on your system; it might 
even work.  You could try extracting it:

  /tmp/squashfs-root λ ./AppRun 
  bash: ./AppRun: /bin/bash: bad interpreter: No such file or 
  directory

  /tmp/squashfs-root λ bash ./AppRun 
  .../bin/freecad: error while loading shared libraries: 
  libGL.so.1:
  cannot open shared object file: No such file or directory

And so on until you have fun.  Much cross-distro; very universal. 
I tried adding mesa; didn't work.

Instead, I strongly recommend writing your own Guix package (using 
inherit) or looking for a less byzantine download format.

> (= cannot run binary file).

(Tip: you can submit ‘normalised’ bug reports by setting 
LC_ALL=C.)

Good luck,

T G-R

[0]: I don't know if it's in AppImage of FUSE, nor do I much care.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2021-02-10 19:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 18:08 Appimage: cannot run binary file Christophe Pisteur
2021-02-10 18:59 ` Tobias Geerinckx-Rice [this message]
2021-02-11  4:25   ` raingloom
2021-02-11 12:53     ` Christophe Pisteur
2021-02-11 14:12       ` Sergiu Ivanov
2021-02-11 14:43         ` Christophe Pisteur
2021-02-12  5:12           ` raingloom
2021-02-15  9:56             ` Efraim Flashner
2021-02-11  6:11   ` Christophe Pisteur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875z2zzr3u.fsf@nckx \
    --to=me@tobias.gr \
    --cc=christophe.pisteur@fsfe.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).