Commit graph

865 commits

Author SHA1 Message Date
Jiahao XU
4a17460252
Test skip when installed in ci-scripts/tests.sh
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
7f4edfd9f2
log::info! if a crate is skipped due to already installed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
2c2b3c070f
Skip only if version_req is satisfied
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
431992dab0
Test --version and $crate_name@$version in tests.sh
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
065f62a625
Use VersionReq for Options::version_req and update usage of
`CrateName` in `binstall::install`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
686cae6ae8
Use &VersionReq for param version_req of fetch_crate_cratesio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:59 +10:00
Jiahao XU
497ef80b27
Take &VersionReq for 1st param of find_version
instead of `&str`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
dd8e6a400d
Rename CrateName::version to version_req and change its type to
`Option<VersionReq>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
51d6b3039b
Impl new fn helpers::parse_version
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
20c7b61e7a
FIx ci-scripts/tests.sh: Use --force to force installation.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
34f714c64f
Pass --force to cargo-install
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
4b79abeedc
Refactor: Run TempDir creation in block_in_place
Since it could also issues blocking operations.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
b8c44839c1
Detect install_path & load metadata in block_in_place
since they involves blocking fs io.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
b4c6db7cda
Refactor & Optimize: Launch target detection as soon as possible
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:58 +10:00
Jiahao XU
4dae214af3
Use block_in_place for loading metadata
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:57 +10:00
Jiahao XU
6716d75607
Minor Refactor: Gather code related to crate_names
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:57 +10:00
Jiahao XU
ac085533cc
Skip crates that are already installed.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:57 +10:00
Jiahao XU
04fee49c22
Add new option Options::force
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-08 18:05:57 +10:00
Ryan
0bbeecce86
Merge pull request #284 from cargo-bins/split-docs
split docs, first step towards simplifying support instructions
2022-08-08 14:50:21 +12:00
Jiahao XU
1bb2602c86
Merge pull request #287 from cargo-bins/dependabot/cargo/semver-1.0.13
Bump semver from 1.0.12 to 1.0.13
2022-08-08 12:01:47 +10:00
Jiahao XU
cf7c3aec27
Merge pull request #286 from cargo-bins/dependabot/cargo/strum_macros-0.24.3
Bump strum_macros from 0.24.2 to 0.24.3
2022-08-08 12:01:18 +10:00
dependabot[bot]
5b35beb68b
Bump semver from 1.0.12 to 1.0.13
Bumps [semver](https://github.com/dtolnay/semver) from 1.0.12 to 1.0.13.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.12...1.0.13)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 01:44:57 +00:00
dependabot[bot]
03291c895a
Bump strum_macros from 0.24.2 to 0.24.3
Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.24.2 to 0.24.3.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

---
updated-dependencies:
- dependency-name: strum_macros
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 01:44:44 +00:00
ryan kurte
5c703f30ca add note about quickinstall / cargo install fallback 2022-08-08 11:42:06 +12:00
Jiahao XU
132c5dfaa9
Merge pull request #280 from cargo-bins/signal-handling
Add Signal handling
2022-08-06 20:13:03 +10:00
Félix Saparelli
68d3ab56f7
Enable sparse registry in CI (#285) 2022-08-06 22:07:24 +12:00
ryan kurte
b3f6eb64ea split docs, first step towards simplifying support instructions 2022-08-06 09:44:17 +12:00
Jiahao XU
5748fd6cf3
Merge pull request #283 from cargo-bins/fix/passing-quiet
Fix passing `--quiet` to `cargo-install`
2022-08-05 16:05:11 +10:00
Jiahao XU
9cb8df1d48
Fix passing --quiet to cargo-install
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-05 15:45:46 +10:00
Jiahao XU
b46e54b53a
Merge pull request #281 from cargo-bins/fix-quiet
Improve doc of cmdline option `log_level`, add `--quiet` and pass it to `cargo-install`
2022-08-05 15:35:56 +10:00
Jiahao XU
c352eb00d1
Add missing doc for trace for Options::log_level
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-05 15:24:39 +10:00
Jiahao XU
7a90d4d6c6
Improve help page for Options::log_level
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-05 15:09:40 +10:00
Jiahao XU
8d5f555373
Add new option -q for compatibility with cargo-install
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-05 15:02:38 +10:00
Jiahao XU
b6a539735d
Pass -q to cargo-install if log_level is set to off
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:21:29 +10:00
Jiahao XU
3d28549fd6
Apply clippy suggestions in binstall::install
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:18:00 +10:00
Jiahao XU
6685d5a610
Add new option Options::quiet
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:16:45 +10:00
Jiahao XU
62bce2f52f
Improve doc for Options::log_level
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:15:05 +10:00
Jiahao XU
ede134d851
Fix locking of stdou in UIThreadInner
which blocks the printing in main thread and prevents it from exiting.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:04:04 +10:00
Jiahao XU
cea67b2e54
Use std:🧵:spawn in UIThreadInner
instead of `tokio::task::spawn_blocking` so that dropping rt would not
block the main thread until the ui thread is exit (which might never
exit).

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 23:01:26 +10:00
Jiahao XU
f4dd75ef9b
Update doc on BinstallError::UserAbort
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 19:44:12 +10:00
Jiahao XU
b921e9dfc8
Use cancel_on_user_sig_term in main
to cancel the execution if users requested termination via signal.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 19:42:47 +10:00
Jiahao XU
47ab8f55c7
Impl new fn helpers::cancel_on_user_term
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 19:37:13 +10:00
Jiahao XU
74051eb478
Enable feature "macros" of dep "tokio"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:46:41 +10:00
Jiahao XU
ca3efdf2eb
Enable feature "signal" of dep "tokio"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:45:32 +10:00
Jiahao XU
e8301839a9
Use AutoAbortJoinHandle in main::entry
so that the tasks will be cancelled if future returned by
`entry()` is cancelled.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:39:17 +10:00
Jiahao XU
a13180f79a
Ret BinstallError in <AutoAbortJoinHandle as Future>::poll
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:37:52 +10:00
Jiahao XU
36066fd4df
Use AutoAbortJoinHandle::spawn in GhCrateMeta::find
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:33:35 +10:00
Jiahao XU
5d315ae801
Use AutoAbortJoinHandle::spawn in MultiFetcher::add
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:31:23 +10:00
Jiahao XU
2103dea3ac
Impl new convenient fn AutoAbortJoinHandle::spawn
As a shortcut to `AutoAbortJoinHandle::new(tokio::spawn(...))`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 18:30:48 +10:00
Jiahao XU
64e948f941
Merge pull request #278 from cargo-bins/optimize
Optimize `target::linux::detect_target_linux`
2022-08-04 18:23:04 +10:00