flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
139 stars 91 forks source link

[Bug]: Fail during stripping (eu-strip) Perl-XML-Parser #472

Open fastrizwaan opened 2 years ago

fastrizwaan commented 2 years ago

Checklist

Flatpak version

1.12.7

What Linux distribution are you using?

Debian

Linux distribution version

Linux RizvansPC 5.17.0-1-amd64 flatpak/flatpak#1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18) x86_64 GNU/Linux

What architecture are you using?

x86_64

How to reproduce

Perl XML Parser is required for gtk-mm which is required for the flatpak manifest I'm creating for winegui

id: org.melroy.gitlab.WineGUI
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
base: org.winehq.Wine
base-version: stable-21.08
command: winegui
rename-icon: winegui
rename-desktop-file: winegui.desktop
finish-args:
  - --allow=devel # For Wine crash handling
  - --allow=multiarch
  - --device=all
  - --env=GST_PLUGIN_SYSTEM_PATH=/app/lib32/gstreamer-1.0:/app/lib/gstreamer-1.0:/usr/lib/i386-linux-gnu/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0
  - --env=WINEDLLPATH=/app/dlls/lib32:/app/dlls/lib:/app/lib32/wine/wined3d:/app/lib/wine/wined3d
    # Need to link .desktop files 
  - --filesystem=~/.local/share/applications
    # Most Games write to their own directories
  - --filesystem=host
    # Desktop shortcut runs wine script from host
  - --talk-name=org.freedesktop.Flatpak
  - --share=ipc
  - --share=network
  - --socket=pulseaudio
  - --socket=wayland
  - --socket=x11
  - --system-talk-name=org.freedesktop.UDisks2
  - --talk-name=org.freedesktop.Notifications
cleanup:
  - '*.a'
  - '*.la'
  - /share/doc
  - /share/man
inherit-extensions:
  - org.freedesktop.Platform.Compat.i386
  - org.freedesktop.Platform.ffmpeg_full.i386
  - org.freedesktop.Platform.ffmpeg-full
  - org.freedesktop.Platform.GL32
  - org.freedesktop.Platform.VAAPI.Intel.i386
  - org.winehq.Wine.DLLs
  - org.winehq.Wine.gecko
  - org.winehq.Wine.mono
add-extensions:
  com.valvesoftware.Steam.Utility:
    subdirectories: true
    directory: utils
    versions: stable;beta;test;master
    add-ld-path: lib
    merge-dirs: share/vulkan/explicit_layer.d;share/vulkan/implicit_layer.d;
    no-autodownload: true
    autodelete: false

modules:
  - name: icoutils
    build-options:
      #strip: true
      no-debuginfo: true  
    buildsystem: autotools
    sources:
      - type: archive
        url: http://savannah.nongnu.org/download/icoutils/icoutils-0.32.3.tar.bz2
        sha256: 17abe02d043a253b68b47e3af69c9fc755b895db68fdc8811786125df564c6e0

  - name: perl
    no-autogen: true
    config-opts:
    - "-des"
    - "-Duseshrplib"
    build-options:
      cflags: "-fPIC"
      ldflags: "-fpic"
    sources:
    - type: archive
      url: https://www.cpan.org/src/5.0/perl-5.32.0.tar.gz
      sha256: efeb1ce1f10824190ad1cadbcccf6fdb8a5d37007d0100d2d9ae5f2b5900c0b4
    - type: script
      dest-filename: configure
      commands:
      - exec ./configure.gnu $@
    post-install:
    - chmod -R u+w /app/lib/perl5

  - name: exiftool
    buildsystem: simple
    build-commands:
      - perl Makefile.PL
      - make
      - make install 
    sources:
      - type: archive
        url: https://exiftool.org/Image-ExifTool-12.41.tar.gz
        sha256: 654f401daab0045a8364fa59d3f69b6f9bf23bcef157a3c928e373884a6f9370

  - name: expat
    buildsystem: autotools
    sources:
      - type: archive
        url: https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.bz2
        sha256: a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16

  - name: perl-xml-parser
    buildsystem: simple
    build-commands:
      - perl Makefile.PL
      - make
      - make DESTDIR=/app install

    sources:
      - type: archive
        url: https://github.com/toddr/XML-Parser/archive/refs/tags/2.45.tar.gz
        sha256: 3dc4a4ffa2dd1480751fe53e83e5ae0e38d19e92a648007dd72a2f172b5b6e91

  - name: desktop-file-utils
    build-options:
      #strip: true
      no-debuginfo: true  
    buildsystem: autotools
    sources:
      - type: archive
        url: https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-0.26.tar.xz
        sha256: b26dbde79ea72c8c84fb7f9d870ffd857381d049a86d25e0038c4cef4c747309

  - name: mm-common
    buildsystem: meson
    config-opts:
      - --buildtype=debugoptimized
      - --wrap-mode=nodownload
      - -Duse-network=false
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/mm-common/1.0/mm-common-1.0.0.tar.xz
        sha256: b97d9b041e5952486cab620b44ab09f6013a478f43b6699ae899b8a4da189cd4
    post-install:
      - install -p -D -m 0644 "../COPYING" -t "${FLATPAK_DEST}/share/licenses/mm-common/";
    cleanup: ['*']

  - name: libsigc++
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-2.10.2.tar.xz
        sha256: b1ca0253379596f9c19f070c83d362b12dfd39c0a3ea1dd813e8e21c1a097a98
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/libsigc++/";

  - name: cairomm
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/cairomm/1.12/cairomm-1.12.0.tar.xz
        sha256: a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/cairomm/";

  - name: glibmm
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/glibmm/2.62/glibmm-2.62.0.tar.xz
        sha256: 36659f13cc73282392d1305858f3bbca46fbd1ce2f078cc9db8b9f79b2e93cfe
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/glibmm/";

  - name: pangomm
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/pangomm/2.42/pangomm-2.42.0.tar.xz
        sha256: ca6da067ff93a6445780c0b4b226eb84f484ab104b8391fb744a45cbc7edbf56
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/pangomm/";

  - name: atkmm
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/atkmm/2.28/atkmm-2.28.0.tar.xz
        sha256: 4c4cfc917fd42d3879ce997b463428d6982affa0fb660cafcc0bc2d9afcedd3a
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/atkmm/";

  - name: gtkmm
    rm-configure: true
    config-opts:
      - --disable-static
      - --disable-documentation
      - --enable-maintainer-mode
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/gtkmm/3.24/gtkmm-3.24.2.tar.xz
        sha256: 6d71091bcd1863133460d4188d04102810e9123de19706fb656b7bb915b4adc3
      - type: shell
        commands:
          - cp -p /usr/share/automake-*/config.{sub,guess} "build/";
    post-install:
      - install -p -D -m 0644 "COPYING" -t "${FLATPAK_DEST}/share/licenses/gtkmm/";

  - name: WineGUI
    buildsystem: cmake-ninja

    sources:
      - type: archive
        url: https://github.com/winegui/WineGUI/archive/refs/tags/v1.7.5.tar.gz
        sha256: 95e29a3d6370297765903a5548ed4639d8fdb7efc792ed15279302a05f683139

Try building: flatpak-builder --force-clean build-dir org.melroy.gitlab.WineGUI.yml

Expected Behavior

Stripping should happen, and next module should compile.

Actual Behavior

stripping fails

eu-strip: while opening '/home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so': Permission denied
Error: module perl-xml-parser: Child process exited with code 1

full output

========================================================================
Building module perl-xml-parser in /home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/build/perl-xml-parser-5
========================================================================
Running: perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite LWP::UserAgent 0 not found.
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for XML::Parser
Writing MYMETA.yml and MYMETA.json
Running: make
cp Parser/Encodings/euc-kr.enc blib/lib/XML/Parser/Encodings/euc-kr.enc
cp Parser/Style/Tree.pm blib/lib/XML/Parser/Style/Tree.pm
cp Parser/Encodings/iso-8859-4.enc blib/lib/XML/Parser/Encodings/iso-8859-4.enc
cp Parser/Encodings/windows-1250.enc blib/lib/XML/Parser/Encodings/windows-1250.enc
cp Parser/Encodings/windows-1252.enc blib/lib/XML/Parser/Encodings/windows-1252.enc
cp Parser/Encodings/big5.enc blib/lib/XML/Parser/Encodings/big5.enc
cp Parser/Encodings/x-sjis-unicode.enc blib/lib/XML/Parser/Encodings/x-sjis-unicode.enc
cp Parser/Style/Objects.pm blib/lib/XML/Parser/Style/Objects.pm
cp Parser/Encodings/x-euc-jp-unicode.enc blib/lib/XML/Parser/Encodings/x-euc-jp-unicode.enc
cp Parser/Style/Subs.pm blib/lib/XML/Parser/Style/Subs.pm
cp Parser/Encodings/x-sjis-jisx0221.enc blib/lib/XML/Parser/Encodings/x-sjis-jisx0221.enc
cp Parser/Encodings/koi8-r.enc blib/lib/XML/Parser/Encodings/koi8-r.enc
cp Parser/Style/Debug.pm blib/lib/XML/Parser/Style/Debug.pm
cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
cp Parser/Encodings/iso-8859-2.enc blib/lib/XML/Parser/Encodings/iso-8859-2.enc
cp Parser/Encodings/README blib/lib/XML/Parser/Encodings/README
cp Parser/Encodings/windows-1255.enc blib/lib/XML/Parser/Encodings/windows-1255.enc
cp Parser/Encodings/iso-8859-15.enc blib/lib/XML/Parser/Encodings/iso-8859-15.enc
cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc
cp Parser/Encodings/x-sjis-jdk117.enc blib/lib/XML/Parser/Encodings/x-sjis-jdk117.enc
cp Parser/Encodings/windows-1251.enc blib/lib/XML/Parser/Encodings/windows-1251.enc
cp Parser/Encodings/x-sjis-cp932.enc blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
cp Parser/Encodings/x-euc-jp-jisx0221.enc blib/lib/XML/Parser/Encodings/x-euc-jp-jisx0221.enc
cp Parser/Encodings/iso-8859-3.enc blib/lib/XML/Parser/Encodings/iso-8859-3.enc
cp Parser.pm blib/lib/XML/Parser.pm
cp Parser/Encodings/iso-8859-8.enc blib/lib/XML/Parser/Encodings/iso-8859-8.enc
cp Parser/Encodings/Japanese_Encodings.msg blib/lib/XML/Parser/Encodings/Japanese_Encodings.msg
cp Parser/Encodings/iso-8859-9.enc blib/lib/XML/Parser/Encodings/iso-8859-9.enc
cp Parser/Encodings/ibm866.enc blib/lib/XML/Parser/Encodings/ibm866.enc
cp Parser/Style/Stream.pm blib/lib/XML/Parser/Style/Stream.pm
cp Parser/LWPExternEnt.pl blib/lib/XML/Parser/LWPExternEnt.pl
make[1]: Entering directory '/run/build/perl-xml-parser/Expat'
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
Running Mkbootstrap for Expat ()
chmod 644 "Expat.bs"
"/app/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Expat.bs ../blib/arch/auto/XML/Parser/Expat/Expat.bs 644
"/app/bin/perl" "/app/lib/perl5/5.32.0/ExtUtils/xsubpp" -noprototypes -typemap '/app/lib/perl5/5.32.0/ExtUtils/typemap' -typemap '/run/build/perl-xml-parser/Expat/typemap'  Expat.xs > Expat.xsc
mv Expat.xsc Expat.c
cc -c   -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fPIC -fwrapv -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.45\" -DXS_VERSION=\"2.45\" -fPIC "-I/app/lib/perl5/5.32.0/x86_64-linux/CORE"   Expat.c
rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.so
LD_RUN_PATH="/app/lib" cc  -shared -O2 -L/app/lib -fstack-protector-strong  Expat.o  -o ../blib/arch/auto/XML/Parser/Expat/Expat.so  \
   -lexpat   \

chmod 755 ../blib/arch/auto/XML/Parser/Expat/Expat.so
Manifying 1 pod document
make[1]: Leaving directory '/run/build/perl-xml-parser/Expat'
Manifying 6 pod documents
Running: make DESTDIR=/app install
make[1]: Entering directory '/run/build/perl-xml-parser/Expat'
"/app/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Expat.bs ../blib/arch/auto/XML/Parser/Expat/Expat.bs 644
Manifying 1 pod document
make[1]: Leaving directory '/run/build/perl-xml-parser/Expat'
Manifying 6 pod documents
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/LWPExternEnt.pl
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Expat.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/euc-kr.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-4.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/windows-1250.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/windows-1252.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/big5.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-sjis-unicode.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-euc-jp-unicode.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-sjis-jisx0221.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/koi8-r.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-7.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-2.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/README
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/windows-1255.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-15.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-5.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-sjis-jdk117.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/windows-1251.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-sjis-cp932.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/x-euc-jp-jisx0221.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-3.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-8.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/Japanese_Encodings.msg
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/iso-8859-9.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Encodings/ibm866.enc
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Style/Tree.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Style/Objects.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Style/Subs.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Style/Debug.pm
Installing /app/app/lib/perl5/site_perl/5.32.0/x86_64-linux/XML/Parser/Style/Stream.pm
Installing /app/app/share/man/man3/XML::Parser::Expat.3
Installing /app/app/share/man/man3/XML::Parser.3
Installing /app/app/share/man/man3/XML::Parser::Style::Debug.3
Installing /app/app/share/man/man3/XML::Parser::Style::Objects.3
Installing /app/app/share/man/man3/XML::Parser::Style::Stream.3
Installing /app/app/share/man/man3/XML::Parser::Style::Subs.3
Installing /app/app/share/man/man3/XML::Parser::Style::Tree.3
Appending installation info to /app/app/lib/perl5/5.32.0/x86_64-linux/perllocal.pod
compressing debuginfo in: /home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so
processing: /home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so
[29] .debug_aranges compressed -> .zdebug_aranges (176 => 77 43.75%)
[30] .debug_info compressed -> .zdebug_info (61533 => 28400 46.15%)
[31] .debug_abbrev compressed -> .zdebug_abbrev (1905 => 819 42.99%)
[32] .debug_line compressed -> .zdebug_line (35788 => 11981 33.48%)
[33] .debug_str compressed -> .zdebug_str (10937 => 4428 40.49%)
[34] .debug_line_str compressed -> .zdebug_line_str (497 => 292 58.75%)
[35] .debug_loclists compressed -> .zdebug_loclists (42033 => 18402 43.78%)
[36] .debug_rnglists compressed -> .zdebug_rnglists (7401 => 4821 65.14%)
[39] Updating section string table
stripping /home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so to /home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/lib/debug/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so.debug
eu-strip: while opening '/home/rizvan/.build/org.melroy.gitlab.WineGUI/.flatpak-builder/rofiles/rofiles-2L1Qh5/files/app/lib/perl5/site_perl/5.32.0/x86_64-linux/auto/XML/Parser/Expat/Expat.so': Permission denied
Error: module perl-xml-parser: Child process exited with code 1

Additional Information

setting strip: false also fails.

  - name: perl-xml-parser
    build-options:
      strip: false
Erick555 commented 2 years ago

I think it may be common problem with read-only permissions of perl libs after install. Example fix is here.