Commit graph

821 commits

Author SHA1 Message Date
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
Jiahao XU
3ef5125c3a
Merge pull request #277 from cargo-bins/improve-integration-test
Rm `$HOME/.cargo` to test `cargo-binstall`
2022-08-04 18:22:25 +10:00
Jiahao XU
d472e8054b
Fix typo in target::linux::create_targets_str
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:46:26 +10:00
Jiahao XU
140d3df8bd
Fix integration test: Set CARGO_HOME instead of rm -rf $HOME/.cargo
The later would also delete the cmd `cargo`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:40:58 +10:00
Jiahao XU
a686aca08c
Refactor: Extract target::linux::create_targets_str
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:38:27 +10:00
Jiahao XU
7997c73cb2
Optimize: Avoid spawning ldd if built with Glibc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:35:24 +10:00
Jiahao XU
cc92c2c4b6
Rm $HOME/.cargo to test cargo-binstall
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:29:19 +10:00
Jiahao XU
888627ce87
Merge pull request #273 from cargo-bins/dependabot/cargo/async-trait-0.1.57
Bump async-trait from 0.1.56 to 0.1.57
2022-08-04 16:40:30 +10:00
Jiahao XU
fb52308d39
Merge pull request #274 from cargo-bins/dependabot/cargo/thiserror-1.0.32
Bump thiserror from 1.0.31 to 1.0.32
2022-08-04 16:39:56 +10:00
dependabot[bot]
3cc3338ff5
Bump async-trait from 0.1.56 to 0.1.57
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.56 to 0.1.57.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.56...0.1.57)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 06:28:22 +00:00
dependabot[bot]
1aa04a25c6
Bump thiserror from 1.0.31 to 1.0.32
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.31 to 1.0.32.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.31...1.0.32)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 06:27:58 +00:00
Jiahao XU
ba57e2905b
Merge pull request #272 from cargo-bins/dependabot/cargo/serde-1.0.142
Bump serde from 1.0.140 to 1.0.142
2022-08-04 16:26:59 +10:00
dependabot[bot]
ec2c11843b
Bump serde from 1.0.140 to 1.0.142
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.140 to 1.0.142.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.140...v1.0.142)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 06:20:52 +00:00
Jiahao XU
b1490ffba3
Merge pull request #275 from cargo-bins/dependabot/cargo/serde_json-1.0.83
Bump serde_json from 1.0.82 to 1.0.83
2022-08-04 16:19:56 +10:00
dependabot[bot]
2383f81760
Bump serde_json from 1.0.82 to 1.0.83
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.82...v1.0.83)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 06:11:34 +00:00
Jiahao XU
608f90f51a
Merge pull request #271 from cargo-bins/dependabot/cargo/miette-5.2.0
Bump miette from 5.1.1 to 5.2.0
2022-08-04 16:10:11 +10:00
dependabot[bot]
9627b73d6b
Bump miette from 5.1.1 to 5.2.0
Bumps [miette](https://github.com/zkat/miette) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/zkat/miette/releases)
- [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.1.1...miette-derive-v5.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 04:52:56 +00:00
Jiahao XU
d2ab613652
Merge pull request #276 from NobodyXu/fix
Fix #267
2022-08-04 14:51:44 +10:00
Jiahao XU
71566383db
Fix creating .cargo/.crates.toml in metadata::v1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 14:08:06 +10:00
Jiahao XU
28aeae938e
fs::create_dir_all(&install_path) in main.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 14:00:44 +10:00
Jiahao XU
346bb8ee67
Fix binstall::resolve (#266) 2022-08-04 11:12:06 +12:00
Jiahao XU
f7625fcefc
Merge pull request #264 from NobodyXu/fix-repeated-crates-on-batch-installation
Fix repeated crates on batch installation: Dedup them and only keep the last one
2022-08-03 21:32:09 +10:00
Jiahao XU
8d410a5710
Merge pull request #265 from NobodyXu/minor-fix-and-optimize
Minor fix (use `PathBuf` instead of `String` to relax utf-8 req) and micro optimization
2022-08-03 13:21:45 +10:00
Jiahao XU
60d17c7e56
Ret CompactString in Fetcher::source_name
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:42:05 +10:00
Jiahao XU
f72eafb049
Use PathBuf for field Options::install_path
Since it does not require a utf-8 string.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:28:44 +10:00
Jiahao XU
a52ac3fc7a
Use CompactString for Options::version_req
which is unlikely to be larger than 24 bytes.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:26:44 +10:00
Jiahao XU
b7cfa0aa64
Use CompactString for field Resolution::Fetch::version
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:21:45 +10:00
Jiahao XU
d430c077d4
Use CompactString for fields of CrateName
Since most of the time, they are shorter than 24 bytes.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:17:11 +10:00
Jiahao XU
caeb49ce33
Rm duplicate crate_names specified on cmdline
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:15:09 +10:00
Jiahao XU
09c1afe616
Impl new fn CrateName::dedup
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 22:14:05 +10:00
Jiahao XU
58c50cbe91
Add new dep itertools v0.10.3
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 20:18:44 +10:00
Jiahao XU
9391d22fa2
Apply clippy suggestion
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-02 19:54:01 +10:00
Jiahao XU
a2e6709ed6
Merge pull request #262 from ryankurte/dependabot/cargo/bytes-1.2.1
Bump bytes from 1.2.0 to 1.2.1
2022-08-01 18:23:50 +10:00
dependabot[bot]
da19855500
Bump bytes from 1.2.0 to 1.2.1
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 03:41:34 +00:00
Jiahao XU
ea8ae5ce26
Merge pull request #261 from ryankurte/dependabot/cargo/tokio-1.20.1
Bump tokio from 1.20.0 to 1.20.1
2022-08-01 13:40:35 +10:00
Jiahao XU
fba5394e77
Merge pull request #263 from ryankurte/dependabot/cargo/clap-3.2.16
Bump clap from 3.2.14 to 3.2.16
2022-08-01 13:40:07 +10:00
dependabot[bot]
c5961ee07f
Bump clap from 3.2.14 to 3.2.16
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.14 to 3.2.16.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.14...v3.2.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 01:33:47 +00:00
dependabot[bot]
3cdb2aeddd
Bump tokio from 1.20.0 to 1.20.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.20.0...tokio-1.20.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 01:33:36 +00:00
Jiahao XU
3d967a5405
Merge pull request #256 from NobodyXu/optimize-release-build
Use `build-std` feature for release build to reduce binary size
2022-07-31 19:44:13 +10:00
Jiahao XU
a6889c678e
Rm unused rustflags value in ci-scripts/compile-settings.jq
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-31 16:21:31 +10:00
Jiahao XU
9e5ff25be8
Fix release build: Set RUSTFLAGS to link with libgcc statically
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-31 13:40:17 +10:00
Jiahao XU
af3b87df7a
Fix releasae build: Install rust-src for release
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
7a7220b1a2
Fix build: Rm unnecessary env.TOOLCHAIN
Since we build it using +nightly anyway.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
98d8a96a02
Use build-std feature for release build to reduce binary size
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:17 +10:00
Félix Saparelli
ac995798ef
Split features and build args handling in build (#257) 2022-07-30 17:27:49 +12:00