Skip to content

Improve logic for launch configuration executable path #1830

@bkhouri

Description

@bkhouri

Looking at the code base, the extension is making an assumption as to the location of the executables targets location.

See

const targetPath = path.join(
BuildFlags.buildDirectoryFromWorkspacePath(folder, true),
"debug",
target
);

This will fail when the default build system for swift build changes. It would be better to use the --show-bin-path command line option passed to swift build to determine the build output location.

❯ swift build --show-bin-path
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager-2/.build/arm64-apple-macosx/debug

❯ swift build --show-bin-path --configuration release
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager-2/.build/arm64-apple-macosx/release

❯ swift build --show-bin-path --build-system swiftbuild
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager-2/.build/arm64-apple-macosx/Products/Debug

❯ swift build --show-bin-path --build-system swiftbuild  --configuration release
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager-2/.build/arm64-apple-macosx/Products/Release


❯ swift build --show-bin-path --configuration release --scratch-path /my-temp
/my-temp/arm64-apple-macosx/release

❯ swift build --show-bin-path --configuration release --scratch-path /my-temp --triple my-triple --build-system swiftbuild
/my-temp/my-triple/Products/Release

Metadata

Metadata

Labels

Type

No type

Projects

Status

Needs Verification

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions