swiftlang/swift-package-manager

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

Closed

#10.303 aperta il 15 lug 2026

Vedi su GitHub
 (1 commento) (0 reazioni) (1 assegnatario)Swift (1462 fork)batch import
buggood first issue

Metriche repository

Star
 (10.145 star)
Metriche merge PR
 (Merge medio 9g 4h) (62 PR mergiate in 30 g)

Descrizione

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 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 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

Guida contributor