Commit graph

88 commits

Author SHA1 Message Date
Dustin Blackman
b14f78b982
feat: Add strategies environment variable (#1555) 2024-01-06 12:39:54 +00:00
Jiahao XU
d76a40bf7d
Rm unnecessary warning msg "Failed to read git credential file" (#1479)
* Rm unnecessary warning msg "Failed to read git credential file"

Fixed #1476

If `gh auth token` executed successfully and binstall obtained a gh
token from it, then there's no reason to issue any warning msg.

Only when binstall cannot read from `.git-credential` and
`gh auth token` failed does binstall need to issue warning.

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

* Fix clippy warning

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

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-11-08 22:06:32 +00:00
Tamir Duberstein
2db8e254bc
Investigate incorrect target detection (#1376)
* detect-targets: add debug tracing

See #1375.

* Add new feature `tracing` & `cli-tracing` to `detect-targets

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

* Fix clippy lints

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-09-23 10:45:44 +00:00
Félix Saparelli
32beba507b
Initial signing support (#1345)
* Add CLI options

* Add manifest types

* Thread signature policy through to fetchers

* Thread signing section through from metadata

* Implement signing validation

* Clippy

* Attempt testing

* Yes and

* Why

* fmt

* Update crates/bin/src/args.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/binstalk-fetchers/src/gh_crate_meta.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/bin/src/args.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/binstalk-fetchers/src/signing.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/binstalk-fetchers/src/signing.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/binstalk-fetchers/src/signing.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update crates/binstalk-fetchers/src/signing.rs

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* fixes

* Finish feature

* Document

* Include all fields in the signing.file template

* Readme document

* Review fixes

* Fail on non-utf8 sig

* Thank goodness for tests

* Run test in ci

* Add rsign2 commands

* Log utf8 error

* Update e2e-tests/signing.sh

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>

* Fix `e2e-tests/signing.sh` MacOS CI failure

Move the tls cert creation into `signing.sh` and sleep for 10s to wait
for https server to start.

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

* Refactor e2e-tests-signing files

 - Use a tempdir generated by `mktemp` for all certificates-related
   files
 - Put other checked-in files into `e2e-tests/signing`

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

* Fixed `e2e-tests-signing` connection err in MacOS CI

Wait for server to start up by trying to connect to it.

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

* Fix `e2e-tests-signing` passing `-subj` to `openssl` on Windows

Use single quote instead of double quote to avoid automatic expansion
from bash

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

* Fix `e2e-tests-signing` waiting for server to startup

Remove `timeout` since it is not supported on MacOS.

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

* Try to fix windows CI by setting `MSYS_NO_PATHCONV=1` on `openssl` cmds

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

* Fixed `e2e-tests-signing` on windows

By using double `//` for the value passed to option `-subj`

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

* Fixed infinite loop in `signing/wait-for-server` on Windows

Pass `--ssl-revoke-best-effort` to prevent schannel from checking ssl
revocation status.

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

* Add cap on retry attempt in `signing/wait-for-server.sh`

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

* Let `singing/server.py` print output to stderr

so that we can see the error message there.

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

* Fix running `signing/server.py` on MacOS CI

use `python3` since macos-latest still has python2 installed and
`python` is a symlink to `python2` there.

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-09-23 04:02:56 +00:00
Jiahao XU
f31db762b4
dep: Bump gix from v0.52.0 => v0.53.1 (#1354)
* dep: Bump gix from v0.52.0 => v0.53.1

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

* Fix `gix` compilation: Enable `gix/max-performance-safe`

without this feature, `ThreadSafeRepository` does not implement `Sync`,
causes the `binstalk-registry` compilation to fail.

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

* Enable `gix/comfort` for progress tracing

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

* Fixed gix progress tracking: Enable `gix/progress-tree`

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

* Rm feature `gix/{comfort, progress-tree}`

Since they do not enable progress support and merely adds bloat.

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

* Fix gix progress logging: Allow logging from simple-git

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

* Re-enable feature `gix/comfort` for more readable logging

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

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-09-14 13:31:00 +00:00
Jiahao XU
3c5641610a
feat: Improve resolution logging and verbose logging (#1341)
* feat: Improve resolution logging

Fixed #1336

Log target of the pre-built binaries which will be installed.

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

* Fix args parsing: `quiet` & `verbose` cannot be set at the same time

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

* feat: Implies `--log-level debug` if `--verbose` is set

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

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-09-02 09:38:24 +00:00
Jiahao XU
8a08cdda6f
Fix GitHub token auto discovery (#1335)
* Fix GitHub token auto discovery

Fixed #1333

 - Rm dep `gh-token` since it is broken and we can simply run
   `gh auth token` in `cargo-binstall` instead.
 - binstalk-downloader: Make sure GitHub token is at least 40B long
   and other than the `_`, composes of only alphanumeric characters.
 - Warn on failure to read `git/credential` files
 - Optimize `try_from_home` to avoid heap allocation of `PathBuf`

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

* Fix typo and clippy

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

* Simplify `is_valid_gh_token` & `is_ascii_alphanumeric` impl

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

* Improve err msg in `get_inner`

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

* Improve err msg of `cargo_binstall::gh_token::get`

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

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-09-01 01:14:59 +00:00
Jiahao XU
43973d7e86
Refactor cargo-binstall (#1302)
- Move implementation of `main` into the library part of
   `cargo-binstall` to speedup codegen.
 - Move  `manifests.rs` into `binstalk-manifests`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-18 01:59:48 +00:00
Jiahao XU
0c5a65fb35
Refactor: Extract new crate binstalk-bins (#1294)
To reduce `binstalk` codegen and enable reuse of it.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-15 21:48:42 +00:00
Jiahao XU
76c72469eb
Refactor: Extract new crate binstalk-fetchers (#1291)
To reduce `binstalk` codegen and enable better reuse.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-14 03:20:34 +00:00
Jiahao XU
623f7ff4ed
Refactor: Extract new crate binstalk-registry (#1289)
To speedup codegen of `binstalk` and enable it to be reused.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-13 07:16:53 +00:00
Jiahao XU
2375ba48b6
Refactor to reduce compilation time (#1284)
- Make `binstalk::bins` private.
 - Move mod `signal` into `crates/bin`
 - Make items in `crates/bin/src/lib.rs` private if possible to reduce
   its API generation time.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 14:25:41 +00:00
Jiahao XU
ef99dd795f
Refactor: Extract mod fs as crate atomic-file-install (#1286)
Refactor: Extract mod `fs` as crate `atomic-install`

To speedup codegen of `binstalk` and also publish a new crate that could
be reused.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 13:24:26 +00:00
Jiahao XU
8ff13c1b36
Refactor: Extract cargo_toml_workspace as a new crate (#1287)
To reduce codegen time of `binstalk` and also enable others to reuse
this crate.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 12:05:10 +00:00
Jiahao XU
3e80b12748
feat: Verify cksum of crate tarball from cargo registry (#1260)
Fixed #1183

Since the crate tarball could be downloaded from a different set of
servers than where the cargo registry is hosted, verifying the checksum
is necessary to verify its integrity.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-09 10:57:47 +00:00
Jiahao XU
7f1ddd1dd7
Reduce public interface of binstalk (#1265)
To reduce amount of breaking changes.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-09 07:46:12 +00:00
Jiahao XU
a9e2ef11f1
Fix reading env CARGO_REGISTRIES_{registry_name}_INDEX (#1258)
Try bogth original and upper-case version.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-09 07:41:20 +00:00
Jiahao XU
435df675b3
Fix too many 429 response (#1231)
Fixed #1229

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-08 00:53:15 +00:00
Jiahao XU
47f79a9660
Fix loading .cargo/config.toml (#1217)
Fixed #1216

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-19 02:15:57 +00:00
Jiahao XU
0c5b7f115d
feat: Support --verbose --version/-vV (#1182)
that provides more information:

```
cargo-binstall: 1.0.0
build-date: 2023-07-18
build-target: aarch64-apple-darwin
build-features: default,fancy_no_backtrace,git,rustls,static,trust_dns,zstd_thin
build-commit-hash: 39d8cfc07f2253080ce997e620406c2994dced25
build-commit-date: 2023-07-18
rustc-version: 1.71.0
rustc-commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
rustc-llvm-version: 16.0
```

Fixed #627

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-18 05:22:41 +00: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
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
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
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
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
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
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
Jiahao XU
5683ca2476
Add new crate leon-macros that provide template! with identical syntax as runtime parsing (#946)
`leon_macros::template!` can parse template at compile-time.
It accepts a utf-8 string literal and uses `leon` internally to parse it, then generate code that evaluates to `Template<'static>`.

 - Exclude fuzz from crate leon when publishing
 - Impl fn-like proc-macro `leon_macros::template!`
 - Add dep `leon-macros` to binstalk
 - Use `leon_macros::template!` in `binstalk::fetchers::gh_crate_meta::hosting`
 - Add doc for `leon-macros` in `leon`
 - Improve `std::fmt::Display` impl for `leon::ParseError`
 - Fixed broken infra link in leon

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-17 14:50:58 +10:00
Jiahao XU
b69d8c25cb
Enable --no-symlinks by default and fix sccache installation (#936)
Partially resolve #731

Using symlinks not only add unnecessary bloat to users' `$CARGO_HOME/bin` directory, but it actually breaks `sccache`, which inspects its binary name and decides how to act on.

For `sccache` to function, it must be invoked directly or use a hard link.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-22 21:58:37 +11: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
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
Félix Saparelli
b29234c93b
Clarify git credential code and fix infinite loop bug (#898)
Fixes #897
2023-03-13 14:40:36 +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
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
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
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
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
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
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
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