Skip to content

Commit 4bcb84b

Browse files
authored
Don't follow the swiftly symlink when determining in use toolchain (#1975)
When swiftly is installed via Homebrew it is added to the path at a location like `/opt/homebrew/bin/swiftly`, which is a symlink to the brew cellar located at `/opt/homebrew/bin/Cellar/swiftly/1.1.0/bin/` When printing the in use toolchain location with `swiftly use --print-location` we were launching swiftly with the realpath of the symlink, which caused Swiftly to print the "swiftly is unlinked" warning message before printing the toolchain location. The extension went on to take this message and parse it as a path, causing the extension activation to hang. Instead of using this realpath when invoking swiftly to get the toolchain path, if we determine the use is using swiftly just invoke it normally using `swiftly` instead of using the full path. Issue: #1966
1 parent 1d723b3 commit 4bcb84b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/toolchain/toolchain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export class SwiftToolchain {
571571

572572
if (path.basename(realSwift) === "swiftly") {
573573
try {
574-
const inUse = await Swiftly.inUseLocation(realSwift, cwd);
574+
const inUse = await Swiftly.inUseLocation("swiftly", cwd);
575575
if (inUse) {
576576
realSwift = path.join(inUse, "usr", "bin", "swift");
577577
isSwiftlyManaged = true;

0 commit comments

Comments
 (0)