Skip to content

[Subcommands] Ensure an adjacent binary exists before using it #1935

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

doinkythederp
Copy link

@doinkythederp doinkythederp commented Jun 18, 2025

This pull request updates the handling of subcommands in the Swift Driver to ensure correct behavior when the subcommand executable is not adjacent to swift-driver itself. Now, if the adjacent binary doesn't exist, the driver will fall back to a $PATH-based search rather than attempting to run the missing executable (this seems to be the intended behavior based on the comment above this code).

I also expanded the error message for the failure case here.

This change is important because allows users to use subcommands that didn't come bundled with Swift.

Fixes #1932

@artemcm
Copy link
Contributor

artemcm commented Jun 18, 2025

@swift-ci test

@doinkythederp
Copy link
Author

The error message for Windows seems to be about Predicate's string formatting, but I didn't change code related to that. Is there anything I need to do here to resolve the CI error? This is my first time contributing to Swift, so I don't really know the procedure.

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

Successfully merging this pull request may close these issues.

Always fall back to $PATH-based subcommand resolution
2 participants