Commit graph

151 commits

Author SHA1 Message Date
Jiahao XU
fc6d9ab956
Refactor: Extract new crate binstalk-manifests (#511)
* Refactor: Extract new crate binstalk-manifests
* Fix clippy warning in mod `binstall_crates_v1`
* Rm unused deps in binstalk
* Update release-pr

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-08 00:50:02 +00:00
dependabot[bot]
25a4ceb050
Bump mathieudutour/github-tag-action from 6.0 to 6.1 (#502)
Bumps [mathieudutour/github-tag-action](https://github.com/mathieudutour/github-tag-action) from 6.0 to 6.1.
- [Release notes](https://github.com/mathieudutour/github-tag-action/releases)
- [Commits](https://github.com/mathieudutour/github-tag-action/compare/v6.0...v6.1)

---
updated-dependencies:
- dependency-name: mathieudutour/github-tag-action
  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>
2022-10-31 02:30:40 +00:00
Jiahao XU
0ac27bbb1d
Re enable CARGO_UNSTABLE_SPARSE_REGISTRY (#504)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-10-28 01:02:28 +00:00
dependabot[bot]
24aa099320
Bump cargo_toml from 0.12.4 to 0.13.0 (#486)
Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.12.4 to 0.13.0.
- [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags)
- [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/master)

---
updated-dependencies:
- dependency-name: cargo_toml
  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>
2022-10-18 02:55:54 +00:00
Jiahao XU
98b62251ad
Fix unit test & integration CI and the release CI (#469)
* Fix integration test: Make sure `cargo build cargo-binstall` would not fail due to binary already present
* Disable feature `zlib-ng` for release build
* Disable build-std for release build on aarch64-unknown-linux-gnu
* Fix clippy warning in unit test CI
* Fix compile-settings.jq
* Fix caching: Rm `restores-keys`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-10-08 20:26:46 +13:00
Jiahao XU
ec2bdb551e
Use CARGO env variable if present (#453)
* Run `$CARGO -vV` in `detect-targets` if env `CARGO` present
* Improve crate doc for `detect-targets`
* Use env var `CARGO` in `install_from_source` if present
* Test use of `CARGO` env in `tests.sh`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-10-02 04:52:25 +13:00
Jiahao XU
f482e362ba
Make binaries with required-features optional (#438)
* Make binaries with `required-features` optional so that crates like `sccache` would work as expected.
* Fix `infer_bin_dir_template`: concat with `data.bin_path` introduced in #417 
* Always `chmod +x $bin` on unix in case the archive (e.g. `sccache`) did not set the executable bit of fmt == Bin.
* CI: Install `sccache` but do not run it since it requires cargo env to be ready

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-28 13:46:55 +10:00
Jiahao XU
4ba1e221ea
Improve auto discover (#433)
* Add new field `gh_crate_meta::Context::archive_suffix`
* Support `archive_suffix = ""` for unix
* Use `archive-suffix` in `FULL_FILENAMES` & `NOVERSION_FILENAMES` to support `PkgFmt::Bin`
* Simplify `PkgFmt::extensions`
* Fix `default_bin_dir_template` in `infer_bin_dir_template`: Fix typo `archive_suffix`
* Test `default_bin_dir_template` in CI
* Fix installation of `PkgFmt::Bin`: `chmod +x $bin` on unix if fmt == Bin
* Add miniserve to `.github/scripts/tests.sh`
* Update `SUPPORT.md`
* Add github-test-Cargo2.toml to test Github pkg-url with bin-dir provided
* Avoid allocation on processing `path_normalized` in `BinFile::from_product`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-28 02:52:14 +00:00
Jiahao XU
e034d69e12
Impl try multiple default bin dirs (#417)
From @passcod :

* Make bin-dir an Option
* Use cargo-release as a test case
* WIP: Try multiple default bin dirs
* Update bins.rs
* Update cargo_toml_binstall.rs

From @NobodyXu :
* Optimize & Prepare for support multi `bin-path`s
* Ensure quickinstall bin_dir work as usual.
* Rm dup entries in `FULL_FILENAMES`
* Add second version of `NOVERSION_FILENAMES`
* Impl multiple default `bin-dir`s
* Improve doc for `BinFile::from_product`
* Fix tests.sh

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
2022-09-26 01:15:20 +13:00
Jiahao XU
ae9f536400
Fix/dep cargo_toml: Bump to v0.12.1 (#418)
* Fix `cargo_toml`: Bump dep to v0.12.1
* Test `cargo-watch` in CI
* Fix `*-test-Cargo.toml` used in integration tests

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-25 16:01:57 +13:00
Jiahao XU
1a1310f98b
Enable dependabot for Cargo.lock (#399)
* Enable dependabot for `Cargo.lock`
* Fix dependabot for fs-lock & detect-targets

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-22 15:59:25 +12:00
Jiahao XU
7ac55c46f1
Add new feature log_release_max_level_debug and enable it on CI release build (#390)
* Add new feature `log_release_max_level_debug`
* Fix calculation of `log_level` in `logging`
* Enable feature log_release_max_level_debug on CI release build

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-17 09:22:19 +00:00
Félix Saparelli
9372ea4e53
Fix release script (#368) 2022-09-10 23:59:41 +12:00
Félix Saparelli
b89a4a56b8
Fix (remove) escaping for release blurb in release-pr template (#367) 2022-09-10 23:46:15 +12:00
github-actions[bot]
037e62184f
release: cargo-binstall v0.13.0 (#366)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
2022-09-10 11:07:41 +00:00
Félix Saparelli
be8e83b8bd
Update release-pr config (#364) 2022-09-10 06:56:33 +00:00
Félix Saparelli
e25aa50ec9
Rename lib to binstalk (#361) 2022-09-10 16:44:18 +10:00
Félix Saparelli
e24b2ce1e3
Disable zlib-ng for the default cargo-install build (#354)
but explicitly enable it in our own builds.

This is because using zlib-ng sometimes does not compile easily on Windows,
and using the pure miniz_oxide offers a better install story from source.

For our binary builds, we can provide the optimal performance, and still
do that for most users as they will update with cargo-binstall, getting our
build as a second pass.
2022-09-09 18:06:05 +12:00
Jiahao XU
23daef610b
Fix .github/scripts/tests.sh: Fix testing for ugprading (#352)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-07 18:46:25 +10:00
Félix Saparelli
bcec382a64
Improve release-pr usage (#350) 2022-09-07 17:40:46 +10:00
Félix Saparelli
4885cfbb88
Add important usage note for triggering builds to release template (#345) 2022-09-05 04:47:20 +00:00
Félix Saparelli
db82c6935f
Deprecate --secure, enforce HTTPS (#343)
Resolves #124
2022-09-05 14:18:14 +10:00
Félix Saparelli
a628cbf876
Rename flock to fs-lock (#338) 2022-09-04 15:28:22 +00:00
Félix Saparelli
3387a63895
Fix release PR template (#336) 2022-09-04 15:19:17 +00:00
Félix Saparelli
e21617cc9e
Adapt release workflow for workspace (#331)
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-09-04 11:12:10 +00:00
Félix Saparelli
280bc974eb
Use release PR action (#330) 2022-09-04 09:38:08 +00:00
Jiahao XU
e39a02aa92
Test default pkg-url for GitLab and BitBucket (#322)
* Test default `pkt-url` for GitLab and BitBucket
* Fail if `cargo-build` is called when testing GitLab/BitBucket
* Fix use of `remote_exists` in `GhCrateMeta::launch_baseline_find_tasks`
   
   If `Method::HEAD` fails, try `Method::GET` since some servers reject
   `Method::HEAD`, e.g. bbuseruploads.s3.amazonaws.com

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-27 10:45:55 +00:00
Jiahao XU
4def4d08fd
Add new feature trust-dns to lib & bin (#318)
* Add new feature `trust-dns` to lib & bin
* Enable `trust-dns` feature by default
   Because the `getaddrinfo` is a poorly designed API.
* USe default feature set on windows CI
   because wintls on the CI does not support TLS 1.3 and trust-dns only
   support dns over https if rustls is used.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-25 12:01:22 +12:00
Jiahao XU
62f9450d2d
Refactor: Extract new crate detect-targets and improve code quality (#307)
* Refactor: Extract new crate `detect-targets`

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

* Refactor: Extract new mod `detect` for `detect-targets`

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

* Refactor: Extract `desired_targets` in crate `detect-targets`

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

* Refactor: Extract `detect::linux` in crate `detect-targets`

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

* Refactor: Extract `detect::macos` in crate `detect-targets`

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

* Refactor: Extract `detect::windows` in crate `detect-targets`

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

* Add new dep cfg-if v1.0.0 for `detect-targets`

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

* Refactor: Simplify mod declaration in `detect` using `cfg_if!`

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

* Refactor: Simplify `detect_targets` using `cfg_if!`

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

* Add crate doc for `detect-targets`

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

* Enable feature "macros" of tokio in `detect-targets`

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

* Enable feature "io-util" of dep tokio

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

* Rm unused feature "io-util" & "macros" of dep tokio

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

* Set stdin & stderr to null in `get_target_from_rustc`

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

* Improve doc of `get_desired_targets`

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

* Improve `detect_targets_linux`: Run `ldd` with stdin set to null

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

* Fix potential panic in `windows::detect_alternative_targets`

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

* FIx fmt of `detect_targets_linux`

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

* Do not re-export dep `detect-targets` in `crates/lib`

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

* Fix typo in crate doc for `detect-targets`

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

* Enable feature "macros" of tokio in dev mode

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

* Add example to crate doc of `detect-targets`

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

* Improve API `get_desired_targets`: Take `Option<&str>`

instead of `&Option<String>`

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

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-21 22:21:33 +10:00
Jiahao XU
1102284684
Fix clippy warnings and add new workflow clippy (#306)
* Derive `Eq` for `PkgFmt`, `PkgFmtDecomposed` & `TarBasedFmt`
* Derive `Eq` for `PkgMeta`, `PkgOverride` & `BinMeta`
* Rm unnecessary reborrow in `install_from_source`
* Rm unnecessary `into()` in `args::parse`
* Fix `clippy` warning in `CratesToml::append_to_path`
* Fix clippy warning in `cratesio_url`
* Fix clippy warning in `detect_targets_linux`
* Add `clippy` and `rustfmt` to workflow `unit-test`

Because `clippy` would not check inactive code disabled by `cfg`, so we
have to also run `clippy` on multiple targets.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-21 02:40:50 +12:00
dependabot[bot]
88ddcf3599
Bump softprops/action-gh-release (#302)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-20 11:56:29 +00:00
dependabot[bot]
df3a8e21c7
Bump actions/checkout from 2 to 3 (#303)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-20 11:44:52 +00:00
Félix Saparelli
4b00f5f143
Split crates and clean up structure of codebase (#294)
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-20 11:24:12 +00:00
Félix Saparelli
68d3ab56f7
Enable sparse registry in CI (#285) 2022-08-06 22:07:24 +12:00
Jiahao XU
140d3df8bd
Fix integration test: Set CARGO_HOME instead of rm -rf $HOME/.cargo
The later would also delete the cmd `cargo`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:40:58 +10:00
Jiahao XU
cc92c2c4b6
Rm $HOME/.cargo to test cargo-binstall
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-08-04 17:29:19 +10:00
Jiahao XU
9e5ff25be8
Fix release build: Set RUSTFLAGS to link with libgcc statically
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-31 13:40:17 +10:00
Jiahao XU
af3b87df7a
Fix releasae build: Install rust-src for release
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
7a7220b1a2
Fix build: Rm unnecessary env.TOOLCHAIN
Since we build it using +nightly anyway.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:18 +10:00
Jiahao XU
98d8a96a02
Use build-std feature for release build to reduce binary size
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-30 16:20:17 +10:00
Félix Saparelli
ac995798ef
Split features and build args handling in build (#257) 2022-07-30 17:27:49 +12:00
Jiahao XU
77396d45bd
Fix release build for win: Enable fancy-no-backtrace
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-25 17:46:59 +10:00
Félix Saparelli
51b300d29e
Fixes for the CI (#242) 2022-07-24 20:33:56 +12:00
Félix Saparelli
310c07d9c8
Reconfigure CI cache with fallbacks (#240) 2022-07-24 16:10:43 +12:00
Félix Saparelli
ef2752cd42
Stop using actions-rs (#239) 2022-07-24 15:37:41 +12:00
Félix Saparelli
88b9aceb01
Fix the instructions for publish on the release PR (#237) 2022-07-24 14:32:37 +12:00
Jiahao XU
e857a88426
Add back target aarch64-unknown-linux-gnu
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-23 22:51:46 +10:00
Jiahao XU
e3a5ca2991
Add back target armv7-unknown-linux-gnueabihf
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-23 22:50:57 +10:00
Jiahao XU
18e0730afb
Disable static and zlib-ng on cross compilation
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-23 22:42:06 +10:00
Jiahao XU
b33a606109
Use native-tls for x86_64-pc-windows-msvc on release
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-23 22:41:41 +10:00