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
gRPC-Core fails to archive for Catalyst #20500
Comments
I have the same issue when archiving for macOS Catalyst:
|
I did a bit more investigation and found that Xcode uses at least two different sets of symbolic links when doing Catalyst archives and that seems to cause a problem with the |
I made an smaller repro case at https://github.com/paulb777/CatalystArchiveGRPC
See the build failure |
Thanks Paul. We don't have a mac with Catalina for debug right now and I'm working on getting one. Will check back. |
Reproduced the problem. Looking for the problem |
I observed the difference between build and archive: I still have no idea why the symbolic link is not generated during archive. @paulb777 any ideas? Does this look like an Xcode issue? |
@muxi It does look like an Xcode issue. It still would be interesting to understand what is different between |
That is good point. Checked the other frameworks in the same artifact directory for archive. |
Pardon my ignorance but is there a way a workout could be detailed step by step. I would greatly appreciate it, I don't know enough about symbolic links to mess with it in terminal. |
Same I am a bit lost a step by step instructions would be greatly appreciated! |
This is what I did:
|
@muxi, I tried this couple of times but didn't help :( |
hmm... I was doing it with @paulb777's reproduction project; maybe it's different in yours? @emreoktem, could you share which step did you find not working? I guess maybe I'll need to try with another project for further investigation. |
So I tried with gRPC's hello world app with gRPC v1.21.0 and was able to archive with Catalyst successfully... I'm still not figured out why it just fails for archiving, or why it fails on @paulb777's sample project but not for the hello world. |
I was able to get a Catalyst build archived with @muxi 's steps (Thank you! -- needed to do it for multiple frameworks). What needs to be done for a permanent, non-hacky solution? |
Thanks for the update. For now I don't have much idea on the root cause; doesn't look to me like anything's wrong in gRPC or Cocoapods. @paulb777 filed an issue with Apple on the difference of behaviors between build andI'l archive in Xcode, and I'll wait to see if that points us to a direction. @paulb777 - sorry that it got stuck at this place. Did you get any reply from Apple? |
No reply from Apple. Maybe it will help increase the priority if others file the same issue? |
I'll do that. |
The solution provided by @muxi is helpful! In my case, I need to fix the
|
@honghaoz - Can you provide the exact terminal commands? I understand that the directory will be different for each archive build, but I'm confused as to what the exact symlinks need to be created where. |
@joekim Hi Joe, To be exact, I did this:
You will see there're some frameworks are being built.
Basically, this creates a new symlink called Header which points to Versions/Current/Headers You should do this before Xcode reports a failure. Similarly, I did the same thing in Hope this helps! |
I felt like I was diffusing a bomb, but after several attempts I was able to get the timing down pat. I may just create an Apple Script or something temporarily until Apple/Firebase fixes the issue |
Any fix for this? Edit: Got it working. However, still does not feel like a long-term solution. Anyone making a script for this? |
Cannot get the workaround to work. Anyone having a script for this? |
No automatic script to run it on CI. I've thrown together a script to run manually. It finds broken frameworks and patches them in the loop. I run it after starting archiving in xcode, after successful build hit #!/usr/bin/env bash
# Semiautomatic workaround for the issue described in
# https://github.com/grpc/grpc/issues/20500
trap "exit" INT
while true; do
sleep 0.1
_boring_ssl=$(find /Users/zummenix/Library/Developer/Xcode/DerivedData/MyApp* \
-name "BoringSSL-GRPC" | head -n1)
cd "$_boring_ssl/openssl_grpc.framework" && ln -s Versions/Current/Headers Headers &&
echo "Patched openssl_grpc"
_grpc_core=$(find /Users/zummenix/Library/Developer/Xcode/DerivedData/MyApp* \
-name "gRPC-Core" | head -n1)
cd "$_grpc_core/grpc.framework" && ln -s Versions/Current/Headers Headers &&
echo "Patched grpc"
done Change paths in find commands for your project. And remove lines related to patching grpc.framework if you don't have it. |
This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions! |
not stale |
Any updates? |
I noticed that running the archive command in the CLI twice sometimes works.
EDIT : I may have found something. When I try to build with a fixed derived data path in /tmp, it seems to be working every time.
Can someone try and confirm this ? |
@xurei Did not work for me
|
Still an issue as of Jan 2021, but zummenix's script is an effective workaround for me. |
Is this related https://fantashit.com/i-am-getting-multiple-command-produce-grpccertificates-bundle-error-in-firestore-when-archiving/ ? In that case, is the issue solved in a grpc-version but not updated by Firebase? Running
|
Nevermind, seems to be an old answer: https://stackoverflow.com/questions/53406947/xcode-10-ios-firebase-firestore-sdk-multiple-command-produce-grpccertificates |
The script above works fine, but for automating with fastlane, this workaround wont work. Would super appreciate a real solution here. |
Still an issue for me, would really appreciate if this was fixed for real (the workaround didn't work for me) |
It's really weird, when building the project above, But archiving doesn't create the symbolic link. I still don't have any idea, will keep looking into it. Also filed an issue(CocoaPods/CocoaPods#10354) on the Cocoapods repo and see if they have any idea. |
It's a bug with Cocoapods, the PR(CocoaPods/CocoaPods#10224) should fix this. |
Thanks for figuring this out @yulin-liang! I'm going to try and test with that Cocoapods PR when I have a chance to verify |
I'm using a small .sh script like this that daemons the archive fix, then runs the fastlane lane and then stops the archive fix process. #!/usr/bin/env bash
./fix-archive.sh >/dev/null 2>&1 & pid=$!
echo Archive fix running on $pid
echo Archiving and notarizing MacOS build
bundle exec fastlane notarize_and_upload
kill -9 $pid
echo Killed archive fix script, exiting... But this is still a super annoying issue. would appreciate a real fix. |
The fix is merged for the upcoming CocoaPods 1.10.2 release - see CocoaPods/CocoaPods#10224 |
The CocoaPods version with the fix has yet to be released as of today. Meanwhile, @zummenix 's workaround script above recently stopped working for me, but Paul's answer on StackOverflow helped me figure out what the issue was. As of 6/12/21, it seems that the script only looks for the first instance of the specified "BoringSSL-GRPC" and "gRPC-Core" directories, which is problematic because my DerivedData folder suddenly contain several directories with those names, even after pod deintegrate / pod install and cleaning the build folder. To be specific, the script was failing because (for example) it was finding the directory
instead of the directory that the archive compiler was complaining about:
I'm not familiar with the script syntax, so I simply hardcoded my pathname in to get the script working again, and the project Archives without a problem now. It feels silly to be refining this script when the CocoaPods team is sitting on a release with the real fix, but if someone is familiar with the scripting syntax, we would just need to modify the script to patch the necessary files in ALL directories with the specified names, not just the first directories with the specified names. Here's my hardcoded script for reference (with placeholder values):
|
The fix for me was just to change from cocoapods to SPM for the containing framework (firebase). Works like a charm! |
Can confirm @appfrilans's comment & this is not an issue in SPM. |
What version of gRPC and what language are you using?
gRPC-Core 1.21.0
What operating system (Linux, Windows,...) and version?
macOS 10.15 Beta
What runtime / compiler are you using (e.g. python version or version of gcc)
Xcode 11.1
What did you do?
Archive a project that includes the gRPC-Core pod.
What did you expect to see?
Successful archive
What did you see instead?
Failed to find ssl.h in openssl_grpc framework.
Full details and repro instructions at firebase/firebase-ios-sdk#4007
Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: