Whenever a dependency from a git repository is specified without any other specifiers (namely via the properties , rev, or tag), that means that it is specified to the latest revision of the main branch of that repository. But in any case, updating any dependency requires updating the project's Cargo.lock file. This generally means using the branch command.cargo update
cargo update
This will also detect any changes to the version or origin requirements and update the dependency lock accordingly.
I tried to use this command:
cargo install rust_wheel --force
That is the wrong Cargo command. is for installing binaries to the system, not to install dependencies. This is well documented too.cargo install
Also tried
.cargo update rust_wheel
Wrong syntax. To issue an update of a specific dependency, use the option.-p
cargo update -p rust_wheel
See also:
This is possible without Cargo, but you'll have to do what it normally does for you.
rustc using the correct flags.rand v0.7.3
├── getrandom v0.1.14
│ ├── cfg-if v0.1.10
│ └── libc v0.2.66
├── libc v0.2.66 (*)
├── rand_chacha v0.2.1
│ ├── c2-chacha v0.2.3
│ │ └── ppv-lite86 v0.2.6
│ └── rand_core v0.5.1
│ └── getrandom v0.1.14 (*)
└── rand_core v0.5.1 (*)
isn't too bad, with only 8 transitive dependencies (including rand itself, not including duplicates). Still, you'll have to go to crates.io or github and download the correct version of the source for each.rand
Then comes compiling. The minimum you'll have to do to compile your own binary is . But remember that you have to do this for each of the 8 dependencies, and all of those have their own external dependencies. You'll also need to figure out the right order to compile them.rustc -L dependency=/path/to/dependency/dir src/main.rs
Moveover, some crates have their own settings in their that have to be respected. Some crates even have a build script that needs to be compiled and run (Cargo.toml is an example in this dependency tree).libc
Alternatively, you could just put
[dependencies]
rand = "0.7.3"
in your and run Cargo.toml. Your choice. Cargo is one of the nicest things about Rust, so I suggest you use it.cargo build
P.S. To see what exactly is doing, run cargo to remove any already compiled dependencies. Then run cargo clean (or cargo build --verbose if you're brave). You'll see all the flags that get passed to cargo build -vv, scripts that get run and everything else.rustc