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

nix: set ios status-go targets #17139

Merged
merged 1 commit into from
Sep 7, 2023
Merged

nix: set ios status-go targets #17139

merged 1 commit into from
Sep 7, 2023

Conversation

yakimant
Copy link
Member

@yakimant yakimant commented Aug 29, 2023

Summary

In order to build less for iOS we need to set status-go targets depending on iOS platform (or device type):

  • if we build for simulator, targets should be iossimulator (both x86 and arm)
  • if we build for real device, targets should be ios

As for app architecture, after some research:

  • For device - it's always arm64. Which is good, we only have arm64 iphones currently
  • For simulator - there could be an option to build only x86 or arm. Needs more investigation.

@status-im-auto
Copy link
Member

status-im-auto commented Aug 29, 2023

Jenkins Builds

Click to see older builds (24)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 184d130 #1 2023-08-29 13:39:13 ~6 min android 🤖apk 📲
✔️ 184d130 #1 2023-08-29 13:41:52 ~8 min android-e2e 🤖apk 📲
✔️ 184d130 #1 2023-08-29 13:42:50 ~9 min tests 📄log
✔️ 184d130 #1 2023-08-29 13:45:49 ~12 min ios 📱ipa 📲
✔️ 71acd85 #2 2023-08-30 12:11:05 ~5 min android-e2e 🤖apk 📲
✔️ 71acd85 #2 2023-08-30 12:11:42 ~6 min android 🤖apk 📲
✔️ 71acd85 #2 2023-08-30 12:13:27 ~8 min ios 📱ipa 📲
✔️ 71acd85 #2 2023-08-30 12:14:50 ~9 min tests 📄log
✔️ d3815fa #3 2023-08-30 12:47:31 ~5 min android 🤖apk 📲
✔️ d3815fa #3 2023-08-30 12:49:00 ~7 min android-e2e 🤖apk 📲
✔️ d3815fa #3 2023-08-30 12:50:06 ~8 min ios 📱ipa 📲
✔️ d3815fa #3 2023-08-30 12:50:41 ~8 min tests 📄log
✔️ 38becf9 #4 2023-08-30 14:44:11 ~6 min android-e2e 🤖apk 📲
✔️ 38becf9 #4 2023-08-30 14:44:13 ~6 min android 🤖apk 📲
✔️ 38becf9 #4 2023-08-30 14:46:52 ~9 min ios 📱ipa 📲
✔️ 38becf9 #4 2023-08-30 14:46:52 ~8 min tests 📄log
✔️ 62f4615 #7 2023-08-31 11:16:56 ~7 min android-e2e 🤖apk 📲
✔️ 62f4615 #7 2023-08-31 11:17:35 ~8 min android 🤖apk 📲
✔️ 62f4615 #7 2023-08-31 11:18:18 ~9 min tests 📄log
✔️ 62f4615 #7 2023-08-31 11:19:50 ~10 min ios 📱ipa 📲
✔️ 1b4cd84 #8 2023-08-31 11:57:17 ~5 min android 🤖apk 📲
✔️ 1b4cd84 #8 2023-08-31 11:58:10 ~6 min ios 📱ipa 📲
✔️ 1b4cd84 #8 2023-08-31 11:59:31 ~7 min android-e2e 🤖apk 📲
✔️ 1b4cd84 #8 2023-08-31 12:00:54 ~9 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8539c7f #9 2023-09-04 10:04:33 ~6 min android 🤖apk 📲
✔️ 8539c7f #9 2023-09-04 10:04:52 ~6 min android-e2e 🤖apk 📲
✔️ 8539c7f #9 2023-09-04 10:08:11 ~9 min tests 📄log
✔️ 8539c7f #9 2023-09-04 10:13:19 ~14 min ios 📱ipa 📲
✔️ b7a0907 #10 2023-09-07 12:22:49 ~6 min android-e2e 🤖apk 📲
✔️ b7a0907 #10 2023-09-07 12:22:51 ~6 min android 🤖apk 📲
✔️ b7a0907 #10 2023-09-07 12:25:10 ~9 min tests 📄log
✔️ b7a0907 #10 2023-09-07 12:29:36 ~13 min ios 📱ipa 📲

@yakimant
Copy link
Member Author

yakimant commented Aug 29, 2023

ci builds, make release-ios:

❯ xcodebuild -showBuildSettings -scheme StatusIm -sdk iphoneos -configuration Release 2> /dev/null| grep "VALID_ARCHS\|CURRENT_ARCH" | sort | uniq
    CURRENT_ARCH = arm64
    VALID_ARCHS = arm64

ci PR builds:
For StatusImPR it is always resolved as arm64

make run-ios-device:

❯ xcodebuild -showBuildSettings -scheme StatusIm -sdk iphoneos -configuration Debug 2> /dev/null| grep "VALID_ARCHS\|CURRENT_ARCH" | sort | uniq
    CURRENT_ARCH = arm64
    VALID_ARCHS = x86_64 arm64

make run-ios:

❯ xcodebuild -showBuildSettings -scheme StatusIm -sdk iphonesimulator -configuration Debug 2> /dev/null| grep "VALID_ARCHS\|CURRENT_ARCH" | sort | uniq
    CURRENT_ARCH = undefined_arch
    VALID_ARCHS = x86_64

ci e2e build:

❯ xcodebuild -showBuildSettings -scheme StatusIm -sdk iphonesimulator -configuration Release 2> /dev/null| grep "VALID_ARCHS\|CURRENT_ARCH" | sort | uniq
    CURRENT_ARCH = arm64
    VALID_ARCHS = arm64

outputFileName = "Statusgo.xcframework";
inherit meta source goBuildLdFlags;
inherit meta source goBuildLdFlags targets;
Copy link
Member

Choose a reason for hiding this comment

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

Are we not doing a map here? Like we do from Gradle architectures to Gomobile architectures?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we don't.

iOS ARCH is set inside Xcode project file by a combination defferent options. Resulted ARCH can be extracted.

Although in our case we can do a much simpler "mapping":

  • if it's a device build - build status-go for ios target
  • if it's a simulator build - build status-go for iossimulator target

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, lets keep it simple.

@yakimant
Copy link
Member Author

Some notes left:

  • Read on gomobile architerctures: https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile
  • Simulator build has redundant architectures for pods: both x86_64 and arm64 are built. Although we build the app and status-go for x86_64 only.
  • Simulator build is for x86_64 currently, although we could build arm64 or x86_64 depending on the host arch (intel or apple silicon).

@yakimant yakimant force-pushed the set_ios_status_go_targets branch 2 times, most recently from 3d2bff0 to 62f4615 Compare August 31, 2023 11:08
@yakimant yakimant marked this pull request as ready for review August 31, 2023 11:09
@yakimant yakimant requested a review from jakubgs August 31, 2023 11:51
Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

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

Looks good, but needs testing with devs.

@yakimant
Copy link
Member Author

yakimant commented Sep 4, 2023

@siddarthkay @cammellos, can you please help to test the PR?

  1. build/run stil works for iOS (run-ios or run-ios-device, whichever you run)
  2. status-go build arch restriction works. Only one arch in log "Building status-go for: {ARCH NAME}". Please post the ling.
    Thanks a lot in advance!

@yakimant yakimant merged commit b7a0907 into develop Sep 7, 2023
2 checks passed
@yakimant yakimant deleted the set_ios_status_go_targets branch September 7, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants