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

swift build writes to incorrect MacOS path #62208

Open
iainhouston opened this issue Nov 20, 2022 · 5 comments
Open

swift build writes to incorrect MacOS path #62208

iainhouston opened this issue Nov 20, 2022 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. transfer candidate The issue may belong in another repository triage needed This issue needs more specific labels

Comments

@iainhouston
Copy link

iainhouston commented Nov 20, 2022

Description

swift’s —show-bin-path option correctly shows the correct path, namely …/.build/arm64-apple-macosx/release but the executable is incorrectly written to …/.build/x86_64-apple-macosx/release

Steps to reproduce

Using the Apple swift-argument-parser sample code on GitHub.

swift build with Package.swift as follows:

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

import PackageDescription

let package = Package(
    name: "count",
    dependencies: [
      .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.0.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .executableTarget(
            name: "count",
            dependencies: [.product(name: "ArgumentParser", package: "swift-argument-parser")]),
    ]
)

Expected behaviour

The executable should be written using the path as displayed by the —show-bin-path option , namely …/.build/arm64-apple-macosx/release

Environment

  • Swift compiler version info

MacOS Ventura 13.0.1 Using Apple Swift version 5.7.1

  • Xcode version info: N/A as I am building a script from the command swift build
  • Deployment target: none explicitly stated in Package.Swift
@iainhouston iainhouston added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Nov 20, 2022
@LucianoPAlmeida LucianoPAlmeida added triage needed This issue needs more specific labels transfer candidate The issue may belong in another repository labels Nov 29, 2022
@LucianoPAlmeida
Copy link
Collaborator

Added transfer candidate because that sounds like a SPM or driver issue? But requires to take a more detailed look to confirm

@AnthonyLatsis
Copy link
Collaborator

@ddunbar Does this look like a SPM issue to you?

@shahmishal
Copy link
Member

cc: @tomerd @neonichu for SwiftPM
cc: @natecook1000 for Argument parser

@tomerd
Copy link
Member

tomerd commented Jan 30, 2023

if true, then this would be a SwiftPM bug. please move over to the SwiftPM repo.

cc @neonichu

@neonichu
Copy link
Member

I cannot reproduce this. I'm assuming this is on an arm64 host?

Could you run swift package clean && swift build --verbose and post the resulting output here?

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. transfer candidate The issue may belong in another repository triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

6 participants