-
Notifications
You must be signed in to change notification settings - Fork 119
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
Assorted fixes for Xcode 16 #10092
Assorted fixes for Xcode 16 #10092
Conversation
This option breaks the Qt/iOS application setup. Qt tries to override the program entrypoint on iOS, and directs it to _qt_main_wrapper() instead using a linker argument, but these arguments get dropped when building as a dylib, causing Xcode to skip _qt_main_wrapper() and invokes main() directly.
We encounter an assert in Xcode 16 because the sortCallback method used in the DeviceModel does not satisfy strict-weak ordering due to the special case added for the current device. To fix this we can simplify the callback so that it sorts by creation time and move the current device as a second step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting this build failure when building for sim:
Building for 'iOS-simulator', but linking in dylib (/Users/mcleinman/code/mozilla-vpn-client/build-ios/qtglean/unified/debug/QtGleanBindings.framework/QtGleanBindings) built for 'iOS'
I'm happy to pair on this if you want - may be easiest.
src/commands/commandui.cpp
Outdated
QString simDeviceName = QString(qgetenv("SIMULATOR_DEVICE_NAME")); | ||
if (!simDeviceName.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QString simDeviceName = QString(qgetenv("SIMULATOR_DEVICE_NAME")); | |
if (!simDeviceName.isEmpty()) { | |
bool isSimDevice = !QString(qgetenv("SIMULATOR_DEVICE_NAME")).isEmpty; | |
if (isSimDevice) { |
Nit: I find it more readable when it looks something like this (here and in other spots we check for sim). I'm a tad concerned a far-future reader will not immediately understand that this is checking just for iOS simulator (and not generally checking for iOS), but it's up to you.
I find that switching from device-to-simulator (or vice-versa) i have to delete the CMake build dir and start again. Once built for one, or the other, it becomes sticky and will only build that way. I think the underlying cause is that static libraries we build ourselves (eg: the rust stuff, wireguard-go, and sentry) get the target platform baked into them and result in this kind of linker error. There are a handful of ways to tackle this:
|
I dunno how much of a pain the simulator-switching experience really is but I figured the fix is too big of a thing to tackle in this PR, and at least it's less broken than before :) |
My error was starting from a blown-away build folder for iOS - so starting from scratch. I suppose it wasn't a fully cleaned repo, I can try again with a fully clean repo. Agreed that switching can be saved for another PR. |
I'm still getting errors when building for simulator, when building the iosglean target:
My steps:
I'm going to send you a meeting invite so we can look at this synchronously. |
This seems to be a bug in the daemon recovery logic. The initialization steps starts with a QLocalSocket::abort() to clear the socket state and this can sometimes generate a disconnect signal, treating disconnection as an error can result in an infinite loop.
When running on mobile, we need to support a speculative onboarding connection in the controller. This is a special case handled in the iOS and Android controllers. To try and generalize this, lets add an onboarding state and reason to the controller and pass it down to the local-socket based daemons so that they can setup permissions and emit a disconnection to end the onboarding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I feel about adding yet another state here. Let's all talk it through in our next engineering meeting? Or if you feel like this PR is getting stale, we can schedule a meeting next week if enough of us are around.
I started this workstream with the intention of getting the iOS simulator working and it kind of got subsumed by trying to get builds working in Xcode 16. This has kind of grown to the point where it's no longer clear what the point of this PR is. I think the better path forward is to split this PR into two distinct chunks of work so that they can be reviewed separately. |
Description
I've been trying to get my iOS development environment working again after the latest round of updates from Apple. Here's the fixes I've had to apply in order to get going.
The simulator even works too, but switching from device to simulator (and vice versa) is broken and requires a complete rebuild. Looks to be something to do with how sentry/breakpad gets built that bakes in the platform config. That probably needs to be turned into a fat binary or framework or something.
Reference
Checklist