Skip to content

print-target-info: Temporary Directory isn't cleaned up on Linux/FreeBSD #2049

@etcwilde

Description

@etcwilde

Summary

The swift-driver doesn't delete the temporary directory on termination after running an in-place job. The ultimately led to the FreeBSD CI node running out of inodes and being unable to make progress without intervention. Unlike the Linux CI nodes, the /tmp directory on the FreeBSD node is non-volatile, and the directories are persisted.

Reproducer

cd /tmp
ls -a
swiftc -print-target-info
ls -a

Output:

bash-5.2# cd /tmp
bash-5.2# ls -a
.  ..
bash-5.2# swiftc -print-target-info
{
  "compilerVersion": "Swift version 6.2.1 (swift-6.2.1-RELEASE)",
  "target": {
    "triple": "aarch64-unknown-linux-gnu",
    "unversionedTriple": "aarch64-unknown-linux-gnu",
    "moduleTriple": "aarch64-unknown-linux-gnu",
    "platform": "linux",
    "arch": "aarch64",
    "pointerWidthInBits": 64,
    "pointerWidthInBytes": 8,
    "compatibilityLibraries": [ ],
    "openbsdBTCFIEnabled": false,
    "librariesRequireRPath": false
  },
  "paths": {
    "runtimeLibraryPaths": [
      "/usr/libexec/swift/6.2.1/lib/swift/linux"
    ],
    "runtimeLibraryImportPaths": [
      "/usr/libexec/swift/6.2.1/lib/swift/linux",
      "/usr/libexec/swift/6.2.1/lib/swift/linux/aarch64"
    ],
    "runtimeResourcePath": "/usr/libexec/swift/6.2.1/lib/swift"
  }
}
bash-5.2# ls -a
.  ..  TemporaryDirectory.21lDYL

Swift Version

This reproduces with 6.2 up to main.

Swift version 6.2.1 (swift-6.2.1-RELEASE)
Target: aarch64-unknown-linux-gnu

Linux 4c7f818f-45a9-4139-a5e0-d6d0631461f4 6.6.9 #1 SMP Fri Sep  5 23:08:25 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
Swift version 6.2-dev (LLVM 5ddb183dc9df433, Swift d8cbb57304b636a)
Target: x86_64-unknown-freebsd14.3
Build config: +assertions

FreeBSD latte 14.3-RELEASE FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions