Commit graph

191 commits

Author SHA1 Message Date
dependabot[bot]
6a9827e66f
Bump serde from 1.0.156 to 1.0.157 (#926) 2023-03-20 04:02:13 +00:00
dependabot[bot]
dd4595e6a4
Bump thiserror from 1.0.39 to 1.0.40 (#928) 2023-03-20 03:35:45 +00:00
dependabot[bot]
30c1e6af8f
Bump async-trait from 0.1.66 to 0.1.67 (#924) 2023-03-20 02:48:52 +00:00
Jiahao XU
f28c05b0ee
Fix QuickInstall report bug for target universal2-apple-darwin (#921)
This bug was reintroduced by #919 and it was fixed by #918

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-18 22:35:48 +13:00
Jiahao XU
cc78ff3b90
Fix fetcher::QuickInstallstats report sending (#918)
Fixed https://github.com/cargo-bins/cargo-quickinstall/issues/195

 - Fix `fetchers::QuickInstall`: Stop sending stats for `universal-apple-darwin`
   since quickinstall only supports targets officially supports by rust.
 - Only send stats report to quickinstall if the `Fetcher::find` is `.await`ed on
   
   This prevents stats report to be sent for cases where the `QuickInstall` fetcher
   is actually unused, e.g. resolved to `GhCrateMeta` or other `QuickInstall` fetcher
   with different target.
   
   This also reduces amount of http requests created in background.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-17 21:05:19 +11:00
dependabot[bot]
3e830c9fad
Bump serde from 1.0.155 to 1.0.156 (#912)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.155 to 1.0.156.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.155...v1.0.156)

---
updated-dependencies:
- dependency-name: serde
  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-03-15 15:56:30 +11:00
dependabot[bot]
ca7b489663
Bump miette from 5.5.0 to 5.6.0 (#913)
Bumps [miette](https://github.com/zkat/miette) from 5.5.0 to 5.6.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.5.0...miette-derive-v5.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 15:56:07 +11:00
github-actions[bot]
63443e88b1
release: binstalk v0.10.0 (#909)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-14 18:31:20 +11:00
Jiahao XU
d118fa8fdb
Obey crates.io crawler policy: Only make one request per sec (#908)
Fixed https://github.com/taiki-e/install-action/issues/89

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-14 17:11:22 +11:00
dependabot[bot]
6df38f1f11
Bump windows from 0.44.0 to 0.46.0 (#905) 2023-03-14 02:32:36 +00:00
github-actions[bot]
57182fae70
release: binstalk v0.9.1 (#903)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-13 23:01:05 +11:00
github-actions[bot]
5e4e047493
release: binstalk-downloader v0.4.1 (#902)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-13 10:41:06 +00:00
Jiahao XU
89a47cbec9
Fix extract_tar_based_stream: Normalize path before adding them to ExtractedFiles (#901)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-13 21:27:50 +11:00
dependabot[bot]
fce7141bec
Bump semver from 1.0.16 to 1.0.17 (#895) 2023-03-13 03:13:07 +00:00
dependabot[bot]
45952446d6
Bump serde from 1.0.154 to 1.0.155 (#894) 2023-03-13 02:40:10 +00:00
github-actions[bot]
a7d8574c4a
release: binstalk v0.9.0 (#892)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-12 22:52:43 +11:00
github-actions[bot]
bb272347da
release: binstalk-downloader v0.4.0 (#891)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-12 22:14:18 +11:00
github-actions[bot]
5b92b43a87
release: detect-targets v0.1.6 (#889)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-12 20:15:31 +11:00
github-actions[bot]
45045041a4
release: binstalk-types v0.3.0 (#887)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-12 08:18:34 +00:00
dependabot[bot]
cfbdf1181f
Bump serde from 1.0.153 to 1.0.154 (#874) 2023-03-09 02:35:50 +00:00
dependabot[bot]
f5c30c2f8c
Bump serde from 1.0.152 to 1.0.153 (#873) 2023-03-08 02:37:38 +00:00
Jiahao XU
72789874f0
Use Quickinstall new release schema (#867)
- Refactor: Extract new fn `binstalk::helpers::remote::does_url_exist`
 - Use new quickinstall release schema in `binstalk::fetchers::QuickInstall`
 - Optimize `fetchers::QuickInstall`: Generate url once in `Fetcher::new`
    Avoid repeated string allocation plus `Url` parsing.
    This also makes changing package_url and stats_url easier.
 - Optimize `QuickInstall::report`: Use HEAD instead of GET

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-06 08:13:08 +00:00
Jiahao XU
01c8ecb778
Fix zip extraction and bins::infer_bin_dir_template (#869)
- Fix zip extraction code: Ensure dir is rwx and file is readable for curr user
 - Add more integration test for `ExtractedFiles`
 - Fix `bins::infer_bin_dir_template` introduced in #856

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-06 17:54:31 +11:00
dependabot[bot]
460522f5bd
Bump thiserror from 1.0.38 to 1.0.39 (#865) 2023-03-06 03:45:37 +00:00
dependabot[bot]
eff8a50d13
Bump command-group from 2.0.1 to 2.1.0 (#864) 2023-03-06 03:36:02 +00:00
dependabot[bot]
a6a42f30af
Bump async-trait from 0.1.64 to 0.1.66 (#866) 2023-03-06 03:16:31 +00:00
Jiahao XU
44e81c7e1a
Fix: Pass value of --roots to cargo-install as --root (#860)
Pass value of `--roots` to `cargo-install` as `--root`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-06 11:52:28 +11:00
Jiahao XU
9c7da6a179
Return a list of files written to disk in binstalk_downloader::download::Download::and_extract (#856)
to avoid collecting extracted files from disk again in resolution stage.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-03 23:31:27 +11:00
Jiahao XU
8eee318ccd
Replace dep crates_io_api with in-house solution (#846)
It also uses `max_stable_version` in the json downloaded from https://crates.io/api/v1/crates/$name if possible, which is equivalent to the version shown on https://crates.io/crates/$name .

 - Add new feat `json` to `binstalk-downloader`
 - Impl new async fn `Response::json`
 - use `Response::json` in `GhApiClient` impl
 - Mark all err types in binstalk-downloader as `non_exhaustive`
 - Ret `remote::Error` in `remote::Certificate::{from_pem, from_der}` instead of `ReqwestError`.
 - Refactor `BinstallError`: Merge variant `Unzip`, `Reqwest` & `Http`
    into one variant `Download`.
 - Manually download and parse json from httos://crates.io/api/v1
 - Remove unused deps `crates_io_api`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-02 18:25:34 +11:00
dependabot[bot]
c00d648dac
Bump jobslot from 0.2.9 to 0.2.10 (#844) 2023-03-02 05:19:38 +00:00
dependabot[bot]
fcbdfcf04f
Bump tokio from 1.25.0 to 1.26.0 (#843) 2023-03-02 03:02:43 +00:00
Jiahao XU
599bcaf333
Impl GhApiClient and use it in cargo-binstall to speedup resolution process (#832)
Fixed #776

 - Add new feature gh-api-client to binstalk-downloader
 - Impl new type `binstalk_downloader::remote::{RequestBuilder, Response}`
 - Impl `binstalk_downloader::gh_api_client::GhApiClient`, exposed if `cfg(feature = "gh-api-client")` and add e2e and unit tests for it
 - Use `binstalk_downloader::gh_api_client::GhApiClient` to speedup `cargo-binstall`
 - Add new option `--github-token` to supply the token for GitHub restful API, or read from env variable `GITHUB_TOKEN` if not present.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-02 12:04:22 +11:00
dependabot[bot]
e13354e8fa
Bump tempfile from 3.3.0 to 3.4.0 (#834) 2023-02-27 03:35:21 +00:00
dependabot[bot]
fd0166e31b
Bump jobslot from 0.2.8 to 0.2.9 (#833) 2023-02-27 03:29:16 +00:00
Jiahao XU
96ebcfd08f
Add new option --locked that is passed through to cargo-install (#830)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-22 22:27:17 +11:00
dependabot[bot]
8f50bab0d8
Bump compact_str from 0.6.1 to 0.7.0 (#825)
Bumps [compact_str](https://github.com/ParkMyCar/compact_str) from 0.6.1 to 0.7.0.
- [Release notes](https://github.com/ParkMyCar/compact_str/releases)
- [Changelog](https://github.com/ParkMyCar/compact_str/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParkMyCar/compact_str/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-22 17:55:18 +11:00
dependabot[bot]
467ba0d854
Bump cargo_toml from 0.15.1 to 0.15.2 (#819)
Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.15.1 to 0.15.2.
- [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags)
- [Commits](https://gitlab.com/crates.rs/cargo_toml/compare/v0.15.1...v0.15.2)

---
updated-dependencies:
- dependency-name: cargo_toml
  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-02-20 14:33:12 +11:00
Jiahao XU
3f0107696b
Enable cross-lang-fat-lto on Linux (#817)
Fixed #806

 - Add new feature flag `cross-lang-fat-lto` and enable it on release for linux
 - Enable `-C linker-plugin-lto` for linux
 - Only use `-Z gcc-ld=lld` on non-windows targets when `cargo-zigbuild` is not enabled

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-19 15:19:35 +11:00
Jiahao XU
2e118b3044
Optimize GhCrateMeta::find: Cache url resolution result (#810)
So that we don't have to create multiple HEAD/GET http request to get
the final, redirected url.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-16 14:51:47 +13:00
Jiahao XU
9874dca454
Fix bin names in .crates.toml on win (#802)
`bins::BinFile::new` does not include `binary_ext` in the
`BinFile::base_name`.

Also add regression e2e-test.

Fixed #801

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 17:24:50 +13:00
dependabot[bot]
30f7722131
Bump once_cell from 1.17.0 to 1.17.1 (#803) 2023-02-15 02:39:44 +00:00
Jiahao XU
04113e9dd9
Rm NOVERSION_FILENAMES "{ name }{ archive-suffix }" (#795)
which does not contain `target`, hence it might report the binary being
available for any target we specified.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-13 13:44:24 +11:00
Jiahao XU
87686cb2f7
Feature: Better retry policy in binstalk-downloader (#794)
Fixed #779 #791 

 - Retry request on timeout
 - Retry for `StatusCode::{REQUEST_TIMEOUT, GATEWAY_TIMEOUT}`
 - Add `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT` for 503/429
   if 503/429 does not give us a header or give us an invalid header on
   when to retry, we would default to
   `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT`.
 - Fix `Client::get_redirected_final_url`: Retry using `GET` on status code 400..405 + 410
 - Rename remote_exists => remote_gettable & support fallback to GET
   if HEAD fails due to status code 400..405 + 410.
 - Improve `Client::get_stream`: Include url & method in the err of the stream returned

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-13 13:43:48 +11:00
github-actions[bot]
166bd05906
release: binstalk v0.8.0 (#787)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-11 00:54:27 +11:00
github-actions[bot]
e03f9e0445
release: binstalk-downloader v0.3.3 (#786)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-11 00:53:59 +11:00
github-actions[bot]
1a4f98085c
release: binstalk-types v0.2.1 (#784)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-02-10 23:06:23 +11:00
figsoda
ff753f06f2
Make disabling static and rustls features possible (#782)
Default features were turned on for binstalk and the `static` and `pkg-config` features of cargo-binstall didn't do anything
2023-02-10 14:01:51 +11:00
Jiahao XU
d9dd611b9e
Improve fmt::Display impl for all Error types (#781)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-10 14:01:22 +11:00
dependabot[bot]
cb56770fac
Bump cargo_toml from 0.14.0 to 0.15.1 (#770) 2023-02-06 02:40:03 +00:00
Jiahao XU
a13c01b769
Replace dep futures-util with helpers::FuturesResolver (#765)
futures-util has too many dependencies and it contains a lot of code of
which we only use `futures_util::stream::{FuturesUnordered, StreamExt}`.

We don't even need most of the functionalities in `FuturesUnordered` as
we just need the output of first future that either returns `Err(_)` or
`Ok(Some(_))`.

So we replace it with ou own homebrew solution (~80 loc) and it's easier
to use.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-05 16:26:25 +11:00