SwiftPM - Unsafe flags are disallowed in dependencies

Hi,

we are trying to add swift package manager support for gRPC, and we do need unsafe flags, but we got a build error when using unsafe flags. looks like unsafe flags are not allowed in dependencies, is that right? Is there a workaround?

When adding gRPC as a dependency directly which contains unsafe flags, the build fails. However, using gRPC as a transitive dependency via revision hash can work. But it still fails if we switch to use versions. Do you know why?

1 Like

Looks like swiftPM only allows unsafe flags for local and branch-based dependencies. https://github.com/apple/swift-package-manager/blob/main/Sources/Workspace/Workspace.swift#L1023-L1026

1 Like
Terms of Service

Privacy Policy

Cookie Policy