Skip to content

Xcode 16.0 + swift-testing 6.0.3 report the target 'Testing' and 'TestingMacros' contains unsafe build flags #987

@wangzhizhou

Description

@wangzhizhou

Description

Image

Reproduction

// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "OrzLarkSDK",
    platforms: [
        .macOS(.v12),
    ],
    products: [
        .library(
            name: "Message",
            targets: ["Message"]
        ),
        .library(
            name: "LarkOpenAPI", 
            targets: ["OpenAPI"]
        ),
    ],
    dependencies: [
      .package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.7.0"),
      .package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "1.8.0"),
      .package(url: "https://github.com/apple/swift-openapi-urlsession.git", from: "1.0.2"),
      .package(url: "https://github.com/swiftlang/swift-testing.git", from: "6.0.3"),
    ],
    targets: [
        .target(name: "Message"),
        .testTarget(
            name: "MessageTests",
            dependencies: ["Message"]
        ),
        .target(name: "Bot"),
        .target(
            name: "OpenAPI", 
            dependencies: [
                .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
                .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession")
            ],
            plugins: [
                .plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")
            ]
        ),
        .testTarget(
            name: "OpenAPITests", 
            dependencies: [
                "OpenAPI",
                .product(name: "Testing", package: "swift-testing")
            ]
        )
    ]
)

Expected behavior

swift-testing can be add into the package.swift and no error report

Environment

➜ ~ swift --version
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
➜ ~ uname -a
Darwin P42TY60DC6 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🪲 Something isn't workingbuild🧱 Affects the project's build configuration or process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions