Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: iOS: Use Qt6 and bump build environment #3065

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ann0see
Copy link
Member

@ann0see ann0see commented May 11, 2023

Adds a Crash-fix by @danryu for a new ios Qt 6 build. Unfortunately, Qt6 makes the app basically unusable on small devices. This should be fixed after this PR got in:
Qt6 breaks iOS connect dialog

Short description of changes

Updates iOS to use Qt6 (coded by @hoffie)

CHANGELOG: Update iOS build to use Qt6. For now, only larger devices are usable. Please compile with Qt5 if you use small devices.

Context: Fixes an issue?

Fixes: #2711
Fixes: #2939

Does this change need documentation? What needs to be documented and how?

Status of this Pull Request
Ready for review

What is missing until this pull request can be merged?

Nothing. However, a follow up for the GUI fix (?) should come in after the merge of this.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@ann0see ann0see added this to the Release 3.10.0 milestone May 11, 2023
@ann0see ann0see added this to Triage in Tracking (old) via automation May 11, 2023
@ann0see ann0see moved this from Triage to Waiting on Team in Tracking (old) May 11, 2023
@ann0see
Copy link
Member Author

ann0see commented May 11, 2023

@ngocdh as you initially fixed the iOS GUI (I think), do you have any insights on what could be the issue with Qt 6?

@ngocdh
Copy link
Contributor

ngocdh commented May 11, 2023

@ngocdh as you initially fixed the iOS GUI (I think), do you have any insights on what could be the issue with Qt 6?

Hi @ann0see I only worked on iOS audio code and maybe some UI related issues but not iOS related if I recall correctly. I did try to fix some mobile UI issues, but not knowing Qt, I made it even worse so eventually gave up.

@ann0see
Copy link
Member Author

ann0see commented May 12, 2023

Ok. Then someone else fixed them.

@ngocdh
Copy link
Contributor

ngocdh commented May 12, 2023

#1450 maybe?

@ann0see
Copy link
Member Author

ann0see commented May 12, 2023

Ah yes. Maybe something is not set correctly in the conditional or we have the multiple window support enabled.

@@ -53,6 +53,11 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
layout()->setMenuBar ( pMenu );
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smells like avoidable duplication.

Copy link
Collaborator

@pljones pljones May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we live with this for now as it's not directly related?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but worth an issue

@ann0see
Copy link
Member Author

ann0see commented May 13, 2023

Ok. I think the chat dialog needs to be fixed (which crashes if I tap on close...) still - but that was the correct direction...
Edit: Basically every window needs the full screen thingy now.

src/connectdlg.cpp Outdated Show resolved Hide resolved
@@ -148,14 +148,14 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR
// set a placeholder text to explain how to filter occupied servers (#397)
edtFilter->setPlaceholderText ( tr ( "Filter text, or # for occupied servers" ) );

// setup timers
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the order we set the maximized state matters. At least in the version which kind of worked - I first needed to rotate the screen to allow it getting the correct sizing - but that's way better than it was.

@ann0see
Copy link
Member Author

ann0see commented May 13, 2023

Ok. At least connecting works - servers with welcome message bring issues due to the crash if close is tapped (this doesn't happen if I'm not connected to a server but the chat window is open)

Hmm. Maybe that's wrong. The crash log gives

VM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\n",
  "vmregioninfo" : "0 is not in any region.

Probably we dereference a null pointer.

Edit: Also changing to the Android way of the close button in the edit window doesn't change anything.

@ann0see
Copy link
Member Author

ann0see commented May 21, 2023

The iOS log says at the start of the iOS app

May 21 20:22:02 Jamulus[58448] <Notice>: Detected system locale encoding (US-ASCII, locale "C") is not UTF-8.
Qt shall use a UTF-8 locale ("UTF-8") instead. If this causes problems,
reconfigure your locale. See the locale(1) manual for more information.

I don't think that's related but interesting to know. I'll downgrade the SDK. Maybe that fixes it? I don't really understand the issue. To me it seems like we dereference a NULL pointer.

May 21 20:22:25 SpringBoard(KeyboardArbiter)[55730] <Error>: [<_UIKeyboardArbiter: 0x28236ed80; <<_UIKeyboardArbiter_ForSpringBoard: 0x281653c90>; scene = <FBSScene: 0x28368ba80; identifier: com.apple.UIKit.remote-keyboard; valid: YES> {
    settings = <UIApplicationSceneSettings: 0x283602280> {
        displayConfiguration = "<FBSDisplayConfiguration: 0x28216f560; Main; mode: "320x568@2x 60Hz sRGB SDR">";
        frame = {{0, 0}, {320, 568}};
        level = 2.0;
        interfaceOrientation = unknown (0);
        foreground = NO;
        interruptionPolicy = default;
        isOccluded = BSSettingFlagNotSet;
        activityMode = default;
        jetsamMode = default;
    };
    clientSettings = <UIApplicationSceneClientSettings: 0x2803572c0> {
        layers = (empty);
        preferredLevel = 2.0;
        preferredInterfaceOrientation = unknown (0);
    };
    hostProcess = <FBApplicationProcess: 0x10310b770; daemon<com.apple.SpringBoard>:55730(v286BE); taskState: Running; visibility: Unknown>;
}>;
disabler = (null);
lastEventSource = 0;
current state = (null);
active handle = (null);
handles = (
    "<_UIKeyboardArbiterHandle: 0x282f72cb0; PID 55730: com.apple.springboard <com.apple.frontboard.systemappservices::com.apple.springboard>; hosting PIDs {(\134n)}; level 2.000000; active NO [wants NO]; suppression 0; iav 0.000000; on screen NO>",
    "<_UIKeyboardArbiterHandle: 0x282f41b80; PID 56371: (null) <(null)>; hosting PIDs {(\134n)}; level 0.000000; active NO [wants NO]; suppression 0; iav 0.000000; on screen NO>",
    "<_UIKeyboardArbiterHandle: 0x282f4c9a0; PID 57286: com.apple.MailCompositionService <(null)> (suspended); hosting PIDs {(\134n)}; level 0.000000; active NO [wants NO]; suppression 0; iav 0.000000; on screen NO>",
    "<_UIKeyboardArbiterHandle: 0x282f27700; PID 57909: com.apple.PassbookUIService <(null)> (suspended); hosting PIDs {(\134n)}; level 0.000000; active NO [wants NO]; suppression 0; iav 0.000000; on screen NO>"
)>] No handle found for currently focused PID: 58448; sceneIdentity: com.apple.frontboard.systemappservices::sceneID%3Aio.jamulus.Jamulus.<redacted>-default

Is probably the place where the error occurs.

May 21 20:22:26 ReportCrash(CoreAnalytics)[58352] <Notice>: Sending event: com.apple.stability.crash {"bundleID":"io.jamulus.Jamulus.<redacted>","bundleVersion":"1","exceptionCodes":"0x0000000000000001, 0x0000000000000000(\134n    1,\134n    0\134n)EXC_BAD_ACCESSSIGSEGVKERN_INVALID_ADDRESS at 0x0000000000000000","incidentID":"DFD5F2F2-D1FF-4E87-9C72-BDC2882CCEB8","logwritten":1,"process":"Jamulus","terminationReasonExceptionCode":"0xb","terminationReasonNamespace":"SIGNAL"}
May 21 20:22:26 analyticsd[100] <Notice>: Received event: com.apple.stability.crash {"bundleID":"io.jamulus.Jamulus.<redacted>","bundleVersion":"1","exceptionCodes":"0x0000000000000001, 0x0000000000000000(\134n    1,\134n    0\134n)EXC_BAD_ACCESSSIGSEGVKERN_INVALID_ADDRESS at 0x0000000000000000","incidentID":"DFD5F2F2-D1FF-4E87-9C72-BDC2882CCEB8","logwritten":1,"process":"Jamulus","terminationReasonExceptionCode":"0xb","terminationReasonNamespace":"SIGNAL"}
May 21 20:22:26 analyticsd[100] <Notice>: Aggregated. Transform: StabilityCrashNumerator3WithBundleVersion Dirty: 1 Event: com.apple.stability.crash {"bundleID":"io.jamulus.Jamulus.<redacted>","bundleVersion":"1","exceptionCodes":"0x0000000000000001, 0x0000000000000000(\134n    1,\134n    0\134n)EXC_BAD_ACCESSSIGSEGVKERN_INVALID_ADDRESS at 0x0000000000000000","incidentID":"DFD5F2F2-D1FF-4E87-9C72-BDC2882CCEB8","logwritten":1,"process":"Jamulus","terminationReasonExceptionCode":"0xb","terminationReasonNamespace":"SIGNAL","timestamp":1684693346614102}
May 21 20:22:26 analyticsd[100] <Notice>: Aggregated. Transform: StabilityCrashNumerator3WithIncidentID Dirty: 1 Event: com.apple.stability.crash {"bundleID":"io.jamulus.Jamulus.<redacted>","bundleVersion":"1","exceptionCodes":"0x0000000000000001, 0x0000000000000000(\134n    1,\134n    0\134n)EXC_BAD_ACCESSSIGSEGVKERN_INVALID_ADDRESS at 0x0000000000000000","incidentID":"DFD5F2F2-D1FF-4E87-9C72-BDC2882CCEB8","logwritten":1,"process":"Jamulus","terminationReasonExceptionCode":"0xb","terminationReasonNamespace":"SIGNAL","timestamp":1684693346614102}
May 21 20:22:26 analyticsd[100] <Notice>: Aggregated. Transform: StabilityCrashNumerator3 Dirty: 1 Event: com.apple.stability.crash {"bundleID":"io.jamulus.Jamulus.<redacted>","bundleVersion":"1","exceptionCodes":"0x0000000000000001, 0x0000000000000000(\134n    1,\134n    0\134n)EXC_BAD_ACCESSSIGSEGVKERN_INVALID_ADDRESS at 0x0000000000000000","incidentID":"DFD5F2F2-D1FF-4E87-9C72-BDC2882CCEB8","logwritten":1,"process":"Jamulus","terminationReasonExceptionCode":"0xb","terminationReasonNamespace":"SIGNAL","timestamp":1684693346614102}

seems to be where the system logs the error.

@ann0see
Copy link
Member Author

ann0see commented May 21, 2023

Now a linking error... I'll try to downgrade to Qt5 and then raise another PR if that works.

@ann0see ann0see mentioned this pull request May 21, 2023
5 tasks
@ann0see
Copy link
Member Author

ann0see commented May 21, 2023

Ok. It could be that just adding the flags doesn't solve the problem. We might need to load some plugins manually

https://stackoverflow.com/questions/45508043/qt-ios-linker-error-entry-point-main-undefined

@ann0see
Copy link
Member Author

ann0see commented May 21, 2023

The build seems to also produce binaries for the iOS simulator - so the IPA would also run on the x86 mac simulator - which is not what we want. I think deploy_ios.sh needs to be tweaked too...

https://forum.qt.io/topic/140559/qmake-cmake-build-apk-and-ios-app-via-terminal/5

@ann0see
Copy link
Member Author

ann0see commented May 21, 2023

I believe the change in deploy_ios.sh removed the simulator as target. This needs further investigation (might be related to the issue not needing the macOS workaround).

I believe this PR should be considered as in development now. The Qt5 one should be ready.

@ann0see ann0see removed this from the Release 3.10.0 milestone May 21, 2023
@ann0see ann0see marked this pull request as draft May 21, 2023 21:11
@pljones pljones moved this from Waiting on Team to In Progress in Tracking (old) May 22, 2023
hoffie and others added 2 commits May 22, 2023 22:11
Crash-fix by @danryu.

Co-authored-by: Dan G <dan.garton@gmail.com>

Fixes: jamulussoftware#2711
Fixes: jamulussoftware#2939
* Enforce fullscreen mode on mobile OS

* Unify iOS and Android logic
@ann0see
Copy link
Member Author

ann0see commented May 22, 2023

The warning sounds bad here. Xcode would like us to use " instead of < for includes as far as I understand? But doesn't < have a meaning that it's in the include path and something standard while " means that it's a header file of the project?

Putting https://stackoverflow.com/questions/65943369/what-is-a-headermap-in-c-or-c-or-objective-c here

Edit: Maybe it's not the case: https://developer.apple.com/documentation/xcode-release-notes/build-system-release-notes-for-xcode-10

Also it doesn't find lrelease...

@pljones
Copy link
Collaborator

pljones commented May 23, 2023

Use quote-style include ("example.h") for project headers, and reserve angle-bracket include (<example.h>) for system headers.

So no change there. The only thing C++ seems to do is drop the .h? (So <vector> rather than (Objective?) C's #include <fcntl.h>.)

## Builds an ipa file for iOS. Should be run from the repo-root

# Create Xcode file and build
qmake -spec macx-xcode Jamulus.pro
eval "${qmake_path} Jamulus.pro"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like eval here

ann0see

This comment was marked as resolved.

@pljones pljones added this to the Release 3.10.0 milestone May 31, 2023
@ann0see
Copy link
Member Author

ann0see commented Jun 6, 2023

Ok. Could get another run on the simulator and got a crash:

2023-06-06 21:33:10.326150+0200 Jamulus[4974:50829] [SceneConfiguration] Info.plist contained no UIScene configuration dictionary (looking for configuration named "(no name)")
2023-06-06 21:33:10.398742+0200 Jamulus[4974:50829] - allocated port number: 22134
2023-06-06 21:33:10.977508+0200 Jamulus[4974:50829] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003090120> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2023-06-06 21:33:32.011739+0200 Jamulus[4974:50829] fopen failed for data file: errno = 2 (No such file or directory)
2023-06-06 21:33:32.012905+0200 Jamulus[4974:50829] Errors found! Invalidating cache...
2023-06-06 21:33:32.929661+0200 Jamulus[4974:50829] fopen failed for data file: errno = 2 (No such file or directory)
2023-06-06 21:33:32.929946+0200 Jamulus[4974:50829] Errors found! Invalidating cache...
2023-06-06 21:33:44.013115+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.013782+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.015753+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.016987+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.018262+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.018982+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:44.023379+0200 Jamulus[4974:50829] QHBoxLayout(0x6000030c17e0, name = "horizontalLayout_7") is laying out QTabWidget(0x600003ebc0f0, name="tabSettings") outside of the contents rect of CClientSettingsDlg(0x7ff7ba208398, name="CClientSettingsDlgBase")
2023-06-06 21:33:57.247931+0200 Jamulus[4974:50829] ASSERT failure in QCoreApplication::sendEvent: "Unexpected null receiver", file /Users/qt/work/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 1527
CoreSimulator 857.14 - Device: iPhone 14 Pro Max (A0A2608F-FCF3-4B1B-9E96-A64EC82AD958) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 14 Pro Max
(lldb) 

@ann0see
Copy link
Member Author

ann0see commented Jun 6, 2023

It could also be a race condition. But that would be out of scope of Jamulus and a Qt bug?

@ann0see
Copy link
Member Author

ann0see commented Jun 6, 2023

hide() instead of close() works. So tat would be an option.

@pljones
Copy link
Collaborator

pljones commented Jun 7, 2023

We've already got issues on Android where the application gets hidden without going through close and not saving settings.

I'd beware of hiding rather than closing when the user asks to exit until we're catching all OS signals indicating we should save state (there's a Qt signal, IIRC).

#2395

@ann0see
Copy link
Member Author

ann0see commented Jun 8, 2023

I know. But it's hard to debug. I have the feeling that Qt6 (Widgets) isn't ready at all.

@pljones pljones moved this from In Progress to Backlog in Tracking (old) Jun 25, 2023
@pljones
Copy link
Collaborator

pljones commented Jun 25, 2023

Any progress on this or can it be dropped from 3.10.0 (with #2711)?

@ann0see
Copy link
Member Author

ann0see commented Jun 25, 2023

I think this can be dropped. I think it could also be a Qt bug which we can't really fix.

@pljones pljones removed this from Backlog in Tracking (old) Jun 26, 2023
@pljones pljones removed this from the Release 3.10.0 milestone Jun 26, 2023
@pljones pljones added the tooling Changes to the automated build system label Aug 19, 2023
@pljones pljones added this to the Release 3.12.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Changes to the automated build system
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

iOS: Investigate Qt6 crash & update afterwards Build: Update iOS build environment (macos-10.15)
4 participants