Skip to content

Modify Package.swift to use source target instead of binary #2011

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsflax
Copy link

@jsflax jsflax commented Dec 1, 2024

This modifies the Package.swift file to use source instead of binary, fixing a number of issues users have had with adding the package to their projects. It also prevents users from having to use a stale binary.

Relevant PRs for the gitmodules:

dinhvh/ctemplate#3
dinhvh/tidy-html5#1
dinhvh/libetpan#451

If this PR is accepted, there are a number of documentation changes that would also be required, since adding to SPM would be simplified.

@haithngn
Copy link
Member

haithngn commented Dec 2, 2024

Hi @jsflax,

Thank you for the PR—great work!
It’s time to move away from CocoaPods, so your help is greatly appreciated.
I’m currently reviewing this and the related PRs as well.

I’ll get back to you soon!

@functionaldude
Copy link

functionaldude commented Apr 4, 2025

@jsflax we started using your fork for SPM support (iOS app), however we seem to have some problems with specific mail servers where we have to use MCOAuthType.saslPlain

session.authType = MCOAuthType.saslPlain

checkAccountOperation fails with code 5

I assume the reason for this is this line in your Package.swift:

.linkedLibrary("sasl2", .when(platforms: [.macOS])),

because for me this implies that we cannot use SASL on iOS.
But a workaround must exist, because previously we already used MailCore2, and we haven't encountered this issue, even when we used MCOAuthType.saslPlain

Any ideas how to fix this issue?

@functionaldude
Copy link

functionaldude commented Apr 4, 2025

FYI: cocoapods uses this pre-compiled binary defined in the podspec. This binary works with MCOAuthType.saslPlain, but compiling it via this PR breaks that feature. Sadly i can't figure out why.
FYI: we have our own mirror for the binary here because the original page is often unreachable

@jsflax
Copy link
Author

jsflax commented Apr 4, 2025

It's odd to me that this is causing an error since libsasl is explicitly left out of the iOS podspec. Can you try removing the .when(platforms: [.macOS]) and see if that helps? It seems to compile locally if I do that, but I'm not sure if it will fix your problem.

@functionaldude
Copy link

in that case I get a compilation error
image

@functionaldude
Copy link

functionaldude commented Apr 4, 2025

and while that library is also missing from the podspec (probably because of this build error), it is possible, that the static library in the podspec has it included

@ju135
Copy link

ju135 commented Apr 7, 2025

@jsflax the issue is that libsasl is a dependency of libetpan (see also the script to build libetpan for iOS)
You can also check the prepare-cyrus-sasl.sh inside the libetpan repo to see how the dependency is built for iOS. This needs to somehow be part of the libetpan building process.

@jsflax
Copy link
Author

jsflax commented Apr 7, 2025

@ju135 That's appreciated, I'll take a look.

@ju135
Copy link

ju135 commented Apr 7, 2025

Thank you! In case it helps, I already found a way to integrate the dependency in my fork . But I'm not entirely sure if this is the proper way to do it.

@jsflax
Copy link
Author

jsflax commented Apr 7, 2025

@ju135 if the xcframework is correctly compiled for the platforms we need to support, I'm fine to use a binaryTarget as a stopgap to get this fixed.

If you'd like to open a PR up form your fork to mine I'll happily review.

@functionaldude
Copy link

functionaldude commented Apr 7, 2025

@jsflax PR is open: jsflax/libetpan#1
no changes needed for mailcore2. This passes our internal tests for MCOAuthType.saslPlain.

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.

4 participants