14-11-2023
This commit is contained in:
@@ -62,7 +62,11 @@ Current installation options:
|
||||
|
||||
|
||||
|
||||
### Installer kiro-editor:
|
||||
### Cargo:
|
||||
|
||||
Cargo est le gestionnaire de paquets de Rust.
|
||||
|
||||
#### Installer un paquet:
|
||||
|
||||
```bash
|
||||
$ cargo install kiro-editor
|
||||
@@ -108,3 +112,231 @@ $ cargo install kiro-editor
|
||||
|
||||
```
|
||||
|
||||
Les paquets sont installés dans `~/.cargo/bin`
|
||||
|
||||
```bash
|
||||
~/.cargo/bin 11:33:15
|
||||
❯ ls -la
|
||||
total 3492
|
||||
drwxr-xr-x 16 bruno staff 512 mai 9 2022 .
|
||||
drwxr-xr-x 8 bruno staff 256 fév 4 2022 ..
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 cargo -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 cargo-clippy -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 cargo-fmt -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 cargo-miri -> /opt/homebrew/bin/rustup-init
|
||||
-rwxr-xr-x 1 bruno staff 2483315 mai 9 2022 cavif
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 clippy-driver -> /opt/homebrew/bin/rustup-init
|
||||
-rwxr-xr-x 1 bruno staff 1088162 fév 4 2022 kiro
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rls -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rust-gdb -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rust-lldb -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rustc -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rustdoc -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rustfmt -> /opt/homebrew/bin/rustup-init
|
||||
lrwxr-xr-x 12 bruno staff 29 fév 4 2022 rustup -> /opt/homebrew/bin/rustup-init
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Chercher un paquet:
|
||||
|
||||
```bash
|
||||
$ cargo search avif
|
||||
avif = "0.0.0" # RESERVED. Open for adoption by projects that fulfill some criteria. Please see the gist in the home…
|
||||
avif-serialize = "0.7.6" # Minimal writer for AVIF header structure (MPEG/HEIF/MIAF/ISO-BMFF)
|
||||
avif-decode = "0.2.2" # Convert AVIF images to PNG or decompressed pixel data
|
||||
avif-parse = "1.0.0" # Parser for AVIF image files
|
||||
cavif = "1.4.0" # Encodes images in AVIF format (image2avif converter) using a pure-Rust encoder.
|
||||
ravif = "0.9.1" # rav1e-based pure Rust library for encoding images in AVIF format (powers the `cavif` tool)
|
||||
libavif = "0.10.1" # High-level API for AVIF image files
|
||||
libavif-image = "0.9.0" # Load AVIF files into the `image` crate
|
||||
aom-decode = "0.2.4" # Minimal safe wrapper for libaom AV1 decoder
|
||||
libavif-sys = "0.13.1" # Unsafe wrapper around libavif, the image codec
|
||||
... and 23 crates more (use --limit N to see more)
|
||||
```
|
||||
|
||||
#### Supprimer un paquet:
|
||||
|
||||
```bash
|
||||
$ cargo uninstall kiro-editor
|
||||
|
||||
Removing /Users/bruno/.cargo/bin/kiro
|
||||
```
|
||||
|
||||
#### Mettre à jour un paquet:
|
||||
|
||||
```bash
|
||||
$ cargo install <crate>
|
||||
```
|
||||
|
||||
Installe la dernière version du paquet si nécessaire, sinon ne fait rien.
|
||||
|
||||
#### Force la réinstallation:
|
||||
|
||||
-> Supprime le paquet -> télécharge la dernière version -> installe
|
||||
|
||||
```bash
|
||||
$ cargo install --force <crate>
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Liste des paquets installés:
|
||||
|
||||
```bash
|
||||
$ cargo install --list
|
||||
cavif v1.3.4:
|
||||
cavif
|
||||
kiro-editor v0.4.3:
|
||||
kiro
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cat .crates2.json | jq .
|
||||
{
|
||||
"installs": {
|
||||
"cavif 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)": {
|
||||
"version_req": null,
|
||||
"bins": [
|
||||
"cavif"
|
||||
],
|
||||
"features": [],
|
||||
"all_features": false,
|
||||
"no_default_features": false,
|
||||
"profile": "release",
|
||||
"target": "aarch64-apple-darwin",
|
||||
"rustc": "rustc 1.58.1 (db9d1b20b 2022-01-20)\nbinary: rustc\ncommit-hash: db9d1b20bba1968c1ec1fc49616d4742c1725b4b\ncommit-date: 2022-01-20\nhost: aarch64-apple-darwin\nrelease: 1.58.1\nLLVM version: 13.0.0\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Mettre à jour les paquets:
|
||||
|
||||
```bash
|
||||
$ cargo install $(cargo install --list | ggrep -E '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ')
|
||||
Updating crates.io index
|
||||
Ignored package `cavif v1.4.0` is already installed, use --force to override
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
https://github.com/kbknapp/cargo-outdated
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
# https://lib.rs/crates/cargo-cache
|
||||
|
||||
$ cargo install cargo-cache
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cargo cache --autoclean
|
||||
Clearing cache...
|
||||
|
||||
Cargo cache '/Users/bruno/.cargo':
|
||||
|
||||
Total: 737.91 MB => 594.18 MB
|
||||
15 installed binaries: 103.16 MB
|
||||
Registry: 634.75 MB => 491.01 MB
|
||||
Registry index: 457.35 MB
|
||||
291 crate archives: 33.67 MB
|
||||
291 => 0 crate source checkouts: 143.73 MB => 0 B
|
||||
Git db: 0 B
|
||||
0 bare git repos: 0 B
|
||||
0 git repo checkouts: 0 B
|
||||
|
||||
Size changed 737.91 MB => 594.18 MB (-143.73 MB, -19.47%)
|
||||
```
|
||||
|
||||
```bash
|
||||
$ rm -rf ~/.cargo/registry
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
# https://lib.rs/crates/cargo-prune
|
||||
|
||||
$ cargo install cargo-prune
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cargo prune
|
||||
```
|
||||
|
||||
|
||||
|
||||
### rustup:
|
||||
|
||||
```bash
|
||||
$ rustup check
|
||||
stable-aarch64-apple-darwin - Update available : 1.61.0 (fe5b13d68 2022-05-18) -> 1.65.0 (897e37553 2022-11-02)
|
||||
rustup - Up to date : 1.25.1
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ rustup show
|
||||
Default host: aarch64-apple-darwin
|
||||
rustup home: /Users/bruno/.rustup
|
||||
|
||||
stable-aarch64-apple-darwin (default)
|
||||
rustc 1.61.0 (fe5b13d68 2022-05-18)
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### M-à-J de rustup (réalisée par brew):
|
||||
|
||||
```bash
|
||||
$ rustup self update
|
||||
error: self-update is disabled for this build of rustup
|
||||
error: you should probably use your system package manager to update rustup
|
||||
```
|
||||
|
||||
#### M-à-J de Rust:
|
||||
|
||||
```bash
|
||||
$ rustup update
|
||||
info: syncing channel updates for 'stable-aarch64-apple-darwin'
|
||||
info: latest update on 2022-11-03, rust version 1.65.0 (897e37553 2022-11-02)
|
||||
info: downloading component 'cargo'
|
||||
4.2 MiB / 4.2 MiB (100 %) 1.0 MiB/s in 4s ETA: 0s
|
||||
info: downloading component 'clippy'
|
||||
2.0 MiB / 2.0 MiB (100 %) 1.2 MiB/s in 1s ETA: 0s
|
||||
info: downloading component 'rust-std'
|
||||
27.6 MiB / 27.6 MiB (100 %) 1.1 MiB/s in 28s ETA: 0s
|
||||
info: downloading component 'rustc'
|
||||
52.2 MiB / 52.2 MiB (100 %) 801.6 KiB/s in 1m 7s ETA: 0s
|
||||
info: downloading component 'rustfmt'
|
||||
2.3 MiB / 2.3 MiB (100 %) 757.0 KiB/s in 3s ETA: 0s
|
||||
info: removing previous version of component 'cargo'
|
||||
info: removing previous version of component 'clippy'
|
||||
info: removing previous version of component 'rust-std'
|
||||
info: removing previous version of component 'rustc'
|
||||
info: removing previous version of component 'rustfmt'
|
||||
info: installing component 'cargo'
|
||||
info: installing component 'clippy'
|
||||
info: installing component 'rust-std'
|
||||
27.6 MiB / 27.6 MiB (100 %) 18.2 MiB/s in 1s ETA: 0s
|
||||
info: installing component 'rustc'
|
||||
52.2 MiB / 52.2 MiB (100 %) 20.9 MiB/s in 2s ETA: 0s
|
||||
info: installing component 'rustfmt'
|
||||
|
||||
stable-aarch64-apple-darwin updated - rustc 1.65.0 (897e37553 2022-11-02) (from rustc 1.61.0 (fe5b13d68 2022-05-18))
|
||||
|
||||
info: cleaning up downloads & tmp directories
|
||||
info: self-update is disabled for this build of rustup
|
||||
info: any updates to rustup will need to be fetched with your system package manager
|
||||
```
|
||||
|
||||
```bash
|
||||
$ rustup check
|
||||
stable-aarch64-apple-darwin - Up to date : 1.65.0 (897e37553 2022-11-02)
|
||||
rustup - Up to date : 1.25.1
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user