Skip to content
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

Fix loading package manifest #63

Merged

Conversation

ctreffs
Copy link
Contributor

@ctreffs ctreffs commented Feb 27, 2025

This PR fixes a crash when running swift-bundler bundle or run with added -d or --directory argument pointing to a package-path other than the current directory.

swift-bundler bundle --directory <path_to_package_root> <target_name> produces error:

info: Loading package manifest
error: Failed to run '/usr/bin/env swift package describe --type json': The process returned a non-zero exit status (1)
error: Could not find Package.swift in this directory or any of its parent directories.


info: Use -v to get more error details
Program ended with exit code: 1

Solution is to include the already provided packageDirectory argument in loadPackageManifest (SwiftPackageManager.swift:438) to the swift package command invocation.

Copy link
Owner

@stackotter stackotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix 🙏

@stackotter stackotter merged commit 7c874e6 into stackotter:main Feb 27, 2025
3 checks passed
@ctreffs ctreffs deleted the fix-loadPackageManifest-packageDirectory branch February 27, 2025 13:55
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.

2 participants