swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

`circular swiftly proxy invocation` when running `swift package show-dependencies` in a directory where there are no Package.swift in the parent directory.

Open bkhouri opened this issue 10 months ago • 3 comments

When in a directory that does not contain a Package.swift in any of the parent directories, swift package show-dependencies does indicates the following

❯ swift package show-dependencies
Circular swiftly proxy invocation

Additional information

❯ swiftly --version
0.4.0-dev

❯ swiftly use
main-snapshot-2025-02-04 (default)

❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-2.local 24.3.0 Darwin Kernel Version 24.3.0: Mon Jan  6 22:01:36 PST 2025; root:xnu_development-11215.81.4~9/DEVELOPMENT_ARM64_T6000 arm64

bkhouri avatar Feb 12 '25 14:02 bkhouri

This error is happening because of an internal mechanism to prevent infinite recursive process spawning through the proxies, which could swamp a system with forked processes.

The specific cause in this case will need to be investigated.

There is a workaround, which is to use the swift run subcommand like this:

swiftly run swift package show-dependencies

cmcgee1024 avatar Feb 13 '25 01:02 cmcgee1024

This issue might be caused by a toolchain that wasn't fully installed, and lacking certain binaries, so swiftly proxies to itself instead of the toolchain binary.

If this is the case then a workaround is to show the current toolchain, uninstall, reinstall and use it like this:

swiftly use
swiftly uninstall <version>
swiftly install <version>
swiftly use <version>

cmcgee1024 avatar Feb 26 '25 14:02 cmcgee1024

This should be a little less likely after fixes in #245, keeping this open to see if the newer versions still exhibit the circularity error.

cmcgee1024 avatar Mar 27 '25 22:03 cmcgee1024