Package edit doesn't support unsafe flags
Closed this issue · 0 comments
Is it reproducible with SwiftPM command-line tools: swift build
, swift test
, swift package
etc?
- Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands,
swift build
,swift test
,swift package
etc.
Description
I'm playing around with #8060 and decided to checkout a local copy of swift-java. After fixing the name of the package (needs to match the package id) in that copy I did a swift package edit on the swift-java-deps repo to point the --path at that local copy of swift-java. When I did a swift build, it reported:
error: 'swift-java-deps': the target 'JavaKit' in product 'JavaKit' contains unsafe build flags
error: 'swift-java-deps': the target 'JavaRuntime' in product 'JavaKit' contains unsafe build flags
error: 'swift-java-deps': the target 'Java2Swift' in product 'Java2SwiftPlugin' contains unsafe build flags
...
Expected behavior
I don't understand why that is a restriction on edited packages. It should build fine. And it does when I manually edit Package.swift in swift-java-deps to point the dependency at that path.
Actual behavior
Build failure.
Steps to reproduce
git clone https://github.com/DougGregor/swift-java-deps
git clone https://github.com/swiftlang/swift-java
cd swift-java
and fix the package name in thePackage.swift
to beswift-java
to match the package idcd ../swift-java-deps
swift package edit swift-java --path ../swift-java
swift build
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version ; uname -a
)
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0