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

swift package add-dependency automatically resolve a version #7759

Open
MahdiBM opened this issue Jul 5, 2024 · 1 comment
Open

swift package add-dependency automatically resolve a version #7759

MahdiBM opened this issue Jul 5, 2024 · 1 comment

Comments

@MahdiBM
Copy link

MahdiBM commented Jul 5, 2024

Description

swift package add-dependency should automatically default to --from, with the latest stable version resolved.
If no stable version, it should just default to the latest available version, possibly with only "upToNextMinor"?

cargo add jwt-authorizer has a similar behavior to what I described.

Expected behavior

swift package add-dependency https://github.com/DiscordBM/DiscordBM

Should result in:

.package(url: "https://github.com/DiscordBM/DiscordBM", from: "1.12.0"),

Notice from: "1.12.0" automatically figured out by the command.

Actual behavior

swift package add-dependency https://github.com/DiscordBM/DiscordBM

Results in:

error: must specify one of --exact, --branch, --revision, --from, or --up-to-next-minor-from

Steps to reproduce

Feature Request - No steps to reproduce.

Swift Package Manager version/commit hash

~ swift package --version
Swift Package Manager - Swift 6.0.0-dev

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10)
Target: arm64-apple-macosx15.0
Darwin ---.local 24.0.0 Darwin Kernel Version 24.0.0: ---; root:xnu-11215.0.115.501.3~1/RELEASE_ARM64_T6000 arm64
@MahdiBM MahdiBM changed the title swift package add-dependency automatically resolve and default to --from swift package add-dependency automatically resolve a version Jul 5, 2024
@rauhul
Copy link
Member

rauhul commented Jul 7, 2024

I think this would be a good improvement, imo the default should be from: "<latest-tag>" which iiuc means up to next major.

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

No branches or pull requests

2 participants