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

Move to Swift Package Manager disregarding Cocoapods #496

Merged
merged 1 commit into from Aug 30, 2021

Conversation

SimplyDanny
Copy link
Contributor

@SimplyDanny SimplyDanny commented Aug 29, 2021

Now that SPM is integrated into Xcode and works for iOS project, many project seem to move to it. I would like to give it a try, too. The project setup becomes a bit easier and the project structure looks clearer, I think.

  • Build as many dependencies as possible with SPM.
  • Xcworkspace is no longer needed.
  • Collecting coverage information does unfortunately cause linking errors in Base32. So it is disabled for now.
  • Build XCFrameworks with Carthage.

The build of the ObjectiveGit fork fails with a linker error. This has nothing to do with the switch to SPM, though. I'm not sure why the fork is needed at all. There was some activity in the upstream repository recently, so maybe we can move back to it? Turns out that this would also fix #490. Otherwise I can replace "libgit2/objective-git" by "mssun/objective-git" again.

@SimplyDanny SimplyDanny force-pushed the swift-package-manager branch 3 times, most recently from b54475c to c7bda05 Compare August 29, 2021 11:07
@mssun
Copy link
Owner

mssun commented Aug 29, 2021

Thanks Danny. Basically, the mssun/objective-git fork has these updates (and with some building fixes):

  • Update libgit2 to v0.28.3
  • Update libssh2 to 1.9.0
  • Use openssl-apple and openssl 1.1.1

If I remember correctly, I updated these dependency to support ECDSA key for SSH cloning.

Therefore, we need either upstream the changes of my dependency updates or merge upstream changes to my fork.

* Build as many dependencies as possible with SPM.
* Xcworkspace is no longer needed.
* Collecting coverage information does unfortunately cause linking errors in Base32. So it is disabled for now.
@SimplyDanny
Copy link
Contributor Author

SimplyDanny commented Aug 30, 2021

I managed to build the fork successfully as a normal framework (no XCFramework). This is anyway not yet required and can also be done separately afterwards when the other changes are okay.

For ObjectivePGP I also used the upstream repository, because it contains the Package.swift. As far as I see, we only use mssun/ObjectivePGP, because of one more fix (which did not convince the maintainer). So we can either dismiss the fork and move back to upstream or update the fork. What do you think, @mssun ?

@mssun
Copy link
Owner

mssun commented Aug 30, 2021

I read through related threads around this fix:

We can switch back to upstream ObjectivePGP. I'll update here if anything wrong.

@mssun mssun merged commit 032436f into mssun:master Aug 30, 2021
@mssun
Copy link
Owner

mssun commented Aug 30, 2021

I don't know why the App Store Connect report this error for the build:

[17:17:29]: [Transporter Error Output]: ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.krzyzanowskim.ObjectivePGP' under the iOS application 'Pass Beta.app'."

[17:17:29]: [Transporter Error Output]: ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'OneTimePassword' under the iOS application 'Pass Beta.app'."
...

https://github.com/mssun/passforios/runs/3464311456#step:10:495

@SimplyDanny SimplyDanny deleted the swift-package-manager branch August 30, 2021 21:15
@SimplyDanny
Copy link
Contributor Author

This seems to be a bug in Xcode. We may try with #501.

@sanderdekoning
Copy link

@SimplyDanny can you please elaborate on your setup for me? I'm running into the same issue you had (#490) and it's getting me a bit stumped - it seems that every time when I get a new iPhone/there is an iOS upgrade I try to build the project again and it just doesn't work. I'm building with Xcode 13.1 for iOS 15

@SimplyDanny
Copy link
Contributor Author

What exactly are you interested in, @sanderdekoning? On Intel the steps mentioned in the README should work:

  • Install Homebrew dependencies.
  • Run ./scripts/wcarthage bootstrap --platform iOS. Note that the --use-xcframeworks does currently not yet work.
  • Run ./scripts/gopenpgp_build.sh.
  • Open the project and build.

Where are you getting issues? The build on Apple Silicon works somehow but you cannot run the app in the simulator. This is due to the missing arm64 macOS target in Objective-Git. I already had success in building it manually and are currently working on bringing it back to upstream or at least the fork mssun/objective-git.

@sanderdekoning
Copy link

sanderdekoning commented Dec 5, 2021

Thanks for contacting @SimplyDanny - see my comment #519 (comment) on how I managed to get the build working. Indeed I used --use-xcframeworks and it seemed to work in my case. Then when building succeeded I would always get the unsupported url protocol error when running on my iPhone 13 Pro. It appears that I could resolve that by adding export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libssh2/lib/pkgconfig/" and rebuilding (including golang script)

export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libssh2/lib/pkgconfig/"

Let me know if I can help in any way in adding Apple Silicon support, or help with anything else. It's great to hear you've had some success with that. Indeed it also seems like a good idea to move to upstream and negate the mssun/objective-git fork.

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.

SSH clone fails with "Unsupported URL protocol" error
3 participants