Skip to content

Swift sometimes puts .d, .o and .swiftdeps in the root directory of a SPM project #8646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jomy10 opened this issue Feb 19, 2025 · 4 comments
Labels

Comments

@Jomy10
Copy link

Jomy10 commented Feb 19, 2025

Description

Sometimes, when building with Swift Package Manager, it will put .d, .o and .swiftdeps in the root directory of the Swift Package.

Reproduction

I have encountered this bug multiple times, but have not found a reliable way to fix it.

Files are added to the root directory:
Image

This comes to my attention because an error occures during build:

error: link command failed with exit code 1 (use -v to see invocation)
ld: file cannot be open()ed, errno=2 path=/Users/jonaseveraert/Documents/projects/Beaver/.build/arm64-apple-macosx/debug/Beaver.build/GlobalCache.swift.o in '/Users/jonaseveraert/Documents/projects/Beaver/.build/arm64-apple-macosx/debug/Beaver.build/GlobalCache.swift.o'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I started seeing this bug when I upgraded from Swift 5.7 to Swift 6

Expected behavior

These files should be put in the build directory.

Environment

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0

Additional information

No response

@Jomy10 Jomy10 added the bug label Feb 19, 2025
@tayloraswift
Copy link
Member

this is probably a duplicate of #7930

@jakepetroules jakepetroules transferred this issue from swiftlang/swift May 9, 2025
@jakepetroules
Copy link
Contributor

Are those files produced by a build tool plugin?

@Jomy10
Copy link
Author

Jomy10 commented May 11, 2025

I was not using a build tool plugin at the time.

@dschaefer2
Copy link
Member

Yes, there's more info there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants