swift package completion-tool generate-*-script creates .build directory
#10,303 opened on Jul 15, 2026
Repository metrics
- Stars
- (10,145 stars)
- PR merge metrics
- (Avg merge 9d 4h) (62 merged PRs in 30d)
Description
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 packageetc.
Description
Running swift package completion-tool generate-fish-script (or zsh, or bash) creates a .build directory.
This is a problem because the docs specifically recommend running this command in your .bash_profile, meaning that everyone who has done that will see a .build directory in whatever their working directory is when opening a new terminal tab/window. That's fine if you happen to open into a swiftpm package, but it can be very confusing if you open up other directories and suddenly see .build being created everywhere.
This specifically didn't happen with Swift 6.3.3 shipped in Xcode 26.6, but does happen with Swift 6.4 beta shipped in Xcode 27 beta 3.
Expected behavior
No .build should be created.
Actual behavior
.build directory appears
Steps to reproduce
- Make sure there's no
.builddirectory in your current directory (e.g.ls -a) - Run
swift package completion-tool generate-bash-script > /dev/null - Observe
.builddirectory has been created (ls -a)
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.4.0-dev (Xcode 27 beta 3)
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.168.4 Apple Swift version 6.4 (swiftlang-6.4.0.25.4 clang-2100.3.25.1) Target: arm64-apple-macosx26.0 Darwin 25.5.0 Darwin Kernel Version 25.5.0: Tue Jun 9 22:28:24 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6020 arm64