Bug 416262 - KDE Flatpak 5.12 Sdk broken in ARM
Summary: KDE Flatpak 5.12 Sdk broken in ARM
Status: REOPENED
Alias: None
Product: Qt/KDE Flatpak Runtime
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-14 18:39 UTC by Rinigus
Modified: 2020-03-30 04:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example JSON taken from a part of Pure Maps (1.54 KB, text/plain)
2020-01-14 18:39 UTC, Rinigus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rinigus 2020-01-14 18:39:48 UTC
Created attachment 125125 [details]
Example JSON taken from a part of Pure Maps

SUMMARY

When compiling applications with `qmake`, I get errors like 

Project ERROR: Unknown module(s) in QT: core dbus

When using x86_64 arch, all works as expected.


STEPS TO REPRODUCE
1. get KDE 5.12 for ARM (runtime and SDK)
2. try to compile using flatpak-builder for --arch=arm a package that requires qmake (see attached example)
3. Observe error

OBSERVED RESULT

cd src/ && ( test -e Makefile || /usr/bin/qmake -o Makefile /run/build/nemodbus/src/src.pro 'PREFIX='\''/app'\''' ) && /usr/bin/make -f Makefile 
make[1]: Entering directory '/run/build/nemodbus/src'
cd nemo-dbus/ && ( test -e Makefile || /usr/bin/qmake -o Makefile /run/build/nemodbus/src/nemo-dbus/nemo-dbus.pro 'PREFIX='\''/app'\''' ) && /usr/bin/make -f Makefile 
Project ERROR: Unknown module(s) in QT: core dbus
make[1]: *** [Makefile:48: sub-nemo-dbus-make_first] Error 3
make[1]: Leaving directory '/run/build/nemodbus/src'
make: *** [Makefile:48: sub-src-make_first] Error 2
Error: module nemodbus: Child process exited with code 2


EXPECTED RESULT

Compiled package

SOFTWARE/OS VERSIONS

Host: Gentoo Linux

> flatpak info org.kde.Platform/arm/5.12

KDE Application Platform - Shared libraries used by KDE applications

          ID: org.kde.Platform
         Ref: runtime/org.kde.Platform/arm/5.12
        Arch: arm
      Branch: 5.12
     License: GPL-2.0+
      Origin: flathub
  Collection: org.flathub.Stable
Installation: user
   Installed: 833.2 MB

      Commit: 1ee817713c7bd10283edd21bfb8422ea3374026a74d33877d1022e080d305982
      Parent: 66fd0fc54247a0d6cc31b0e3c57576dc910d12489154f055a6f77d1a25f1568e
     Subject: update to phonon 4.11.1 (0c2498fb)
        Date: 2019-11-19 05:16:39 +0000

> flatpak info org.kde.Sdk/arm/5.12     

KDE Software Development Kit - Tools and headers for developing applications
using the KDE application platform

          ID: org.kde.Sdk
         Ref: runtime/org.kde.Sdk/arm/5.12
        Arch: arm
      Branch: 5.12
     License: GPL-2.0+
      Origin: flathub
  Collection: org.flathub.Stable
Installation: user
   Installed: 1.6 GB

      Commit: c7262c07411e7a8e378fe527b8b53bc0cf198a6664c8eb73418fa9dac1d098fe
      Parent: 77ac4a55f469ab76b17a12b76be794920cfb11aefdc921324bfdda73244de2ae
     Subject: update to phonon 4.11.1 (0c2498fb)
        Date: 2019-11-19 05:13:51 +0000
Comment 1 Rinigus 2020-01-14 18:52:12 UTC
Same issue is observed for KDE 5.13
Comment 2 Aleix Pol 2020-01-16 02:32:35 UTC
Would you be able to investigate a bit what could be wrong? I'm quite clueless myself about qmake. :/
Comment 3 Rinigus 2020-01-16 15:54:59 UTC
I will look into it and will report back
Comment 4 Rinigus 2020-01-17 18:46:28 UTC
It maybe some issue with my local setup. On Flathub servers, all is working as expected. I keep the issue open for now, will try to figure out what's going on.

If someone can test cross-building of ARM package (as attached), would be great to know the results.
Comment 5 Rinigus 2020-01-18 10:18:44 UTC
Feel free to close as it looks to be an issue with my emulation environment. When running on native platform, all works as expected. I will have to figure out meanwhile what's wrong in my setup, but that's not related to KDE Flatpak environment as such.
Comment 6 Aleix Pol 2020-01-19 23:58:00 UTC
Alright, closing for now. Thanks for reaching out anyway, glad you're using the runtime! :)
Comment 7 Rinigus 2020-01-20 21:00:27 UTC
I think I have been hitting some issue with statx system call which is triggered in QEMU or ARM32. Haven't looked deeper, but look to be related:

https://bugreports.qt.io/browse/QTBUG-64490
https://bugreports.qt.io/browse/QTBUG-68205
https://bugreports.qt.io/browse/QTBUG-66930
Comment 8 Rinigus 2020-01-30 17:57:49 UTC
I am reopening it as I think that statx call was expected to be disabled.

Namely, I believe we are hitting issue in QEMU https://bugs.launchpad.net/qemu/+bug/1861341 . As a result, we cannot use qmake (I suspect that https://invent.kde.org/kde/flatpak-kde-runtime/issues/3 was caused by the same issue).

Looks like you tried to disable statx and rename2 in 
https://invent.kde.org/kde/flatpak-kde-runtime/blob/qt5.12lts/patch/qtbase-avoid-hardcoding-kernel-version.patch

However, statx is disabled only for Android in Qt: https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qfilesystemengine_unix.cpp?h=5.12#n98 . For Linux, it looks like it will depend on local sources. So, if we wish to disable statx, we would have to ensure that https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qfilesystemengine_unix.cpp?h=5.12#n313 will fail. 

I guess a patch with "#undef STATX_BASIC_STATS" in somewhere after includes in qtbase.git/tree/src/corelib/io/qfilesystemengine_unix.cpp would resolve it.

If you think that its inappropriate to reopen it and should be closed, please do so. As such, its not KDE Flatpak bug, but workaround for qemu issue. But it does hinder development with the runtime.
Comment 9 Jan Grulich 2020-01-31 08:33:38 UTC
Maybe statx doesn't need to be disabled anymore with Qt 5.13. I will try to build it with and without disabled statx and verify it.

The reason why we disabled them was to avoid hardcoding kernel version requirements. With all those enabled, Qt build was requiring kernel 3.17.y or something like that, why without those enabled it was kernel 2.x.
Comment 10 Rinigus 2020-01-31 09:01:50 UTC
Re disabling statx:

I am arguing that the patch which you use to disable statx is not working. As such, you have statx enabled right now.

If you try to build KDE runtime for arm using QEMU, it will fail quite early as soon as qmake is created. And it will fail due to the missing statx in QEMU/arm, as it looks to me.

So, by enabling statx, you are making it impossible to compile for ARM using qmake and on regular workstations. 

For me 5.13 doesn't work either and this time nor with qmake nor cmake - basically no way to build. Can't tell whether cmake failure is also statx related, as they seem to have some checks for permissions: https://github.com/Kitware/CMake/blame/master/Utilities/cmlibuv/src/unix/fs.c#L1154
Comment 11 mirh 2020-03-29 20:38:09 UTC
(In reply to Jan Grulich from comment #9)
> The reason why we disabled them was to avoid hardcoding kernel version
> requirements. With all those enabled, Qt build was requiring kernel 3.17.y
> or something like that, why without those enabled it was kernel 2.x.

If I look at the sources, that was never committed though. 

I can only see bug 403042 which pertains flatpak specifically, but qt-base is still untouched to this day. I just banged my head like two afternoons before realizing sddm wasn't booting on 3.16 due to this.
Comment 12 Jan Grulich 2020-03-30 04:42:51 UTC
(In reply to mirh from comment #11)
> (In reply to Jan Grulich from comment #9)
> > The reason why we disabled them was to avoid hardcoding kernel version
> > requirements. With all those enabled, Qt build was requiring kernel 3.17.y
> > or something like that, why without those enabled it was kernel 2.x.
> 
> If I look at the sources, that was never committed though. 
> 
> I can only see bug 403042 which pertains flatpak specifically, but qt-base
> is still untouched to this day. I just banged my head like two afternoons
> before realizing sddm wasn't booting on 3.16 due to this.

This was pushed only to our Flatpak builds, not to upstream.