Commit graph

733 commits

Author SHA1 Message Date
Jiahao XU
e510511487
Improve GhCrateMeta: Detect cases where pkg-fmt is not specified (#757)
* Fix fmt of mod `<GhCrateMeta as Fetcher>::find`
* Add new variant `BinstallError::InvalidPkgFmt`
* Impl new fn `PkgFmt::guess_pkg_format`
* Improve `GhCrateMeta`: Detect cases where `pkg-fmt` is not specified
  
  but `pkg-url` also does not contain format, archive-format or
  archive-suffix which is required for automatically deducing the pkg-fmt.
  
  In these cases, we would call `PkgFmt::guess_pkg_format` to try out best
  to figure out the pkg-fmt, otherwise we just return an error.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-04 10:47:57 +13:00
dependabot[bot]
b05548440d
Bump zstd from 0.12.2+zstd.1.5.2 to 0.12.3+zstd.1.5.2 (#756) 2023-02-01 02:13:58 +00:00
dependabot[bot]
7dc07ad23c
Bump bytes from 1.3.0 to 1.4.0 (#754) 2023-02-01 01:43:33 +00:00
dependabot[bot]
68f3eb81d4
Bump fs4 from 0.6.2 to 0.6.3 (#755) 2023-02-01 01:40:45 +00:00
dependabot[bot]
28449c21f4
Bump toml_edit from 0.19.0 to 0.19.1 (#753) 2023-01-31 01:41:22 +00:00
dependabot[bot]
84621d54a5
Bump async-trait from 0.1.63 to 0.1.64 (#752) 2023-01-31 01:39:31 +00:00
dependabot[bot]
aa89f0073d
Bump futures-util from 0.3.25 to 0.3.26 (#751)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.25 to 0.3.26.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.25...0.3.26)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-31 12:36:22 +11:00
dependabot[bot]
1ad5d4657f
Bump toml_edit from 0.18.0 to 0.19.0 (#748) 2023-01-30 02:37:41 +00:00
dependabot[bot]
d34ad5ad1f
Bump tokio from 1.24.2 to 1.25.0 (#749) 2023-01-30 02:20:04 +00:00
dependabot[bot]
d36acbb4e6
Bump either from 1.8.0 to 1.8.1 (#743)
Bumps [either](https://github.com/bluss/either) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/bluss/either/releases)
- [Commits](https://github.com/bluss/either/compare/1.8.0...1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-27 01:23:22 +00:00
Jiahao XU
270bf08a24
Optimize use of tinytemplate (#647)
* Optimize `GhCrateMeta::find`: Cache compiled template `pkg_url`
* Optimize `collect_bin_files`: Cache compiled template `bin_dir`
* Refactor: Improve readability of `gh_crate_meta`
* Optimize `GhCrateMeta::launch_baseline_find_tasks`: Dedup urls before checking
* Optimize `BinFile::new`: Avoid one heap alloc when creating `dest`
* Improve `warn!` msg in `GhCrateMeta::launch_baseline_find_tasks`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-26 17:33:49 +13:00
dependabot[bot]
719b20aadd
Bump clap from 4.1.3 to 4.1.4 (#742) 2023-01-25 16:57:09 +11:00
Jiahao XU
eb95c5b799
Minor optimization for bin and binstalk (#646)
* Refactor `logging`: Extract `report_err`
* Optimize `get_default_pkg_url_template`: Return iter instead of `Vec`
   to avoid heap allocation.
* Refactor `GhCrateMeta::find`: Rm `launch_baseline_find_tasks`
* Optimize `GhCrateMeta::find`: Avoid cloning `Cow<'_, str>`
* Improve `report_err` output: Print newline after msg

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-25 01:58:07 +13:00
Jiahao XU
283163bbda
Enable feature zstd-thin by default (#741)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 23:48:12 +11:00
Jiahao XU
9047d99c1a
Fix unused import in binstalk-manifests (#740)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 23:47:50 +11:00
Jiahao XU
152ea8376b
Switch from toml back to toml_edit (#738)
Since now toml simply uses toml_edit, there is no reason to continue
using it as it merely increase compilation time and bloat.

Instead, we switch to toml_edit v0.18.0 with feature serde enabled.

This also remove the `CratesTomlParseError::TomlParseNonUtf8` variant
intorduced in #736.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 16:27:34 +13:00
dependabot[bot]
425c6c2509
Bump toml from 0.5.11 to 0.6.0 (#736)
* Bump toml from 0.5.11 to 0.6.0

Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.6.0.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Fix use of `toml` v0.6
* Optimize `CratesTomlParseError`: Box variant `TomlParse`
   Since now `toml:🇩🇪:Error` is a wrapper of `toml_edit::TomlError`,
   which is at least 3 * `size_of::<Vec<_>>()`.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-24 02:51:29 +00:00
dependabot[bot]
9a2b4c9ab1
Bump clap from 4.1.1 to 4.1.3 (#735)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.1 to 4.1.3.
- [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/clap_complete-v4.1.1...v4.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 12:56:44 +11:00
dependabot[bot]
e22d319825
Bump toml from 0.5.10 to 0.5.11 (#734)
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.10...toml-v0.5.11)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 04:50:58 +00:00
dependabot[bot]
5bd6a50d70
Bump async-trait from 0.1.61 to 0.1.63 (#733)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.61 to 0.1.63.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.61...0.1.63)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 15:37:35 +11:00
dependabot[bot]
7857856f78
Bump reqwest from 0.11.13 to 0.11.14 (#732)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.13 to 0.11.14.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.13...v0.11.14)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-20 01:28:21 +00:00
dependabot[bot]
493d2778fe
Bump tokio from 1.24.1 to 1.24.2 (#727)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.24.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 01:23:26 +00:00
github-actions[bot]
46a035699e
release: cargo-binstall v0.19.3 (#721)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-17 22:47:38 +11:00
github-actions[bot]
42b858927b
release: binstalk v0.7.1 (#720)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-17 19:36:35 +11:00
Jiahao XU
ab4da7f059
Fix self-update on windows (#712)
Fixed #702


* Add new dep windows v0.44.0 for windows only
* Add regression test for #702
* Impl `win::replace_file`
* Use `ReplaceFileW` on windows if `fs::rename` in `fs::atomic_install` fails
* Improve logging and err messages
* Add more regression tests
* Make `BinFile::install_link` atomic: Do not remove file if dst exists
* Fallback to `ReplaceFileW` in `fs::atomic_symlink_file`
* Refactor: Extract new fn `fs::persist`
* Use `fs::persist` instead of `TempFile::persist` in `fs::atomic_install`, which fallbacks to `ReplaceFileW` on windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
2023-01-17 18:05:07 +11:00
github-actions[bot]
a60ae7ef6c
release: binstalk-downloader v0.3.2 (#715)
Co-authored-by: github-actions <github-actions@github.com>
2023-01-17 14:42:26 +13:00
Félix Saparelli
c1332c0d2d
Revert "Bump async_zip from 0.0.9 to 0.0.10" (#714) 2023-01-17 13:08:25 +13:00
github-actions[bot]
c2b1c243ea
release: cargo-binstall v0.19.2 (#707)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-16 15:39:07 +11:00
github-actions[bot]
97a1ce82eb
release: binstalk-downloader v0.3.1 (#711)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-16 15:00:21 +11:00
dependabot[bot]
7cd782271e
Bump async_zip from 0.0.9 to 0.0.10 (#709)
* Bump async_zip from 0.0.9 to 0.0.10

Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.9 to 0.0.10.
- [Release notes](https://github.com/Majored/rs-async-zip/releases)
- [Commits](https://github.com/Majored/rs-async-zip/compare/v0.0.9...v0.0.10)

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

* Fix usage of `async_zip::read::stream` APIs


Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-16 14:26:08 +11:00
dependabot[bot]
bc6ac734b4
Bump clap from 4.0.32 to 4.1.1 (#710)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.32 to 4.1.1.
- [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/v4.0.32...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 13:54:52 +11:00
github-actions[bot]
8119acfeb0
release: detect-targets v0.1.5 (#706)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-16 11:23:54 +11:00
Jiahao XU
d72abde8e9
Fixed #704: Fix get_target_from_rustc for alpine (#705)
On Alpine, rustc returns host triple `x86_64-alpine-linux-musl`, so we
have to adopt code from
[`convert_custom_linux_target`](5519aeb5c2/build-common.rs (L1-L13)) to fix this.

* Optimize `get_target_from_rustc`: Avoid frequent String allocation

caused by `Cursor::new(stdout).lines()` which calls `BufRead::lines` and
returns `Lines` iterator, which returns `Item = io::Result<String>`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-16 10:57:53 +11:00
dependabot[bot]
13845a7ca2
Bump zstd from 0.12.1+zstd.1.5.2 to 0.12.2+zstd.1.5.2 (#695) 2023-01-12 07:36:21 +00:00
github-actions[bot]
850ad63df9
release: cargo-binstall v0.19.1 (#698)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-12 17:16:40 +11:00
Jiahao XU
1be25f81b5
Fix FileLock for .crates.toml not dropped (#697)
* Fix `FileLock` for `.crates.toml` not dropped

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Rm unneccessary ret type annotation for the closure

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Add regression test

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-12 18:45:36 +13:00
github-actions[bot]
ea28e5e1e4
release: cargo-binstall v0.19.0 (#688)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-12 10:22:31 +11:00
github-actions[bot]
1b0e9292ae
release: binstalk v0.7.0 (#690)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-11 00:49:45 +00:00
github-actions[bot]
236829b7f2
release: binstalk-downloader v0.3.0 (#689)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-11 00:31:10 +00:00
github-actions[bot]
24c15e57e9
release: binstalk-manifests v0.2.0 (#684)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-10 23:48:36 +00:00
github-actions[bot]
3d79401d81
release: binstalk-types v0.2.0 (#685)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-11 10:29:31 +11:00
github-actions[bot]
9cdaf777c0
release: detect-targets v0.1.4 (#683)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-01-10 23:12:37 +00:00
dependabot[bot]
4ebf7cb421
Bump tokio from 1.23.0 to 1.24.1 (#658)
* Bump tokio from 1.23.0 to 1.24.1

Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.24.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.23.0...tokio-1.24.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Don't reuse build cache

* fix index cache

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
2023-01-09 20:39:39 +11:00
dependabot[bot]
e5d4c13d1b
Bump mimalloc from 0.1.32 to 0.1.34 (#670)
Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.32 to 0.1.34.
- [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases)
- [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.32...v0.1.34)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 03:19:08 +00:00
dependabot[bot]
94cabeb5d7
Bump async-trait from 0.1.60 to 0.1.61 (#669)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.60 to 0.1.61.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.60...0.1.61)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 14:01:41 +11:00
Félix Saparelli
aea9df602c
Migrate CI and builds to Just, add "full" builds (#660) 2023-01-08 16:27:36 +11:00
Jiahao XU
305bf8123d
Optimize Client: Reduce size from 16 to 8 (#655)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-06 03:02:14 +00:00
dependabot[bot]
ecb572d02d
Bump bzip2 from 0.4.3 to 0.4.4 (#657)
Bumps [bzip2](https://github.com/alexcrichton/bzip2-rs) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/alexcrichton/bzip2-rs/releases)
- [Commits](https://github.com/alexcrichton/bzip2-rs/commits/0.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 01:28:15 +00:00
Jiahao XU
7b34178bcc
Optimize resolve_inner: Avoid VersionReq::clone (#656)
* Add new dep maybe-owned v0.3.4 to binstalk
* Optimize `resolve_inner`: Avoid `VersionReq::clone`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-06 13:47:45 +13:00
Jiahao XU
7656b887d9
Fix Client::new: Make sure we use at least tls 1.2 (#652)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-05 13:21:00 +00:00