swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.61k stars 10.37k forks source link

error: unable to open dependencies file #76289

Open sger opened 2 months ago

sger commented 2 months ago

Description

Hello,

I'm not sure if this related to swift or spm but by using the latest beta 6 of Xcode 16 with swift 5 produces the following error:

error: unable to open dependencies file (/Users/user/Library/Developer/Xcode/DerivedData/MyProject-cgglnsxtnpiyjcazixtikurdbcqd/Build/Intermediates.noindex/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/arm64/MyProject-master-emit-module.d) (in target 'MyProject' from project 'MyProject')

By switching compilation mode to whole module instead of incremental project builds correctly.

Reproduction

error: unable to open dependencies file (/Users/user/Library/Developer/Xcode/DerivedData/MyProject-cgglnsxtnpiyjcazixtikurdbcqd/Build/Intermediates.noindex/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/arm64/MyProject-master-emit-module.d) (in target 'MyProject' from project 'MyProject')

Expected behavior

Project should be with incremental compilation mode.

Environment

swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2) Target: arm64-apple-macosx14.0

Additional information

No response

sananthanarayan commented 2 months ago

Have you tried clearing derived data. This is the steps to do that:

Otherwise try switching to whole model compilation temporarily to see if that resolves it using these settings:

Try manually deleting Build Artifacts or Check Swift Package manager dependencies (if this is a scenario)

Run this command to check file permissions: sudo chmod -R 755 ~/Library/Developer/Xcode/DerivedData

Keep an eye on Xcode beta update to see if it resolves the issue

sger commented 2 months ago

Thanks @sananthanarayan I have tried all the things that you mentioned for the moment only whole module works.