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

SPM: Compile project error #634

Closed
devshamzi opened this issue Jan 29, 2022 · 13 comments
Closed

SPM: Compile project error #634

devshamzi opened this issue Jan 29, 2022 · 13 comments

Comments

@devshamzi
Copy link

Hello, I am using Swift Package Manager using the URL "https://github.com/rechsteiner/Parchment" (Project > Project > Swift Packages).

Dependency Rule: Exact Version - 3.2.0
Add to Project: 'MyProject'

When compiling I get an error

The package product 'Parchment' cannot be used as a dependency of this target because it uses unsafe build flags.

Thanks for the help in advance.

@andre719mv
Copy link

andre719mv commented Jan 29, 2022

I have the same issue when use xcodeproj file. It does not fail with xcworkspace file, but support of running from xcodeproj file is required in my project.

@devshamzi
Copy link
Author

@andre719mv You added via CocoaPod or SPM?

@andre719mv
Copy link

andre719mv commented Jan 29, 2022

SPM. Issue is also gone when I revert to 3.1.0

@ageevvalentin
Copy link
Contributor

I have the same error. I found:
https://forums.swift.org/t/override-for-unsafeflags-in-swift-package-manager/45273
https://forums.swift.org/t/confused-by-unsafe-flags-being-disallowed-in-dependencies/27359

So far, the workaround is to use a specific commit hash (7773785) for dependency.

@CleSmartwave
Copy link

CleSmartwave commented Mar 15, 2022

Hi @ageevvalentin, I'm on Xcode 12 and encountered the same issue but the workaround (use a specific commit hash (7773785) for dependency) does not work for me.

What Xcode version are you on? I can't move to Xcode 13 as of this time. Any ideas?

@benjohn-ee
Copy link

benjohn-ee commented Jun 6, 2022

I'm seeing this same error with the latest Xcode – 13.4.1 (13F100). It seems to have started with the official release that downloaded over the weekend; I didn't see it with the release candidate.

It happens with both Parchment 3.1.0 (which we're currently using) and 3.2.0 (which I could update to).

I don't think I can use a commit hash because in this case the dependency is owned and managed by an Xcode project in a ".workspace/xcshareddata/swiftpm/Package.resolved" file, not an SPM Package file. I tried remove the package version and leave the hash, but it seems Xcode put the package version back in.

@ageevvalentin
Copy link
Contributor

I'm seeing this same error with the latest Xcode – 13.4.1 (13F100). It seems to have started with the official release that downloaded over the weekend; I didn't see it with the release candidate.

It happens with both Parchment 3.1.0 (which we're currently using) and 3.2.0 (which I could update to).

I don't think I can use a commit hash because in this case the dependency is owned and managed by an Xcode project in a ".workspace/xcshareddata/swiftpm/Package.resolved" file, not an SPM Package file. I tried remove the package version and leave the hash, but it seems Xcode put the package version back in.

I'm on the 13.4. I will check it tomorrow on the 13.4.1.
You can set a commit hash via Xcode 'Project settings -> Package dependencies' or set it directly to the 'Package.resolved'

Xcode Screenshot 2022-06-06 at 22 21 53
Package.resolved (Maybe need to close Xcode and clear DerivedData) Screenshot 2022-06-06 at 22 22 57

@mpoimer
Copy link

mpoimer commented Jun 7, 2022

I'm seeing the same with Xcode 13.4, where it only happens if I'm trying to use 3.2.0.
When choosing exact "3.1.0" it does not show an error

@SmartHbdev
Copy link

I'm seeing the same with Xcode 13.4, where it only happens if I'm trying to use 3.2.0. When choosing exact "3.1.0" it does not show an error

Thanks !

Xcode 13.4.1 and 3.1.0 is OK.
Something in the code between 3.1.0 and 3.2.0 need a fix for SPM

@sugitatestblue
Copy link
Contributor

spm not supported?

@amir-hormozi
Copy link

The same error occurred to me too via SPM. Could you please fix it?

@mohan-kurera
Copy link

I have the same issue.
Xcode 14.2
parchment 3.2.0 (SPM)

Does anyone know how to fix this issue?

@rechsteiner
Copy link
Owner

Sorry for the late update. I decided to just remove the unsafe compiler flags, so this should be fixed now #662. As the PR explains, this will probably break some other apps, but it's more important to get this issue fixed. This fix is available in version 3.2.1

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