Skip to content

Can't build on exFAT-formatted drives (was Error Domain=NSCocoaErrorDomain Code=512 ... NSUnderlyingError=Win32Error(code: 87)) #9867

@Aero-Applications

Description

@Aero-Applications

Description

Hello, and thank you for developing this language.

I found that I could not build new or existing swift projects located on a secondary drive (Specifically an HDD, my other SSD works fine) in Windows 10 (D:/path/to/project).

Please don't feel like you have to fix this right away, I simply wanted this to be out there so that others looking up error 512 could see what I have deduced from this error.

Reproduction

D:\Path\To\Project>swift package init
Creating library package: Project 
Creating Package.swift
Creating .gitignore
Creating Sources
Creating Sources\Project\Project .swift
Creating Tests/
Creating Tests\ProjectTests/
Creating Tests\ProjectTests\ProjectTests.swift

D:\Path\To\Project>swift build
Error Domain=NSCocoaErrorDomain Code=512 "(null)"UserInfo={NSURL=file:///D:/Path/To/Project/.build/x86_64-unknown-windows-msvc/debug/Project.build/output-file-map.json, NSUnderlyingError=Win32Error(code: 87), NSFilePath=D:/Path/To/Project\.build\x86_64-unknown-windows-msvc\debug\Project.build\output-file-map.json}

Expected behavior

D:\Path\To\Project>swift package init
Creating library package: Project 
Creating Package.swift
Creating .gitignore
Creating Sources
Creating Sources\Project\Project .swift
Creating Tests/
Creating Tests\ProjectTests/
Creating Tests\ProjectTests\Project Tests.swift

D:\Path\To\Project>swift build
Building for debugging...
[5/5] Compiling Project Project .swift
Build complete! (6.21s)

Environment

Windows 10:

D:\Path\To\Project>swift --version
Swift version 6.2.4 (swift-6.2.4-RELEASE)
Target: x86_64-unknown-windows-msvc
Build config: +assertions

Additional information

If this happens to you, please try a different hard drive.

I don't know exactly what's causing HDD to fail.

Hard Drive Specs:

  • Type: LocalDisk (Not External)
  • Format: exFat
  • Free space: Sufficient

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions