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: add ios-deploy package to ios shell #15699

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Conversation

jakubgs
Copy link
Member

@jakubgs jakubgs commented Apr 20, 2023

Also adds an assertion that gives a better error when trying to use an ios Nix shell on an unsupported operating system.

Resolves:

@jakubgs jakubgs requested a review from siddarthkay April 20, 2023 10:38
@jakubgs jakubgs self-assigned this Apr 20, 2023
@status-im-auto
Copy link
Member

status-im-auto commented Apr 20, 2023

Jenkins Builds

Click to see older builds (41)
Commit #️⃣ Finished (UTC) Duration Platform Result
911749a #1 2023-04-20 10:39:07 ~27 sec ios 📄log
911749a #1 2023-04-20 10:39:49 ~1 min tests 📄log
1e5493a #2 2023-04-20 10:43:38 ~1 min tests 📄log
1e5493a #2 2023-04-20 10:43:52 ~1 min ios 📄log
✔️ 1e5493a #2 2023-04-20 10:48:25 ~6 min android-e2e 🤖apk 📲
✔️ 1e5493a #2 2023-04-20 10:48:35 ~6 min android 🤖apk 📲
1e5493a #3 2023-04-20 11:02:31 ~15 min ios 📄log
fecd809 #3 2023-04-20 11:28:05 ~51 sec tests 📄log
fecd809 #4 2023-04-20 11:31:16 ~4 min ios 📄log
✔️ fecd809 #3 2023-04-20 11:33:02 ~5 min android-e2e 🤖apk 📲
✔️ fecd809 #3 2023-04-20 11:33:09 ~6 min android 🤖apk 📲
fecd809 #5 2023-04-20 11:37:58 ~37 sec ios 📄log
2870fb6 #6 2023-04-20 12:06:52 ~1 min ios 📄log
2870fb6 #4 2023-04-20 12:08:00 ~2 min android 📄log
2870fb6 #4 2023-04-20 12:08:11 ~3 min tests 📄log
2870fb6 #4 2023-04-20 12:08:15 ~3 min android-e2e 📄log
bb416e3 #5 2023-04-20 12:28:24 ~55 sec tests 📄log
bb416e3 #7 2023-04-20 12:32:50 ~5 min ios 📄log
✔️ bb416e3 #5 2023-04-20 12:33:13 ~5 min android-e2e 🤖apk 📲
✔️ bb416e3 #5 2023-04-20 12:33:19 ~5 min android 🤖apk 📲
76a39f9 #6 2023-04-20 13:22:51 ~1 min tests 📄log
✔️ 76a39f9 #6 2023-04-20 13:27:10 ~5 min android-e2e 🤖apk 📲
✔️ 76a39f9 #6 2023-04-20 13:27:30 ~5 min android 🤖apk 📲
76a39f9 #8 2023-04-20 14:08:01 ~46 min ios 📄log
e59ed8c #7 2023-04-20 15:03:15 ~1 min tests 📄log
✔️ e59ed8c #7 2023-04-20 15:08:40 ~6 min android 🤖apk 📲
✔️ e59ed8c #7 2023-04-20 15:08:41 ~6 min android-e2e 🤖apk 📲
✔️ e59ed8c #9 2023-04-20 15:12:56 ~10 min ios 📱ipa 📲
0524ec2 #8 2023-04-20 15:57:34 ~12 sec tests 📄log
0524ec2 #10 2023-04-20 15:57:35 ~14 sec ios 📄log
0524ec2 #8 2023-04-20 16:02:11 ~4 min android-e2e 📄log
0524ec2 #8 2023-04-20 16:03:02 ~5 min android 📄log
5564115 #9 2023-04-20 16:13:26 ~58 sec tests 📄log
✔️ 5564115 #9 2023-04-20 16:17:46 ~5 min android-e2e 🤖apk 📲
✔️ 5564115 #9 2023-04-20 16:18:25 ~5 min android 🤖apk 📲
5564115 #11 2023-04-20 16:18:51 ~6 min ios 📄log
c4bd20d #12 2023-04-20 16:20:15 ~28 sec ios 📄log
✔️ c4bd20d #10 2023-04-20 16:30:29 ~10 min android-e2e 🤖apk 📲
✔️ c4bd20d #10 2023-04-20 16:30:34 ~10 min android 🤖apk 📲
✔️ c4bd20d #10 2023-04-20 16:34:13 ~14 min tests 📄log
✔️ c4bd20d #13 2023-04-20 16:52:25 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 63ae9b8 #11 2023-04-20 17:04:10 ~6 min android-e2e 🤖apk 📲
✔️ 63ae9b8 #11 2023-04-20 17:04:15 ~6 min android 🤖apk 📲
✔️ 63ae9b8 #14 2023-04-20 17:04:41 ~6 min ios 📱ipa 📲
✔️ 63ae9b8 #11 2023-04-20 17:04:45 ~6 min tests 📄log
✔️ 3e8647d #15 2023-04-20 18:24:54 ~6 min ios 📱ipa 📲
✔️ 3e8647d #12 2023-04-20 18:25:19 ~7 min tests 📄log
✔️ 3e8647d #12 2023-04-20 18:26:30 ~8 min android 🤖apk 📲
✔️ 3e8647d #12 2023-04-20 18:26:30 ~8 min android-e2e 🤖apk 📲

@jakubgs jakubgs force-pushed the nix/add-ios-deploy branch from 911749a to 1e5493a Compare April 20, 2023 10:42
@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

It works:

[email protected]:~/status-mobile % make shell TARGET=ios
Configuring Nix shell for target 'ios'...
/Users/admin/status-mobile/modules/react-native-status/ios/RCTStatus/Statusgo.xcframework already in place
No changes detected.
Done in: 1.495s
Checking for modifications in ios/Pods...
No modifications detected.

[nix-shell:~/status-mobile]$ which ios-deploy
/nix/store/fzqr1v92q0ccdg2ssl3grx0142nbvz5r-ios-deploy-1.11.0/bin/ios-deploy

@jakubgs jakubgs force-pushed the nix/add-ios-deploy branch from 1e5493a to fecd809 Compare April 20, 2023 11:26
@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

I'm getting some weird clang build failures:

13:37:55  ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
13:37:55  clang: error: linker command failed with exit code 1 (use -v to see invocation)

And they appear to be specific to Xcode 14.3:

[email protected]:~/status-mobile/nix % xcodebuild -version
Xcode 14.2
Build version 14C18
[email protected]:~/status-mobile/nix % ls -l /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
-rw-r--r--  1 root  wheel  379168 Oct 18  2022 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
[email protected]:~ % xcodebuild -version
Xcode 14.3
Build version 14E222b
[email protected]:~ % ls -l /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
ls: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a: No such file or directory\

@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

Xcode 14.3 appears to be missing ``:

[email protected]:~/status-mobile/nix % ls -l /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc
total 1424
-rw-r--r--  1 root  wheel    60352 Oct 18  2022 libarclite_appletvos.a
-rw-r--r--  1 root  wheel    19808 Oct 18  2022 libarclite_appletvsimulator.a
-rw-r--r--  1 root  wheel  1044104 Oct 18  2022 libarclite_iphoneos.a
-rw-r--r--  1 root  wheel   180784 Oct 18  2022 libarclite_iphonesimulator.a
-rw-r--r--  1 root  wheel   379168 Oct 18  2022 libarclite_macosx.a
-rw-r--r--  1 root  wheel    60888 Oct 18  2022 libarclite_watchos.a
-rw-r--r--  1 root  wheel    29616 Oct 18  2022 libarclite_watchsimulator.a
[email protected]:~ % ls -l /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc
ls: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc: No such file or directory

@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

I found this workaround in nixpkgs:

    # On Darwin, using clang 6 to build fails because of a linker error (see #105573),
    # but using clang 7 fails because libarclite_macosx.a cannot be found when linking
    # the xcode_locator tool.
    # This patch removes using the -fobjc-arc compiler option and makes the code
    # compile without automatic reference counting. Caveat: this leaks memory, but
    # we accept this fact because xcode_locator is only a short-lived process used during the build.
    (substituteAll {
      src = ./no-arc.patch;
      multiBinPatch = if stdenv.hostPlatform.system == "aarch64-darwin" then "arm64" else "x86_64";
    })

https://github.com/NixOS/nixpkgs/blob/d0c06fa3d3982a91aa01bd63ed84020cbde3d3ab/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix#L178-L187

Maybe we can use this -fobjc-arc flag too:
https://github.com/NixOS/nixpkgs/blob/d0c06fa3d3982a91aa01bd63ed84020cbde3d3ab/pkgs/development/tools/build-managers/bazel/bazel_5/no-arc.patch

@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

And I can't copy the files from Xcode 14.2 into Xcode 14.3 because OSX me from modifying the Xcode directory:

[email protected]:/ % sudo mkdir Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc
mkdir: Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc: Operation not permitted

@jakubgs jakubgs force-pushed the nix/add-ios-deploy branch 7 times, most recently from 5564115 to c4bd20d Compare April 20, 2023 16:19
@jakubgs
Copy link
Member Author

jakubgs commented Apr 20, 2023

Looks like my workaround is the actual fix in the package: ios-control/ios-deploy@bbd951d

But it appears the 1.12.2 release has not been completed. When it is we can replace the substitution with a version override:

@jakubgs jakubgs force-pushed the nix/add-ios-deploy branch from c4bd20d to 63ae9b8 Compare April 20, 2023 16:57
Also adds an assertion that gives a better error when trying to use an
`ios` Nix shell on an unsupported operating system.

Resolves:
#15695

Signed-off-by: Jakub Sokołowski <[email protected]>
@jakubgs jakubgs force-pushed the nix/add-ios-deploy branch from 63ae9b8 to 3e8647d Compare April 20, 2023 18:17
@jakubgs jakubgs merged commit 3e8647d into develop Apr 20, 2023
@jakubgs jakubgs deleted the nix/add-ios-deploy branch April 20, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants