Commit graph

516 commits

Author SHA1 Message Date
Sebastian Thiel
5acfda9379
avoid worktree checkouts (#1207)
* perform a bare git cloen to avoid worktree checkouts

This will be way faster on windows

* feat: use the git repository directly to obtain crate information

* Apply code review changes

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

* Impl `fmt::Display` for `helpers::git::GitUrl`

and also refactor implementation of `git::Repository::{shallow_clone,
shallow_clone_bare}`.

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

* Fix clippy lint warnings

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

* Fix typo

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

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-17 15:46:12 +00:00
dependabot[bot]
9af17de9c3
build(deps): update file-format requirement from 0.17.0 to 0.18.0 in /crates/bin (#1205)
build(deps): update file-format requirement in /crates/bin

Updates the requirements on [file-format](https://github.com/mmalecot/file-format) to permit the latest version.
- [Release notes](https://github.com/mmalecot/file-format/releases)
- [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mmalecot/file-format/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: file-format
  dependency-type: direct:production
...

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>
2023-07-17 14:51:46 +10:00
Jiahao XU
ad58573143
feat: Read --rate-limit from env BINSTALL_RATE_LIMIT as a fallback (#1201)
feat: Scrap `--rate-limit` from env `BINSTALL_RATE_LIMIT` as a fallback

and set `BINSTALL_RATE_LIMIT` to `100/1` on CI.

Fixed #1196

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-17 13:07:15 +10:00
Jiahao XU
963e9e97ad
Use reflink_copy::reflink_or_copy in fs::atomic_install* (#1197)
to speedup copy operation `atomic_install*`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-17 11:56:10 +10:00
Jiahao XU
d1fe5c7155
Fix clippy warning in binstalk_downloader (#1204)
Replace use of `PhantomData::default()` in `src/download.rs` with
`PhantomData` since it is a unit struct.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-16 13:50:04 +10:00
Jiahao XU
65670224b8
Simplify args::parse using clap::Arg::conflicts_with (#1198)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-11 13:20:51 +00:00
Jiahao XU
9d4694219b
speedup git shallow cloning: Enable gix/max-performance (#1186)
for targets:
 - x86_64-apple-darwin
 - aarch64-apple-darwin
 - x86_64-unknown-linux-gnu
 - x86_64-unknown-linux-musl

which will use `zlib-ng` to speedup decompression and use assembly
version for sha1 checksum calculation on supported CPU.

Also enable feature `zlib-ng` on windows and
 - aarch64-unknown-linux-gnu
 - aarch64-unknown-linux-musl

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-10 06:18:15 +00:00
Jiahao XU
7dea40a99a
Support --registry and more options from .cargo/config.toml (#1195)
Fixed #885

Now we can take advantage of new argument `--registry` and
env overrides:
 - `CARGO_REGISTRIES_DEFAULT` if `--registry` is not specified
 - `CARGO_REGISTRIES_{registry_name}_INDEX` for the registry index url

We can also read from `.cargo/config.toml` for:
 - default registry and registries configurations
 - additional CA bundle `http.cainfo`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-10 03:37:41 +00:00
Jiahao XU
c4b6921314
fix binstalk_downloader::GhApiClient json deser error (#1193)
When installing `cargo-expand` v1.0.59, I got an error message:

```
Failed to parse http response body as Json: invalid type: null, expected a string at line
1 column 90
```

This is because `GraphQLPageInfo::end_cursor` can actually be `null`, so
I change its type to `Option<CompactString>`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-09 10:39:18 +00:00
Jiahao XU
0813e80438
Fix GPL-3.0 license identifier (#1192)
Fixed #1189

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-07 07:24:05 +00:00
Jiahao XU
01a87ac606
feat: Impl support for alternative registries (#1184)
Fixed #1168

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-30 03:52:40 +00:00
dependabot[bot]
59c0d5dea9
build(deps): update gix requirement from 0.47.0 to 0.48.0 in /crates/binstalk (#1185)
build(deps): update gix requirement in /crates/binstalk

Updates the requirements on [gix](https://github.com/Byron/gitoxide) to permit the latest version.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.47.0...gix-v0.48.0)

---
updated-dependencies:
- dependency-name: gix
  dependency-type: direct:production
...

 - Also updated other dependencies to latest compatible version.

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>
2023-06-29 12:52:48 +00:00
github-actions[bot]
f231f93976
release: cargo-binstall v1.0.0 (#1179)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-27 03:42:37 +00:00
github-actions[bot]
d2e4fef060
release: binstalk v0.13.0 (#1178)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-27 01:52:53 +00:00
github-actions[bot]
583860fbc6
release: binstalk-downloader v0.6.0 (#1177)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 14:17:53 +00:00
github-actions[bot]
beb826e6ae
release: binstalk-manifests v0.6.0 (#1176)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 13:44:34 +00:00
github-actions[bot]
c816f33ac0
release: binstalk-types v0.5.0 (#1175)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 12:27:56 +00:00
github-actions[bot]
ff7867a6a6
release: detect-targets v0.1.8 (#1174)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 10:23:31 +00:00
github-actions[bot]
c917f94f28
release: normalize-path v0.2.1 (#1173)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 08:22:39 +00:00
github-actions[bot]
88c7df6ea0
release: leon v2.0.1 (#1172)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 05:10:30 +00:00
Jiahao XU
ca00cbaccc
feat: Support install directly from git repo (#1162)
Fixed #3

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-24 01:01:31 +00:00
dependabot[bot]
dd35fba232
build(deps): update itertools requirement from 0.10.5 to 0.11.0 in /crates/binstalk (#1163)
build(deps): update itertools requirement in /crates/binstalk

Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.11.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
...

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>
2023-06-23 04:24:08 +00:00
Jiahao XU
138112cd6e
Optimize TargetTriple: Use Cow<'static, str> (#1161)
instead of `CompactString` since `target_lexicon::{OperatingSystem,
Architecture, Environment}::into_str()` will return a `&'static str`
most of the time.

Also updated `SUPPORT.md`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-21 10:05:19 +00:00
Jiahao XU
d8419ea5a2
feat: Add more variables for template (#1160)
Fixed #775

 - Add dep target-lexicon v0.12.7
 - Add `target-{family, arch, libc, vendor}` to
   `package.metadata.binstall`.

For `{universal, universal2}-apple-darwin`, the `target-arch` is set to
`universal`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-20 22:05:13 +00:00
Jiahao XU
181b5293e7
dep: Bump strum v0.24.1 => v0.25.0 (#1159)
Also bump strum_macros v0.24.3 => v0.25.0

[strum and strum_macros v0.25.0 changelog][1]

[1]: https://github.com/Peternator7/strum/blob/master/CHANGELOG.md

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-20 00:16:10 +00:00
Jiahao XU
40efe02e34
fix leon & binstalk-downloader bug relating to features (#1153)
- ci: Check feat powerset of leon & binstalk-downloader in `ci.yml`
 - fix leon feature `cli`: Enable dep `miette` in feature `cli`
 - fix binstalk-downloader when default feature is disabled and no other
   tls related feature is enabled (breaking change due to replace of
   `tls::Version` with newtype `TLSVersion`).

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-19 02:22:09 +00:00
Félix Saparelli
a255e74fc9
Show license and source in long help (#1149)
* Show license and source in long help

Ref https://github.com/oeb25/binswap/issues/2

* Typo
2023-06-17 10:16:25 +00:00
Jiahao XU
6b5384608e
GhApiClient misc improvements (#1139)
- Increase `DEFAULT_RETRY_DURATION` to 5 minutes, since GitHub enforces
   rate limit on an hourly basis.
 - Refactor `check_for_status` & `fetch_release_artifacts_restful_api`
 - Optimize `percent_decode_http_url_path`: Avoid `percent_decode_str`
   if there is no `%` in the `input`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-07 01:02:29 +00:00
dependabot[bot]
abf5a8e842
build(deps): bump file-format from 0.16.0 to 0.17.0 (#1135)
Bumps [file-format](https://github.com/mmalecot/file-format) from 0.16.0 to 0.17.0.
- [Release notes](https://github.com/mmalecot/file-format/releases)
- [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mmalecot/file-format/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: file-format
  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-06-06 02:47:25 +00:00
dependabot[bot]
3cf2528273
build(deps): bump windows-sys from 0.42.0 to 0.48.0 (#1125)
Bumps [windows-sys](https://github.com/microsoft/windows-rs) from 0.42.0 to 0.48.0.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.42.0...0.48.0)

---
updated-dependencies:
- dependency-name: windows-sys
  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-06-05 04:06:58 +00:00
dependabot[bot]
bf46862140
build(deps): bump once_cell from 1.17.2 to 1.18.0 (#1127)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.2 to 1.18.0.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.2...v1.18.0)

---
updated-dependencies:
- dependency-name: once_cell
  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-06-05 02:29:41 +00:00
Jiahao XU
22b3419fce
feat: Add GraphQL support to GhApiClient (#1124)
Fixed #868

 - Add new fn `remote::Client::post`
 - Add new fn `remote::RequestBuilder::body`
 - Re-export `reqwest::Body` in `remote`
 - Add dep percent-encoding v2.2.0 to binstalk-downloader
 - Add dep serde-tuple-vec-map v1.0.1 to binstalk-downloader
 - Add GraphQL to `GhApiClient`, fallback to Restful API if token is not
   provided or authorization failed.
 - Fixed `GhReleaseArtifact::try_extract_artifact_from_str`: decode
   percent encoded http url path and add regression tests
 - Added variant `GhApiError::Context` & `GhApiContextError`
 - Added variant `GhApiError::GraphQLErrors` & `GhGraphQLErrors`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-04 14:09:49 +00:00
Jiahao XU
e87e3534a8
detect-targets: Add fallback to windows (#650)
Fixed #642

* Add new dep windows-sys v0.42.0 for win only
* Add new dep windows-dll v0.4.1 for win only
* Add x86_64 fallback targets for windows
* Add x86 fallback targets for windows
* Add arm32 fallback targets for windows
* Add arm64 fallback targets for windows
* Add gnu/gnu-llvm fallback targets for windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-04 03:58:05 +00:00
Jiahao XU
2acba14b41
GhApiClient: Fallback to unauthorized mode if auth token is invalid (#1121)
Fixed #850

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-04 02:29:42 +00:00
Jiahao XU
1432093dcc
feat: Add new cmdline option --no-track (#1111)
Same as `cargo-install`'s `--no-track`.
It is also passed to `cargo-install` if it is invoked.

Also fixed `fs::atomic_symlink_file` which on Windows could fallback to
non-atomic install if symlinking failed.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-03 09:15:18 +00:00
dependabot[bot]
f1bfe23672
Bump cargo_toml from 0.15.2 to 0.15.3 (#1116)
Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.15.2 to 0.15.3.
- [Commits](https://gitlab.com/crates.rs/cargo_toml/compare/v0.15.2...v0.15.3)

---
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-06-02 04:40:31 +00:00
dependabot[bot]
92fdefbc9e
Bump fs4 from 0.6.4 to 0.6.5 (#1112)
Bumps [fs4](https://github.com/al8n/fs4-rs) from 0.6.4 to 0.6.5.
- [Commits](https://github.com/al8n/fs4-rs/commits)

---
updated-dependencies:
- dependency-name: fs4
  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-06-01 04:02:01 +00:00
dependabot[bot]
e789064289
Bump once_cell from 1.17.1 to 1.17.2 (#1106)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.1 to 1.17.2.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.1...v1.17.2)

---
updated-dependencies:
- dependency-name: once_cell
  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-05-30 04:06:18 +00:00
dependabot[bot]
02ca4b6e12
Bump log from 0.4.17 to 0.4.18 (#1103)
Bumps [log](https://github.com/rust-lang/log) from 0.4.17 to 0.4.18.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.17...0.4.18)

---
updated-dependencies:
- dependency-name: log
  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-05-29 04:22:23 +00:00
dependabot[bot]
f3c665a313
Bump syn from 2.0.16 to 2.0.18 (#1104)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.16 to 2.0.18.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.16...2.0.18)

---
updated-dependencies:
- dependency-name: syn
  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-05-29 04:22:16 +00:00
dependabot[bot]
b23598ed85
Bump tokio from 1.28.1 to 1.28.2 (#1100)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2)

---
updated-dependencies:
- dependency-name: tokio
  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-05-29 03:02:20 +00:00
github-actions[bot]
39748ecadf
release: binstalk-downloader v0.5.1 (#1095)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-05-26 16:06:51 +00:00
github-actions[bot]
62ca508e89
release: cargo-binstall v0.23.1 (#1097)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-05-26 15:57:45 +00:00
github-actions[bot]
47dbc99555
release: binstalk v0.12.1 (#1096)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-05-26 15:47:43 +00:00
dependabot[bot]
201ae15311
Bump quote from 1.0.27 to 1.0.28 (#1093)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.27 to 1.0.28.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28)

---
updated-dependencies:
- dependency-name: quote
  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-05-26 04:33:00 +00:00
dependabot[bot]
a61f45fb63
Bump proc-macro2 from 1.0.58 to 1.0.59 (#1092)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.58 to 1.0.59.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.58...1.0.59)

---
updated-dependencies:
- dependency-name: proc-macro2
  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-05-26 02:20:14 +00:00
Jiahao XU
e96477a116
Optimize fetch_crate_cratesio for exact version (#1089)
If `version_req` requests a specific version instead of a range, then
there is no need to pull all versions available from
https://crates.io/api/v1/crates

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-05-25 12:56:31 +00:00
Jiahao XU
f8255b1b81
dep: Downgrade tracing from v0.1.38 => v0.1.37 due to yanking (#1085)
Fixed #1019

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-05-24 14:27:05 +00:00
dependabot[bot]
306f5d7e3d
Bump toml_edit from 0.19.9 to 0.19.10 (#1084)
Bumps [toml_edit](https://github.com/toml-rs/toml) from 0.19.9 to 0.19.10.
- [Commits](https://github.com/toml-rs/toml/compare/v0.19.9...v0.19.10)

---
updated-dependencies:
- dependency-name: toml_edit
  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-05-24 02:29:53 +00:00
dependabot[bot]
d2f792ffae
Bump clap from 4.2.7 to 4.3.0 (#1076)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.7 to 4.3.0.
- [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.2.7...clap_complete-v4.3.0)

---
updated-dependencies:
- dependency-name: clap
  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-05-22 02:35:41 +00:00