Skip to content

Windows: Touch task on a bundle directory copies its contents into the working directory #1641

Description

@tothambrus11

On Windows, building a package target that has resources copies the top-level files of the resource bundle (Info.plist and every resource) into the package root.

swift build -v shows the culprit, the "Touch" step for the bundle:

Touch Repro_Foo.bundle
    cd C:\...
epro
    C:\WINDOWS\system32\cmd.exe /c copy /b C:\...\Products\Debug-windows\Repro_Foo.bundle +,,
C:\...\Repro_Foo.bundle\hello.txt
C:\...\Repro_Foo.bundle\Info.plist
        2 file(s) copied.

copy /b <file> +,, updates a file's timestamp, but when the argument is a directory copy instead copies every file in it into the current directory, which here is the package root (TouchTool.swift uses defaultWorkingDirectory).

Reproducer with CI: https://github.com/tothambrus11/swift-build-bundle-touch-repro (Package.swift with one target and resources: [.copy("Resources/hello.txt")]; after swift build --build-system swiftbuild, hello.txt and Info.plist sit next to Package.swift).

Seen with 6.4-dev locally and swift-DEVELOPMENT-SNAPSHOT-2026-05-20-a (6.5-dev) on windows-latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions