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

Xcode 16.0 compatibility #1524

Merged
merged 11 commits into from
Oct 3, 2024
Merged

Xcode 16.0 compatibility #1524

merged 11 commits into from
Oct 3, 2024

Conversation

mplorentz
Copy link
Member

@mplorentz mplorentz commented Sep 19, 2024

This fixes all compiler errors and gets our project building on Xcode 16. There is some remaining work to do before we fully upgrade, but this is a start and lets us play with the new features in Xcode 16. The remaining work is filed under #1570.

@mplorentz mplorentz changed the title Upgrade to Xcode 16.0 Xcode 16.0 compatibility Oct 1, 2024
@mplorentz mplorentz marked this pull request as ready for review October 1, 2024 15:47
@mplorentz mplorentz marked this pull request as draft October 1, 2024 16:02
@joshuatbrown
Copy link
Contributor

I'm able to build the app in Xcode 15.2 but not the unit tests. It looks like the issue is described in nalexn/ViewInspector#333. Their solution? Use Xcode 15.4 or later, which I've confirmed works for me. I'm not opposed to Xcode 15.4, though I know it makes our SwiftUI previews a little more annoying to use. I expect that to be temporary, though, and that we'll be on Xcode 16 soon enough.

@mplorentz
Copy link
Member Author

@joshuatbrown ok yeah this is a weird transitionary period, so let's go to 15.4 for now, and 16.0 soon™. Can you check the steps for using SwiftUI on Xcode 15.4 so we can share them with the other developers? I forget if you had to build twice or "build for testing".

@mplorentz mplorentz marked this pull request as ready for review October 2, 2024 15:33
@joshuatbrown
Copy link
Contributor

👀

Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Xcode upgrades are never as much fun as they should be.

CHANGELOG.md Outdated
@@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Publish empty metadata event and empty contact list on delete account. [#1530](https://github.com/planetary-social/nos/issues/1530)

### Internal Changes
- Update Xcode to version 16.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love a little more explanation in here since we're changing .xcode-version to 15.4 while adding compatibility for 16. Something along those lines would be perfect.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mplorentz I did it. I also moved it up to the Unreleased section.

@@ -2936,7 +2936,7 @@
CURRENT_PROJECT_VERSION = 224;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to call this out in the CHANGELOG, too? Or is this a case where we were actually targeting iOS 17 already but these were set to 16.2?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see now that it was just the performance test target. No need for a CHANGELOG update, I think.

@joshuatbrown
Copy link
Contributor

Previews don't always work automatically in Xcode 15.4 and require some manual intervention. If previews aren't working and you see this error, follow the steps below.

Failed to build the scheme "Nos"

  1. Select a simulator (since you can't build for testing with My Mac selected)
  2. Build for Testing (Product > Build For > Testing). Alternatively, run the tests, which builds them first.
  3. Click the rebuild (↻) button on the Preview
  4. Your preview should appear

It's possible that Step 2 may be unnecessary, and the real issue is that Previews can't build when "My Mac" is selected.

Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

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

Perfecto!

@joshuatbrown joshuatbrown enabled auto-merge October 3, 2024 20:08
@joshuatbrown joshuatbrown added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit 9c95134 Oct 3, 2024
4 checks passed
@joshuatbrown joshuatbrown deleted the xcode16 branch October 3, 2024 20:23
@joshuatbrown
Copy link
Contributor

@pelumy Now that this is merged, you'll need to use Xcode 15.4 or 16 -- Xcode 15.2 doesn't work any more. I just updated the iOS Onboarding doc in Notion; not sure if we have anything else to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants