Skip to content

Fails on AppImage Run with Missing File Error #3

Closed

Description

@ahimta

The AppImage is generated correctly but when it's run the following error message appears: sed: can't read /tmp/.mount_epiphaICAN9X//usr/lib64/gtk-3.0/3.0.0/immodules.cache: No such file or directory.

The AppImage runs without errors when the lines (106 and 107) related to the error are commented out but the root-cause and actual fix are probably another story.

Activity

  1. TheAssassin commented on Dec 4, 2020

    @TheAssassin
    Member

    That part was authored by @x0rg. Mind to have a look?

  2. TheTumultuousUnicornOfDarkness commented on Dec 6, 2020

    @TheTumultuousUnicornOfDarkness
    Contributor

    The immodules.cache file is copied from host to AppDir during build process.
    Your error suggests this file is absent on the host.

    How do you build your AppImage (distro, command, etc...)? Can you share your AppImage with us for a deeper look?

  3. added a commit that references this issue on Jan 1, 2021
  4. TheTumultuousUnicornOfDarkness commented on Jan 1, 2021

    @TheTumultuousUnicornOfDarkness
    Contributor

    @ahimta Can you tell us if 6c53d80 fixes this?

  5. ahimta commented on Jan 22, 2021

    @ahimta
    Author

    @x0rg 6c53d80 indeed fixes this. And a GIO bug that I haven't reported yet is fixed too.

    For reference, I outline how to reproduce this issue. Which can also serve as part of a regression suite for the GTK plugin. Just make sure you have both files in the working directory and execute rebroduce-bug.sh

    epiphany-d645adbdf.Dockerfile

    FROM fedora:32
    
    RUN dnf install --quiet --assumeyes \
      'pkgconfig(cairo)' \
      'pkgconfig(gcr-3)' \
      'pkgconfig(gnutls)' \
      'pkgconfig(gsettings-desktop-schemas)' \
      'pkgconfig(gtk+-2.0)' \
      'pkgconfig(hogweed)' \
      'pkgconfig(iso-codes)' \
      'pkgconfig(json-glib-1.0)' \
      'pkgconfig(libcap)' \
      'pkgconfig(libportal)' \
      'pkgconfig(librsvg-2.0)' \
      'pkgconfig(libsecret-1)' \
      'pkgconfig(libsoup-2.4)' \
      'pkgconfig(libxslt)' \
      'pkgconfig(vapigen)' \
      autoconf \
      autoconf-archive \
      autogen \
      autogen-libopts-devel \
      automake \
      bison \
      bwrap-oci \
      cmake \
      dash \
      desktop-file-utils \
      docbook-xsl \
      enchant2-devel \
      file \
      g++ \
      gawk \
      gcc \
      gettext-devel \
      git \
      git \
      gobject-introspection-devel \
      gperf \
      gperf \
      gstreamer1-plugins-base-devel \
      gtk-doc \
      guile22-devel \
      hyphen-devel \
      itstool \
      libev-devel \
      libgcrypt-devel \
      libidn2-devel \
      libjpeg-devel \
      libnotify-devel \
      libseccomp-devel \
      libtasn1-devel \
      libtasn1-devel \
      libtasn1-tools \
      libtool \
      libunistring-devel \
      libwebp-devel \
      libwpe-devel \
      libxslt-devel \
      libXt-devel \
      make \
      meson \
      nettle-devel \
      openjpeg2-devel \
      p11-kit-devel \
      patch \
      perl-JSON* \
      ruby-devel \
      systemd-devel \
      texinfo \
      texlive \
      trousers-devel \
      unbound-devel \
      wget \
      which \
      woff2-devel \
      wpebackend-fdo-devel \
      xdg-dbus-proxy \
      xz
    
    RUN curl --silent --show-error --location \
      --output /root/webkitgtk-2.29.3.tar.xz \
      https://webkitgtk.org/releases/webkitgtk-2.29.3.tar.xz
    RUN (cd /root && tar xf webkitgtk-2.29.3.tar.xz)
    # NOTE: `bubblewrap` sandboxing is disabled because it breaks the AppImage and
    # even all attempts to make `libuinionpreload` work (incl. changing its code)
    # failed. See VCS history for more details.
    RUN cmake -S /root/webkitgtk-2.29.3 -B /root/webkitgtk-2.29.3/build \
      -DPORT=GTK \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DENABLE_BUBBLEWRAP_SANDBOX=OFF \
      -GNinja
    RUN ninja -C /root/webkitgtk-2.29.3/build
    RUN ninja -C /root/webkitgtk-2.29.3/build install
    
    RUN git clone \
      --branch 3.38.0 \
      https://gitlab.gnome.org/GNOME/libdazzle.git \
      /root/libdazzle
    RUN meson --prefix=/usr /root/libdazzle /root/libdazzle/build
    RUN ninja -C /root/libdazzle/build
    RUN ninja -C /root/libdazzle/build install
    
    RUN git clone \
      --branch 1.0.3 \
      https://gitlab.gnome.org/GNOME/libhandy.git \
      /root/libhandy
    RUN meson --prefix=/usr /root/libhandy /root/libhandy/build
    RUN ninja -C /root/libhandy/build
    RUN ninja -C /root/libhandy/build install
    
    RUN git clone --branch 3.6.15 https://gitlab.com/gnutls/gnutls.git /root/gnutls
    RUN (cd /root/gnutls && ./bootstrap)
    RUN (cd /root/gnutls && ./configure --prefix=/usr)
    RUN make -C /root/gnutls --jobs `nproc`
    
    RUN git clone \
      --branch 0.1.2 \
      https://github.com/flatpak/xdg-dbus-proxy.git \
      /root/xdg-dbus-proxy
    RUN (cd /root/xdg-dbus-proxy && ./autogen.sh)
    RUN (cd /root/xdg-dbus-proxy && ./configure --prefix=/usr)
    RUN make -C /root/xdg-dbus-proxy --jobs `nproc`
    
    RUN git clone \
      --branch v0.4.1 \
      https://github.com/containers/bubblewrap.git \
      /root/bubblewrap
    RUN (cd /root/bubblewrap && ./autogen.sh)
    RUN (cd /root/bubblewrap && ./configure --prefix=/usr)
    RUN make -C /root/bubblewrap --jobs `nproc`
    
    RUN git clone \
      --branch 2.66.0 \
      https://gitlab.gnome.org/GNOME/glib-networking.git \
      /root/glib-networking
    RUN meson --prefix=/usr /root/glib-networking /root/glib-networking/build
    RUN ninja -C /root/glib-networking/build
    
    RUN curl --silent --show-error --location \
      --output /usr/local/bin/appimagetool-x86_64.AppImage \
      https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
    
    RUN curl --silent --show-error --location \
      --output /usr/local/bin/linuxdeploy-x86_64.AppImage \
      https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
    
    # NOTE: Use a known defective version to reproduce a bug.
    RUN curl --silent --show-error --location \
      --output /usr/local/bin/linuxdeploy-plugin-gtk.sh \
      https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/raw/8a6fa003537aca50b355bf750aa773f3f77b08df/linuxdeploy-plugin-gtk.sh
    
    RUN chmod a+x /usr/local/bin/*.{AppImage,sh}
    
    # NOTE: `APPIMAGE_EXTRACT_AND_RUN` is needed for any AppImage to work with
    # Docker.
    ENV APPIMAGE_EXTRACT_AND_RUN=1
    
    RUN git clone \
      --branch master https://gitlab.gnome.org/GNOME/epiphany.git \
      /root/epiphany
    
    WORKDIR /root/epiphany
    
    RUN git checkout d645adbdf
    
    ENV BUILD_APPDIR=build/AppDir
    RUN mkdir --parents $BUILD_APPDIR
    
    RUN DESTDIR="$PWD/$BUILD_APPDIR" make -C /root/bubblewrap install
    RUN DESTDIR="$PWD/$BUILD_APPDIR" ninja -C /root/glib-networking/build install
    RUN DESTDIR="$PWD/$BUILD_APPDIR" make -C /root/gnutls install
    RUN DESTDIR="$PWD/$BUILD_APPDIR" ninja -C /root/webkitgtk-2.29.3/build install
    RUN DESTDIR="$PWD/$BUILD_APPDIR" make -C /root/xdg-dbus-proxy install
    
    RUN meson --prefix=/usr . build
    RUN ninja -C build
    RUN DESTDIR="$PWD/$BUILD_APPDIR" ninja -C build install
    
    # NOTE: `epiphany` is replaced with a BASH script and original renamed because
    # this was found to be the easiest way to change environment variables.
    RUN mv $BUILD_APPDIR/usr/bin/epiphany $BUILD_APPDIR/usr/bin/epiphany.original
    
    # NOTE: Many `echo`s used as a substitute for a HEREDOC.
    RUN echo "#!/bin/bash" > $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "set -o errexit" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "set -o nounset" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "# HACK: 'glib-networking' uses '%COMPAT' by default but it needs changes to" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "# work." >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "# SEE: https://www.gnutls.org/manual/html_node/Priority-Strings.html" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "export G_TLS_GNUTLS_PRIORITY=NORMAL" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "# HACK: For some libexecs." >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "export LD_LIBRARY_PATH=\$APPDIR/usr/lib" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "cd \$APPDIR/usr" >> $BUILD_APPDIR/usr/bin/epiphany
    RUN echo "\$APPDIR/usr/bin/epiphany.original" >> $BUILD_APPDIR/usr/bin/epiphany
    
    RUN chmod a+x $BUILD_APPDIR/usr/bin/epiphany
    
    ENV LD_LIBRARY_PATH=$BUILD_APPDIR/usr/lib64/epiphany
    
    RUN linuxdeploy-x86_64.AppImage \
      --appdir $BUILD_APPDIR \
      --icon-file data/icons/hicolor/scalable/apps/org.gnome.Epiphany.Devel.svg \
      --desktop-file build/data/org.gnome.Epiphany.desktop \
      --plugin gtk \
      --output appimage
    
    # NOTE: This is run after `linuxdeploy` because otherwise some dependencies that
    # are copied to the `AppDir` in the first `linuxdeply` call wouldn't be patched.
    RUN find \
      $BUILD_APPDIR/usr/ \
      -type f \
      -executable \
      -not -path "*/bin/epiphany" \
      -exec sed --in-place --expression "s|/usr|././|g" {} \;
    
    RUN linuxdeploy-x86_64.AppImage \
      --appdir $BUILD_APPDIR \
      --icon-file data/icons/hicolor/scalable/apps/org.gnome.Epiphany.Devel.svg \
      --desktop-file build/data/org.gnome.Epiphany.desktop \
      --plugin gtk \
      --output appimage

    reproduce-bug.sh

    #!/bin/bash
    
    set -o errexit
    set -o nounset
    set -o pipefail
    
    # NOTE: To know when the script is done without polling (short or long).
    trap \
      "xdg-open /usr/share/sounds/freedesktop/stereo/phone-incoming-call.oga" \
      EXIT
    
    docker build --tag epiphany-d645adbdf --file epiphany-d645adbdf.Dockerfile .
    
    docker run \
      --rm \
      --mount type=bind,src=/tmp,dst=/host-tmp \
      epiphany-d645adbdf \
      cp /root/epiphany/Web-d645adbdf-x86_64.AppImage /host-tmp
    
    # NOTE: To run in a pristine env. and not pollute local installation.
    mkdir --parents \
      /tmp/Web-d645adbdf-x86_64.AppImage.config \
      /tmp/Web-d645adbdf-x86_64.AppImage.home
    
    (cd /tmp && ./Web-d645adbdf-x86_64.AppImage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions