Commit graph

175 commits

Author SHA1 Message Date
dependabot[bot]
b3dc52f6d7
Bump clap from 4.1.9 to 4.1.11 (#927) 2023-03-20 03:39:08 +00:00
dependabot[bot]
bbb4eb7e58
Bump dirs from 4.0.0 to 5.0.0 (#925) 2023-03-20 02:50:04 +00:00
dependabot[bot]
6843f478a9
Bump clap from 4.1.8 to 4.1.9 (#917) 2023-03-17 02:25:23 +00:00
Jiahao XU
58b7044e98
Use install.root in $CARGO_HOME/config.toml (#884)
Fixed #859

* Impl `cargo_config`
* Use `install.root` in `$CARGO_HOME/.cargo/config.toml`
   before fallback to `cargo_home`.
* Improve logging in `get_cargo_roots_path`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-16 11:53:12 +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]
c04b15dbc8
release: cargo-binstall v0.21.3 (#910)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-14 19:30:56 +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
github-actions[bot]
9e3223acf8
release: cargo-binstall v0.21.2 (#904)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-14 00:14:19 +11: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]
5f1d5ce559
release: cargo-binstall v0.21.1 (#899)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-13 15:11:10 +11:00
Félix Saparelli
b29234c93b
Clarify git credential code and fix infinite loop bug (#898)
Fixes #897
2023-03-13 14:40:36 +11:00
dependabot[bot]
fce7141bec
Bump semver from 1.0.16 to 1.0.17 (#895) 2023-03-13 03:13:07 +00:00
github-actions[bot]
ba9fa170c0
release: cargo-binstall v0.21.0 (#893)
Co-authored-by: github-actions <github-actions@github.com>
2023-03-13 12:29:51 +13: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]
c188f85ec9
release: binstalk-manifests v0.4.0 (#888)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-03-12 20:42:10 +11:00
Jiahao XU
00b8a417e6
Update doc for --github-token (#886) 2023-03-11 23:46:14 +11:00
Jiahao XU
3e0d7363a5
Read from env GH_TOKEN for github_token as a fallback (#883)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-11 18:10:40 +11:00
Jiahao XU
c5d0b84aa6
Perform startup/init code eagerly in entry::install_crates (#880)
The startup/init code in `entry::install_crates` performs a lot of blocking operations, from testing if dir exists to reading from files and there is no `.await` in there until after the startup.

There are also a few cases where `block_in_place` should be called (e.g. loading manifests, loading TLS certificates) but is missing.

Most of the `Args` passed to `entry::install_crates` are actually consumed before the first `.await` point, so performing startup/init code eagerly would make the generated future much smaller, reduce codegen and also makes it easier to optimize.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-11 15:06:46 +11:00
dependabot[bot]
174b6c8144
Bump file-format from 0.14.0 to 0.15.0 (#872) 2023-03-07 02:44:31 +00:00
dependabot[bot]
7f00d803f7
Bump gh-token from 0.1.0 to 0.1.1 (#863) 2023-03-06 03:14:41 +00:00
Félix Saparelli
ee909e4045
Rename --roots to --root (with alias for back compat) (#861)
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-06 01:05:32 +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
44ac63ce0d
Extract GitHub token from file if --github-token or env variable GITHUB_TOKEN is not present (#849)
- Add option `--no-discover-github-token` for disabling this behavior
 - Add new dep gh-token v0.1.0 to crates/bin
 - Extract github-token from git-credentials or gh config if `--github-token` or
    environment variable `GITHUB_TOKEN` is not present.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-03 17:32:50 +13: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]
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]
263c836757
Bump clap from 4.1.7 to 4.1.8 (#840) 2023-03-01 02:35:26 +00:00
dependabot[bot]
5b70e41966
Bump clap from 4.1.6 to 4.1.7 (#837) 2023-02-28 04:35:43 +00:00
dependabot[bot]
e13354e8fa
Bump tempfile from 3.3.0 to 3.4.0 (#834) 2023-02-27 03:35:21 +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
Jiahao XU
7bc4d4a5c6
Add opt --root-ceritificates & env BINSTALL_HTTPS_ROOT_CERTS (#820)
for specifying root ceritificates used for https connnections.

And remove old environment variable `CARGO_HTTP_CAINFO`, `SSL_CERT_FILE`
and `SSL_CERT_PATH` to avoid accidentally setting them, especially in CI
env.

Also:
 - Rm fn `binstalk_downloader::Certificate::from_env`
 - Enable feature `env` of dep `clap` in `crates/bin`
 - Add new dep `file-format` v0.14.0 to `crates/bin`
 - Use `file-format` to determine pem/der file format when loading root certs
 - Rm fn `binstalk_downloader::Certificate::open` and enum `binstalk_downloader::OpenCertificateError`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-20 20:48:33 +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
dependabot[bot]
69a1c26951
Bump clap from 4.1.4 to 4.1.6 (#813) 2023-02-16 02:29:06 +00:00
Jiahao XU
89b920a876
Inc default interval in --rate-limit to 10ms (#804)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 19:07:25 +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
9635e05d6c
Support adding root cert via env CARGO_HTTP_CAINFO, SSL_CERT_{FILE, PATH} (#774)
* Support for custom root cert in `binstalk_downloader::remote::Client`
* Support adding root cert via env `CARGO_HTTP_CAINFO`, `SSL_CERT_{FILE, PATH}`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 11:33:59 +13:00
Jiahao XU
3fffe39635
Document environment variable BINSTALL_LOG_LEVEL (#798)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-13 06:26:16 +00:00
Jiahao XU
7c15dd2052
Revert "Read log_level from env CARGO_BINSTALL_LOG_LEVEL if arg not present" (#796)
This reverts commit e84228ba01.
2023-02-13 15:31:15 +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]
1b2fb08bcb
release: cargo-binstall v0.20.1 (#793)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-02-12 15:46:27 +11:00
Jiahao XU
e84228ba01
Read log_level from env CARGO_BINSTALL_LOG_LEVEL if arg not present (#790)
* Enable feature "env" on dep clap in bin
* Read log_level from env `CARGO_BINSTALL_LOG_LEVEL` if arg not present

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-11 14:59:38 +11:00
github-actions[bot]
b408a1a9dd
release: cargo-binstall v0.20.0 (#788)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-02-11 00:56:03 +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]
b8d9a4d649
release: binstalk-manifests v0.3.0 (#785)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-02-10 23:55:41 +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
dependabot[bot]
d34ad5ad1f
Bump tokio from 1.24.2 to 1.25.0 (#749) 2023-01-30 02:20:04 +00: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