-
Notifications
You must be signed in to change notification settings - Fork 262
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
Issue 175: cargo shuttle init
(without bonus)
#192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking real good. Thanks @nahuakang !
@chesedo I opted to use However, I cannot use Caused by:
failed to select a version for `libgit2-sys`.
... required by package `cargo v0.59.0`
... which satisfies dependency `cargo = "^0.59.0"` of package `cargo-shuttle v0.3.0 (/Users/nahua/projects/shuttle-hq/shuttle/cargo-shuttle)`
versions that meet the requirements `^0.12.24` are: 0.12.26+1.3.0, 0.12.25+1.3.0, 0.12.24+1.3.0
the package `libgit2-sys` links to the native library `git2`, but it conflicts with a previous package which links to `git2` as well:
package `libgit2-sys v0.13.0+1.4.1`
... which satisfies dependency `libgit2-sys = "^0.13.0"` of package `git2 v0.14.0`
... which satisfies dependency `git2 = "^0.14"` of package `cargo-edit v0.9.0`
... which satisfies dependency `cargo-edit = "^0.9.0"` of package `cargo-shuttle v0.3.0 (/Users/nahua/projects/shuttle-hq/shuttle/cargo-shuttle)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='libgit2-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `libgit2-sys` which could resolve this conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm all happy with this @nahuakang.
If updating to cargo v0.62 is easy and fixes the update for cargo-edit
, then feel free to commit it on this PR. Else I'm happy to merge with the older version of cargo-edit
@chesedo Hey Pieter, thanks and now I merged the conflicts with I tried updating both
Should I leave the versions as the present values instead? I'm not too familiar to understand why this trait bound issue occurs with the version update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for this @nahuakang!
Motivation
This PR adds
cargo shuttle init
feature to #175. This is a partial solution to the feature as it does not include separatecargo shuttle init
commands for each supported framework, e.g.axum
androcket
.I hope to continue on these separate commands on a separate PR and then start refactoring
Shuttle.init
method insidecargo-shuttle/src/main.rs
as I think we could extract out some logic and add unit tests to the operations onCargo.toml
.Changes
Init(InitArgs)
variant toCommand
inargs.rs
cargo init --lib
via thecargo
cratecrate-type = ["cdylib"]
toCargo.toml
shuttle-service
dependency toCargo.toml
How it works
cargo shuttle init
initializesCargo.toml
andsrc/
in the current directory (similar tocargo init
)cargo shuttle init newproject
initializes in./newproject
directory; if the directorynewproject
does not exist, it will be createdcargo shuttle init /full/path/to/newproject
initializesCargo.toml
andsrc/
in the given path; if any directory does not exist, it will be recursively createdTo-Dos