swiftlang/swift-package-manager

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

  1. git clone https://github.com/DougGregor/swift-java-deps
  2. git clone https://github.com/swiftlang/swift-java
  3. cd swift-java and fix the package name in the Package.swift to be swift-java to match the package id
  4. cd ../swift-java-deps
  5. swift package edit swift-java --path ../swift-java
  6. 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