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

Package.swift must be updated if it's installed via Swift Package Manager #594

Closed
pot8os opened this issue Sep 15, 2021 · 9 comments
Closed

Comments

@pot8os
Copy link
Contributor

pot8os commented Sep 15, 2021

Hello, let me report an issue and a temporary workaround for it.

Environment

How to reproduce

  1. Install Parchment via Swift PM
  2. Add it as a dependency of an app
  3. Make an archive

What's the issue

Compile fails even though the codebase has #if canImport(...) barrier. It only happens when archiving as far as I see.

Screen Shot 2021-09-15 at 21 53 15

Screen Shot 2021-09-15 at 21 53 35

(Temporary) Workaround

As explained here, I had to folk the repo and specify platform versions for all products. See also the below diff.

https://github.com/rechsteiner/Parchment/compare/master...pot8os:spm-archive?expand=1

All errors had gone when I switch to my branch above in the Swift PM settings.

Consideration

Although it's a valid workaround, it bumps the minimum supported version of the library so I don't think it's an acceptable solution. The best option is that Xcode addresses the issue but I'm not sure when it becomes real. I'd be happy if you could share some thoughts.

Thanks!

@rechsteiner
Copy link
Owner

Thanks for the detailed report! It would definitely be a shame to drop support for that many versions. I'll see if I can find some other workaround.

@jerrylin1002
Copy link

I have the same issue, since xcode and macos updated this morning

@dendude
Copy link

dendude commented Sep 22, 2021

I have the same issue

@luesp15
Copy link

luesp15 commented Sep 22, 2021

Hello, let me report an issue and a temporary workaround for it.

Environment

How to reproduce

  1. Install Parchment via Swift PM
  2. Add it as a dependency of an app
  3. Make an archive

What's the issue

Compile fails even though the codebase has #if canImport(...) barrier. It only happens when archiving as far as I see.

Screen Shot 2021-09-15 at 21 53 15 Screen Shot 2021-09-15 at 21 53 35

(Temporary) Workaround

As explained here, I had to folk the repo and specify platform versions for all products. See also the below diff.

https://github.com/rechsteiner/Parchment/compare/master...pot8os:spm-archive?expand=1

All errors had gone when I switch to my branch above in the Swift PM settings.

Consideration

Although it's a valid workaround, it bumps the minimum supported version of the library so I don't think it's an acceptable solution. The best option is that Xcode addresses the issue but I'm not sure when it becomes real. I'd be happy if you could share some thoughts.

Thanks!

I tried but it doesn't work for me

@sidneivl
Copy link

Not work for me, any solution to use this library?

@subzero3000
Copy link

subzero3000 commented Sep 22, 2021

Alternative Solution :
Please install using Cocoa Pods instead of Swift PM (remove from Package Dependencies if already installed and DON'T forget to clean build folder). Then simply unlock the file PageView.swift for editing.
Change the line #if canImport(SwiftUI) && canImport(Combine) to #if !arch(arm), should archive without any issues.
Basically putting all the swift UI code between #if !arch(arm) / #endif
Screen Shot 2021-09-23 at 2 29 51 am

@subzero3000
Copy link

Not work for me, any solution to use this library?

Please try alternative solution

@rechsteiner
Copy link
Owner

This seems to be a known issue in Xcode 13:

Swift libraries may fail to build for iOS targets that use armv7. (74120874)
Workaround: Increase the platform dependency of the package to v12 or later.

From: https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes

Hopefully it will be fixed before the official release, but for now I've created a xcode-13 branch that sets the deployment target to iOS 12 which fixes the issue.

@rechsteiner
Copy link
Owner

A new version v3.1.0 is available now that should fix this issue 🥳 Let me know if anyone is still having issue

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

No branches or pull requests

7 participants