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

Compiler crash during build of executable target with both path and dependencies specified #74471

Open
t3hmrman opened this issue Jun 17, 2024 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels

Comments

@t3hmrman
Copy link

t3hmrman commented Jun 17, 2024

Description

The compiler crashes when processing Package.swift manifests in which an .executableTarget contains both path and dependencies.

Reproduction

// swift-tools-version: 6.0
import PackageDescription

let package = Package(
    name: "HelloWorld",
    dependencies: [
      .package(url: "https://github.com/apple/example-package-figlet", branch: "main"),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
      .executableTarget(
        name: "HelloWorld",
        // path: "Sources", // if uncommented, this fails
        dependencies: [
          .product(name: "Figlet", package: "example-package-figlet"),
        ])
    ]
)

Stack dump

segmentation fault  xcrun --toolchain swift swift build

Unfortunately I don't know how to get swift to give me any stack trace information (and don't see any reasonable options to swift...). Are we supposed to just use valgrind or gdb or something to come up with this if the tooling/compiler isn't giving us anything outside of a segfault?

I'm day 0 to the swift tooling right now (and I'd like to start with 6.0), so would appreciate guidance here (I'm happy to update the issue template as well with instructions afterwards).

Expected behavior

It seems like both of these options should be acceptable without crashing the compiler, but if they aren't then a more descriptive error message would be nice.

Environment

xcrun --toolchain swift swift --version
Apple Swift version 6.0-dev (LLVM 6e13b8be259f20f, Swift 372de4670b9cd55)
Target: arm64-apple-macosx14.0

Additional information

I did see #74081 which is related but not quite the same.

@t3hmrman t3hmrman added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant