Commit graph

175 commits

Author SHA1 Message Date
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
8dd7aa5688
Speedup ci.yml: Do not run tests on x86_64-unknown-linux-musl (#976)
Speedup ci.yml: Do not run tests on x86_64-unknown-linux-musl

Since we already run test on x86_64-unknown-linux-musl in
release-build.yml and x86_64-unknown-linux-musl is almost identical to
x86_64-unknown-linux-gnu except for the libc, there's no need to run the
tests in ci.yml

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-04 01:40:26 +10:00
Jiahao XU
24634b2de1
Speedup workflow lipo in release-build.yml (#975)
Speedup workflow lipo in release-build

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-04 01:40:13 +10:00
Jiahao XU
6a224da9ee
Run unit tests in release-build.yml (#977)
Since release build enables a lot of optimization, disable debug assert
and possibly change the code to be run, it's better to run the tests
again.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-04 01:40:01 +10:00
Jiahao XU
a403c99d3f
Upgrade CI to use sccache v0.4.0 for caching (#934)
Remove `mozilla-actions/sccache-action@v0.0.2` and instead use `taiki-ie/install-action` to install `sccache`, since we already use `taiki-e/install-action` for installing crates.

This PR also refactor just-setup.yml and use pass `GITHUB_TOKEN` to `taiki-e/install-action` which uses `cargo-binstall` for installing `cargo-auditable` and `sccache`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-26 17:28:35 +11:00
Jiahao XU
47d4aeaa96
Run cache-cleanup at 3am & 4:30am AEST instead of after every PR (#944)
since cache-cleanup will issue a lot of gh api requests, running the
workflow right after the PRs would cause the GH API to rate limit all
workflows (including our CI for testing and release) that they can no
longer upload artifacts and `cargo-binstall` would have to fallback to
sending GET requests instead of using GH API, which makes it a lot
slower and more likely to fail.

This PR changes it to be run at 3am and 4:30am AEST which nobody would submit
any PR at that time and then remove all caches of the top 20 closed prs.

The workflow can also now be triggered manually.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-23 18:10:30 +11:00
Jiahao XU
9a59119163
Fully remove all caches for PR in cache-cleanup.yml (#942)
Previously it only removes 30 caches for the PR because gh actions-cache list defaults to only listing 30 cache entries.

In this PR, I changed the limit to the maximum allowed 100 cache entries and I also added a loop to keep getting the next 100 cache entries until there is none.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-23 02:50:13 +13:00
Félix Saparelli
2227d363f7
Leon template library (#766)
* leon: first implementation

* Update crates/leon/src/values.rs

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

* Workaround orphan rules to make API more intuitive

* Fmt

* Clippy

* Use CoW

* Use cow for items too

* Test that const construction works

* leon: Initial attempt at O(n) parser

* leon: finish parser (except escapes)

* leon: Improve ergonomics of compile-time templates

* Document helpers

* leon: Docs tweaks

* leon: Use macro to minimise parser tests

* leon: add escapes to parser

* leon: test escapes preceding keys

* leon: add multibyte tests

* leon: test escapes following keys

* Format

* Debug

* leon: Don't actually need to keep track of the key

* leon: Parse to vec first

* leon: there's actually no need for string cows

* leon: reorganise and redo macro now that there's no coww

* Well that was silly

* leon: Adjust text end when pushing

* leon: catch unbalanced keys

* Add error tests

* leon: Catch unfinished escape

* Comment out debugging

* leon: fuzz

* Clippy

* leon: Box parse error

* leon: &dyn instead of impl

* Can't impl FromStr, so rename to parse

* Add Vec<> to values

* leon: Add benches for ways to supply values

* leon: Add bench comparing to std and tt

* Fix fuzz

* Fmt

* Split ParseError and RenderError

* Make miette optional

* Remove RenderError lifetime

* Simplify ParseError type schema

* Write concrete Values types instead of generics

* Add license files

* Reduce criterion deps

* Make default a cow

* Add a CLI leon tool

* Fix tests

* Clippy

* Disable cli by default

* Avoid failing the build when cli is off

* Add to ci

* Update crates/leon/src/main.rs

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

* Update crates/leon/Cargo.toml

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

* Bump version

* Error not transparent

* Diagnostic can do forwarding

* Simplify error type

* Expand doc examples

* Generic Values for Hash and BTree maps

* One more borrowed

* Forward implementations

* More generics

* Add has_keys

* Lock stdout in leon tool

* No more debug comments in parser

* Even more generics

* Macros to reduce bench duplication

* Further simplify error

* Fix leon main

* Stable support

* Clippy

---------

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-21 01:36:02 +00:00
Félix Saparelli
48b85cc38f
Cleanup caches for closed PRs (#915)
As suggested here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches
2023-03-15 15:44:06 +11:00
Jiahao XU
235d324d3d
Add job windows-aarch64-check to workflow ci (#882)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-11 23:46:26 +11: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
Félix Saparelli
ac414df5be
Use stable sparse registry option (#879) 2023-03-11 01:58:58 +00:00
Jiahao XU
44eaff97dc
Fix use of hashFiles in key of bulid-cache (#845)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-02 15:40:39 +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
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
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
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
93f15ea1c4
Ignore README.md and SUPPORT.md in workflow "ci" (#812)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-16 11:58:16 +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
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
f46de3714a
Add step to relase-build to make sure it's runnable (#792)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-12 14:48:28 +11:00
Félix Saparelli
939f17dcd0
Fix "Tests pass" step (#726) 2023-01-18 03:13:49 +13:00
Félix Saparelli
ba91777faf
Fix name of release (#723) 2023-01-18 00:22:49 +13:00
Félix Saparelli
aed3d9d71c
Use release action with explicit support for being called multiple times (#693) 2023-01-12 00:48:03 +00:00
Félix Saparelli
64c359a86f
Run CI on auto-merge enable (#692) 2023-01-12 02:45:04 +13:00
Félix Saparelli
ede976d650
Fix typo (#691) 2023-01-11 01:21:16 +00:00
Félix Saparelli
9821caa6d0
Use release-meta action instead of parsing commits (#675) 2023-01-11 09:22:53 +11: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
dependabot[bot]
611485de52
Bump taiki-e/install-action from 1 to 2 (#630) 2022-12-27 11:43:56 +00:00
Noa
597e092774
CI: Build -gnu targets on ubuntu-20.04 (#607)
This commit pins it to 20.04, so the glibc version required by the release binaries can be run on docker image `rust:1.65` which uses glibc 2.31.
2022-12-14 11:14:20 +11:00
dependabot[bot]
f45c18ff81
Bump softprops/action-gh-release from 0.1.14 to 0.1.15 (#583) 2022-12-02 14:46:59 +13:00
Jiahao XU
44316e1f02
Fix workflow release-pr: Install nightly toolchain (#560)
Default rust/cargo in ubuntu-latest is too old.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-22 09:59:24 +00:00
Jiahao XU
707b173de1
Create universal binary for MacOS in workflow release (#551)
* Create universal binary for MacOS in workflow build
* Update README

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-22 16:52:36 +11:00
Jiahao XU
d9cc3ce219
Refactor: Extract new crate binstalk-types plus other misc refactor and optimization (#535)
* Refactor: Extract new crate binstalk-types
* Optimize: Rm field `CrateInfo::other`
   which also removes dep serde-tuple-vec-map and serde-json from
   binstalk-types.
   
   This also makes `CrateInfo` easier to use, more generic and can be used
   over any `Serializer`, not just `serde_json::Value`.
* Mark all errors in `binstalk-manifests` as non_exhaustive
* Reduce size of `CvsParseError` by using `Box<str>`
   instead of `String` for variant `UnknownSourceType`.
* Reduce size of `CratesTomlParseError` to 16 bytes on 64bit platform
   by boxing variants `TomlWrite` and `CvsParse` as these two fields are
   significantly larger than other variants.
* Unify import style in mod `binstall_crates_v1`
* Replace dep binstalk-manifests with binstalk-types in binstalk-downloader
   to reduce its transitive dependencies and enables binstalk-downloader to
   be built in parallel to binstak-manifests.
* Replace dep binstalk-manifests with binstalk-types in binstalk
   to reduce transitive dependencies and enables binstalk to be built in
   parallel to binstalk-manifests.
   
   This is benefitial because binstalk-manifests pulls in toml_edit, which
   could takes up to 15s to be built on M1 (7-9s for codegen).
* Add dep binstalk-manifests to crates/bin
* Update dependabot and GHA release-pr

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-17 13:46:27 +13:00
dependabot[bot]
4ee0c9160f
Bump cargo-bins/release-pr from 1 to 2 (#531)
Bumps [cargo-bins/release-pr](https://github.com/cargo-bins/release-pr) from 1 to 2.
- [Release notes](https://github.com/cargo-bins/release-pr/releases)
- [Commits](https://github.com/cargo-bins/release-pr/compare/v1...v2)

---
updated-dependencies:
- dependency-name: cargo-bins/release-pr
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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-11-15 12:45:31 +11:00
Jiahao XU
89fa5b1769
Refactor: Extract new crate binstalk-{signal, downloader} (#518)
* Refactor: Extract new crate binstalk-downloader
* Re-export `PkgFmt` from `binstalk_manifests`
* Update release-pr.yml
* Update dependabot

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-11-11 04:02:54 +00:00
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
Félix Saparelli
be8e83b8bd
Update release-pr config (#364) 2022-09-10 06:56:33 +00:00
Félix Saparelli
bcec382a64
Improve release-pr usage (#350) 2022-09-07 17:40:46 +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