ITADN

swift package completion-tool generate-*-script creates .build directory

#10303OpenWFT 创建于 2026-07-15
good first issuebug
W
WFTcommented
### Is it reproducible with SwiftPM command-line tools: `swift build`, `swift test`, `swift package` etc? - [x] 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 package` etc. ### Description Running ` swift package completion-tool generate-fish-script` (or zsh, or bash) creates a `.build` directory. This is a problem because [the docs](https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/usingshellcompletion/#Bash) 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 1. Make sure there's no `.build` directory in your current directory (e.g. `ls -a`) 2. Run `swift package completion-tool generate-bash-script > /dev/null` 3. Observe `.build` directory 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
0 条评论