Commit graph

31 commits

Author SHA1 Message Date
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
b69c082160
ci: Switch to Swatinem/rust-cache@v2 (#1113)
Fixed #1038

sccache is not very effective at caching dependencies, the external
C/C++ is recompiled in every ci and it takes a lot of time.

Compilation of other Rust dependencies also takes quite some time and
sccache is not helping at all, so I decided to switch to
`Swatinem/rust-cache@v2`.

The downside of the new caching method is that a new cache conntaining
part of the `.cargo/` and `target/` will be created whenver
`Cargo.lock`/`Cargo.toml` changes, but it can still reuse the old cache
to create new caching.

This is acceptable given that `sccache` often fails to reuse
cache due to rate limiting from GHA, since it is not designed for use
like a s3 object pool, and `sccache` will create a lot of new cache
artifacts for a given branch that cannot be reused in main and would
have to cleanup via a cronjob.

Edit:

rust 1.70 uses llvm 16.0, however ubuntu-latest still uses llvm 15.0
As such, during release-build, cross-lang-lto failed due to llvm is too
old.

Temporarily disable linker-plugin-lto to fix this.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-02 04:03:29 +00:00
Jiahao XU
e79bb2ab10
Include cargo-timings report in release build (#1110)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-01 03:58:11 +00:00
Jiahao XU
b1b4394d80
Add & Enable new feat log_max_level_debug to speedup debug build (#1016)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-26 23:06:16 +10:00
Jiahao XU
6516805f10
Speedup release-build.yml: Do not run unit-tests (#1015)
`cargo-test` cannot share its artifacts with `cargo-build` and vice
versa, plus running `e2e-tests` in release build is enough to find out
potential miscompilation.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-26 19:57:48 +10:00
Jiahao XU
c65e1269a0
Test building doc in ci.yml/lint (#999) 2023-04-25 07:48:44 +10:00
Jiahao XU
0261d12d9d
Support subcrate in repo (#991)
Fixed #838

 - Add new key `subcrate` for rendering `pkg-url`
 - Add new release paths in GitHub, GitLab & SourceForge using key `subcrate` for auto-detection
 - Add subcrate detection for GitHub and GitLab
 - Add `debug!` when using gh api token in `GhApiClient::new`
 - Add subcrate testing to `e2e-tests/subcrate.sh`
 - Bump cargo-release to 0.24.9 in e2e-tests/live.sh
   to fix test failure on MacOS without libssl installed in `/usr/local/`.
 - Optimize GhCrateMeta: Detect subcrate and repo-host in `Data::get_repo_info`
    to cache the result and avoid duplicate works, this also makes the code
    more ergonomic by removing the need to some `unwrap()` plus making it
    more efficient since we don't need to clone the url just to modify it.
 - Add instrument to `Data::get_repo_info`
 - Fix `shellcheck` err in `e2e-tests/*.sh`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-24 19:41:20 +10:00
Jiahao XU
f134df548d
Optimize release-build.yml: Avoid building benchmark dependencies (#981)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-06 16:19:15 +10:00
Jiahao XU
f384088fd1
Avoid checking dev-deps for jobs *-check and lint in workflow ci.yml (#978)
Avoid checking dev-deps for jobs `*-check` and lint in workflow `ci.yml`

We just want to make sure cargo-binstall can compile for the target, we
don't want to pull in the extra dependencies.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-04 01:51:13 +10:00
Jiahao XU
18bc81f46f
Use cargo-auditable for release build (#878)
to make the pre-built artifacts auditable by `cargo-audit` and other
tools.

* Add new env `JUST_USE_AUDITABLE` to enable use of `cargo-auditable`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-11 15:57:14 +13:00
Jiahao XU
9c617c2f8a
Enable only feature cross-lang-fat-lto on MacOS (#876) 2023-03-10 22:08:54 +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
c8b92b1985
Speedup CI (#842)
- Remove `tools: cross` input to `actions/just-setup`
    since we use `cargo-zigbuild` for cross compiling instead of `cross-rs`
    now.
 - Only install `cargo-zigbuild` in `just ci-install-deps` if `JUST_USE_CARGO_ZIGBUILD` is enabled
 - Include hash of `rustc -vV` in `build-cache`
    Switching between different versions of `rustc` will cause all crates to be
    rebuilt using new `rustc`.
 - Replace input `cache` with `index-cache` and `build-cache` in `actions/just-setup`
    for better control of caching behavior
 -  Reuse workflow `test`'s `build-cache` in workflow `lint`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-02 13:09:25 +11:00
Jiahao XU
af6dc61f3d
Disable --icf=safe on MacOS (#839)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-01 03:32:40 +13:00
Jiahao XU
2bf70b6a01
Run e2e test for release build and fix it by switching back to stable (#818)
* Run e2e-tests for release build
* Print `RUSTFLAGS` for justfile target build & check
* Fix CI: Disable miropt level 4
* Fix CI: Disable -Zbuild-std
* Disable `-Zgcc-ld=lld` and `-Zshare-generics` so that we can switch back to stable

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-28 11:53:57 +00: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
e76a4dff62
Improve CI: All in cargo-zigbuild for linux targets (#816) 2023-02-18 13:41:17 +11:00
Jiahao XU
9923788f07
Fix CI: Only turn on feature pkg-config on linux and fix cross compilation (#815)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-18 00:07:24 +13:00
Jiahao XU
61c992612c
Switch to cargo-zigbuild for aarch64-unknown-linux-gnu and x86_64-unknown-linux-musl (#814)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-17 09:36:45 +13:00
Jiahao XU
a8b9ae6fda
Enable -Z share-generics to reduce compilation time (#807)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-16 14:47:37 +13:00
Jiahao XU
45ce841342
Adjust feature flags enabled on CI (#809)
Enable feature `pkg-config` and `log_release_max_level_debug` for debug
build and enable feature `static`, `trust-dns` and
`log_release_max_level_debug` for release build.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-16 11:57:58 +13:00
Jiahao XU
9c6ab5991e
Enable icf=safe & use rust-lld for targets other than win (#805)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 20:24:17 +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
Jiahao XU
647f02bb59
Use cargo-zigbuild for cross compilation (#767)
* Disable link arg `-lgcc` for musl builds when `cargo-zigbuild` is used

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 11:19:59 +13:00
Jiahao XU
5c02581569
Disable backtrace support from miette in release/CI build (#744)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-03 20:38:10 +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
Jiahao XU
18cc651713
Enable mir-opt-level=4 for release (#718)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-01-17 21:57:18 +11:00
Jiahao XU
ab4da7f059
Fix self-update on windows (#712)
Fixed #702


* Add new dep windows v0.44.0 for windows only
* Add regression test for #702
* Impl `win::replace_file`
* Use `ReplaceFileW` on windows if `fs::rename` in `fs::atomic_install` fails
* Improve logging and err messages
* Add more regression tests
* Make `BinFile::install_link` atomic: Do not remove file if dst exists
* Fallback to `ReplaceFileW` in `fs::atomic_symlink_file`
* Refactor: Extract new fn `fs::persist`
* Use `fs::persist` instead of `TempFile::persist` in `fs::atomic_install`, which fallbacks to `ReplaceFileW` on windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
2023-01-17 18:05:07 +11:00
Félix Saparelli
87854d8cc4
Recurse when packaging for mac (#696) 2023-01-12 16:11:43 +13:00
Félix Saparelli
4b2deb19b9
Try build-std with arm64 gnu (#667) 2023-01-09 12:35:00 +13:00
Félix Saparelli
aea9df602c
Migrate CI and builds to Just, add "full" builds (#660) 2023-01-08 16:27:36 +11:00