Open tapokoff opened 7 months ago
The following error message doesn't indicate to me that this has anything to do with the size of the project.
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'working directory doesn't exist.'
Are you sure that:
Yes, I'm sure i pass a correct project path (I tried pass a .xcodeproj and just project folder, results are the same). The reason why I'm so sure, its because before that error message, i receive this warning:
warning: 'XXXXXXX': /Users/XXXXXXX/Developer/XXXXXXX/XXXXXXX/XXXXXXX/Package.swift:23:10: warning: 'package(name:url::)' is deprecated: use package(url::) instead .package( ^
( Changed paths to "XXXXXXX" )
Same here:
$ dependency-graph XXX.xcodeproj
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'working directory doesn't exist.'
*** First throw call stack:
(
0 CoreFoundation 0x000000018dd20570 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x000000018d811eb4 objc_exception_throw + 60
2 Foundation 0x000000018ee212f8 -[NSConcreteTask launchWithDictionary:error:] + 4208
3 dependency-graph 0x000000010286c4f0 $s22ShellCommandRunnerLiveAAV3run13withArguments16fromDirectoryURL0abC00aB6OutputVSaySSG_10Foundation0J0VtFTf4nnd_n + 448
4 dependency-graph 0x000000010284fe88 $s22DumpPackageServiceLiveAAV04dumpB033_33DF866953EC50C8C73DEAC71694AABCLL2at10Foundation4DataVAF3URLV_tKF + 156
5 dependency-graph 0x000000010284fd24 $s22DumpPackageServiceLiveAAV04dumpb8ForSwiftB4File2at10Foundation4DataVAE3URLV_tKF + 260
6 dependency-graph 0x000000010284ffa0 $s22DumpPackageServiceLiveAAV0abC0Aca2CP04dumpb8ForSwiftB4File2at10Foundation4DataVAG3URLV_tKFTW + 12
7 dependency-graph 0x00000001028622d4 $s26PackageSwiftFileParserLiveAAC09justParseC033_A17BD4055C4467321940459E7754879DLL2at0abC0AFV10Foundation3URLV_tKF + 172
8 dependency-graph 0x0000000102862630 $s26PackageSwiftFileParserLiveAAC0abcD0Aca2CP05parseC02at0abC0AGV10Foundation3URLV_tKFTW + 164
9 dependency-graph 0x0000000102861640 $s26PackageSwiftFileParserLive0abC6MapperV3mapy0abC0AEVAA012IntermediateabC0VKF + 1892
10 dependency-graph 0x00000001028623bc $s26PackageSwiftFileParserLiveAAC09justParseC033_A17BD4055C4467321940459E7754879DLL2at0abC0AFV10Foundation3URLV_tKF + 404
11 dependency-graph 0x0000000102862630 $s26PackageSwiftFileParserLiveAAC0abcD0Aca2CP05parseC02at0abC0AGV10Foundation3URLV_tKFTW + 164
12 dependency-graph 0x0000000102941634 $s28XcodeProjectGraphBuilderLive015AllDependenciescD0V05buildC04from08DirectedC0AFC0aB0AHV_tKF + 864
13 dependency-graph 0x00000001029427d0 $s28XcodeProjectGraphBuilderLiveAAC05buildC04from08DirectedC0AEC0aB0AGV_tKF + 192
14 dependency-graph 0x00000001029428e4 $s28XcodeProjectGraphBuilderLiveAAC0abcD0Aca2CP05buildC04from08DirectedC0AGC0aB0AIV_tKFTW + 20
15 dependency-graph 0x0000000102850f18 $s12GraphCommandAAV3run9withInput6syntaxySS_AA6SyntaxOtKF + 1216
16 dependency-graph 0x00000001028527c4 $s4Main15DependencyGraphV3runyyKF + 320
17 dependency-graph 0x0000000102852b14 $s4Main15DependencyGraphV14ArgumentParser15ParsableCommandAadEP3runyyKFTW + 64
18 dependency-graph 0x0000000102852d6c Main_main + 96
19 dyld 0x000000018d84d0e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
zsh: abort dependency-graph XXX.xcodeproj/
Looks like I've got the same problem here.
dependency-graph --packages-only --node-spacing 0.75 --rank-spacing 4 . [develop]
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'working directory doesn't exist.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000194e8accc __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000194972788 objc_exception_throw + 60
2 Foundation 0x0000000195fb4a80 -[NSConcreteTask launchWithDictionary:error:] + 4284
3 dependency-graph 0x0000000100b8c4f0 $s22ShellCommandRunnerLiveAAV3run13withArguments16fromDirectoryURL0abC00aB6OutputVSaySSG_10Foundation0J0VtFTf4nnd_n + 448
4 dependency-graph 0x0000000100b6fe88 $s22DumpPackageServiceLiveAAV04dumpB033_33DF866953EC50C8C73DEAC71694AABCLL2at10Foundation4DataVAF3URLV_tKF + 156
5 dependency-graph 0x0000000100b6fd24 $s22DumpPackageServiceLiveAAV04dumpb8ForSwiftB4File2at10Foundation4DataVAE3URLV_tKF + 260
6 dependency-graph 0x0000000100b6ffa0 $s22DumpPackageServiceLiveAAV0abC0Aca2CP04dumpb8ForSwiftB4File2at10Foundation4DataVAG3URLV_tKFTW + 12
7 dependency-graph 0x0000000100b822d4 $s26PackageSwiftFileParserLiveAAC09justParseC033_A17BD4055C4467321940459E7754879DLL2at0abC0AFV10Foundation3URLV_tKF + 172
8 dependency-graph 0x0000000100b82630 $s26PackageSwiftFileParserLiveAAC0abcD0Aca2CP05parseC02at0abC0AGV10Foundation3URLV_tKFTW + 164
9 dependency-graph 0x0000000100b81640 $s26PackageSwiftFileParserLive0abC6MapperV3mapy0abC0AEVAA012IntermediateabC0VKF + 1892
10 dependency-graph 0x0000000100b823bc $s26PackageSwiftFileParserLiveAAC09justParseC033_A17BD4055C4467321940459E7754879DLL2at0abC0AFV10Foundation3URLV_tKF + 404
11 dependency-graph 0x0000000100b82630 $s26PackageSwiftFileParserLiveAAC0abcD0Aca2CP05parseC02at0abC0AGV10Foundation3URLV_tKFTW + 164
12 dependency-graph 0x0000000100c6202c $s28XcodeProjectGraphBuilderLive012PackagesOnlycD0V05buildC04from08DirectedC0AFC0aB0AHV_tKFTf4xn_n + 796
13 dependency-graph 0x0000000100c62780 $s28XcodeProjectGraphBuilderLiveAAC05buildC04from08DirectedC0AEC0aB0AGV_tKF + 112
14 dependency-graph 0x0000000100c628e4 $s28XcodeProjectGraphBuilderLiveAAC0abcD0Aca2CP05buildC04from08DirectedC0AGC0aB0AIV_tKFTW + 20
15 dependency-graph 0x0000000100b70f18 $s12GraphCommandAAV3run9withInput6syntaxySS_AA6SyntaxOtKF + 1216
16 dependency-graph 0x0000000100b727c4 $s4Main15DependencyGraphV3runyyKF + 320
17 dependency-graph 0x0000000100b72b14 $s4Main15DependencyGraphV14ArgumentParser15ParsableCommandAadEP3runyyKFTW + 64
18 dependency-graph 0x0000000100b72d6c Main_main + 96
19 dyld 0x00000001949ae0e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
I'm having this problem too, but in my case, it seems to be related to some of the local dependencies in my Package.swift that use relative paths. On debugging dependency-graph
I can see that crash happens because the computed file path directoryURL
points to a non-existent path.
Given my /Users/cameron/packages/somepackage/Package.swift
:
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SomePackage",
dependencies: [
.package(path: "../another_package"),
],
...
The other package dependency is located at: /Users/cameron/packages/another_package/Package.swift
yet the computed directoryURL
is file:///Users/cameron/another_package/
when it should, in fact, be file:///Users/cameron/packages/another_package/
On further investigation, this seems it might be because we have dependencies of dependencies that share the same dependency but resolve it at different relative paths.
Live:
../SharedDep < Package A
../../SharedDep < Some-subdirectory/Package B
In both these examples SharedDep
is in the same absolute path.
Ok so looks like "user error" 😳 - Turns out the other package had the wrong relative path, for some reason this didn't cause errors in Xcode because the module was already resolved by an earlier package sharing the same dependency.
Fixed the package issues and now it's working 😄
What happened?
Hi,
Then i try to use your tool on my large project with SPM, i receive this error output:
What are the steps to reproduce?
Really large project + SPM
What is the expected behavior?
Without error