86 Commits

Author SHA1 Message Date
7e1e2d0a10 Set empty CARGO_ENCODED_RUSTFLAGS in workspace metadata retrieval (#249) 2025-06-27 19:56:05 +02:00
52ea1434f8 support warpbuild cache provider (#247) 2025-06-24 19:04:05 +02:00
eaa85be6b1 Add cache-workspace-crates feature (#246) 2025-06-22 10:43:50 +02:00
27b8ea9368 Include CPU arch in the cache key (#228) 2025-02-08 15:36:01 +01:00
008623fb83 also cache cargo install metadata 2024-12-29 08:47:45 +01:00
4b1f006ad2 update dependencies, in particular @actions/cache 2024-12-28 08:36:36 +01:00
e8e63cdbf2 Allow opting out of caching $CARGO_HOME/bin. (#216)
Prevents wiping the bin directory, which is harmful for
self-hosted runners.
2024-12-10 08:47:51 +01:00
9a2e0d3212 add runner OS in cache key (#220) 2024-12-09 22:32:01 +01:00
c00f3025ca Adds an option to do lookup-only of the cache (#217) 2024-11-08 20:36:34 +01:00
598fe25fa1 update dependencies, rebuild 2024-10-12 12:14:29 +02:00
8f842c2d45 Support Cargo.lock format cargo-lock v4 (#211)
Fixed #209

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-10-08 20:55:46 +02:00
96a8d65dba Only run macOsWorkaround() on macOS (#206) 2024-09-17 17:45:02 +02:00
2bceda3912 "update dependencies" 2024-03-24 09:56:50 +01:00
1582741630 update dependencies 2024-02-04 09:29:45 +01:00
378c8285a4 Work around upstream GitHub issue and update dependencies 2024-01-14 09:26:03 +01:00
d30f1144e8 Only key by Cargo.toml and Cargo.lock files of workspace members (#180) 2023-12-03 11:57:51 +01:00
b86d1c6caa bump all the other dependencies too 2023-10-21 10:36:18 +02:00
f27990c89a Update Dependencies (#172)
Update smol-toml 1.1.3
2023-10-20 15:35:55 +02:00
67c46e7159 Support for trybuild and similar macro testing tools (#168)
Signed-off-by: Filippo Costa <filippo@neysofu.me>
2023-09-12 19:32:03 +02:00
decb69d790 Update dependencies and add changelog 2023-08-20 10:27:32 +02:00
ab6b2769d1 dep: Use smol-toml instead of toml (#164)
Fixed #162 #163

The former is listed on
https://github.com/toml-lang/toml/wiki#implementations and is toml 1.0
compliant.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-19 12:23:03 +02:00
c0e052c18c Fix hashing of parsed Cargo.toml (#160)
The values for the dependencies could be strings intead of objects, so
add a `try` block to take care of that.

Also set `dep.path` to `""` if the dependency contains a key `path` to
make sure that the cache isn't invalidated due to change in workspace.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 12:34:30 +02:00
4e0f4b19dd Fix typo in hashing parsed Cargo.lock (#159)
This simple mistake caused the entire `Cargo.lock` to be ignored (JS
treats having no return as `false`).

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-10 19:50:14 +02:00
b919e1427f feat: Add logging to Cargo.lock/Cargo.toml hashing (#156)
There are a few problems in cargo-binstall where sometimes change to
`Cargo.lock` does not invalidate the cache.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-04 12:39:02 +02:00
80c47cc945 Clean up credentials.toml 2023-08-02 12:54:48 +02:00
3312b3ab47 Slightly improve docs 2023-08-02 12:46:45 +02:00
f6987ea139 Improve errors and cleanup
- Silence errors and do not create error annotations, fixes #144
- Implement cleanup for new sparse registry
- Do not clean `-sys` dependencies from `registry/src`, hopefully fixes  #150
2023-08-02 12:15:14 +02:00
b00faf5858 Add BuildJet Option (#154) 2023-08-01 09:01:11 +02:00
4fedae9bcf "update dependencies and rebuild" 2023-07-31 16:01:23 +02:00
be7377e68e fix src/config.ts: Remove sort_object (#152)
Fixed #151

I've tried running manually load and parse `Cargo.lock` and it runs fine
until `sort_object` is called.

Since `Cargo.lock` is auto-generated and usually sorted, I think there
is no need for sorting.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-27 08:55:56 +02:00
715970feed feat: Add hash of .cargo/config.toml to key (#149)
Also:
 - Add and use `sort_and_uniq` to make sure `globFile` resulting
   and `keyFiles` does not contain duplicates.
 - Only returns regular file in function `globFile`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-18 10:12:25 +02:00
3d4000164d feat: Rm workspace crates version before caching (#147)
Fixed #146

 - Set all `package.version` in `Cargo.toml` to `0.0.0`
 - Set `{build-, dev-, }dependencies` of workspace crates to `0.0.0`
 - Remove workspace crates from `Cargo.lock` before caching
 - Sort all toml objects before hashing them as json

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-18 09:29:44 +02:00
bb80d0f127 chore: use 8 character hash components (#143)
Use 8 character hash components to reduce the key length, making it
more readable.

Fixes #97
2023-05-19 20:30:37 +02:00
ad97570a01 fix: cache key stability (#142)
Ensure consistency of main and post configuration by storing and
restoring it from state, which in turn ensures cache key stability.

Also:
* Fixed some typos.
* Use core.error for logging errors.
* Fix inverted condition on cache-all-crates.

Reverts: #138
Fixes #140
2023-05-18 22:48:40 +02:00
865fd1f6db "update dependencies and changelog" 2023-05-13 12:16:26 +02:00
def0926359 feat: add option to cache all crates (#137)
Add cache-all-crates option which allows all crates to be cached instead
of just the dependency crates. This is useful when additional crates are
required for CI tooling.
2023-05-11 23:15:09 +02:00
827c240e23 fix: cache key dependency on installed packages (#138)
Add the installed packages to the environment element of the cache key
so that CI tooling is considered. This ensures that rust CI tooling is
cached correctly when changes occur. Prior to this a manual key change
or cache expiry would need to occur before CI tools were correctly
cached.
2023-05-11 23:12:12 +02:00
5e9fae966f fix: cache restore failures (#136)
Fix cache restore failures to to upstream bug.

Fixes #119
2023-05-11 09:01:27 +02:00
127a0e9568 "update dependencies and rebuild" 2023-05-02 22:03:29 +02:00
a1c019f71a update dependencies and rebuild 2023-02-24 10:58:39 +01:00
359a70e43a 2.2.0 2022-11-09 20:14:41 +01:00
e78327dd9e small code style improvements, README and CHANGELOG updates 2022-11-06 09:50:33 +01:00
3f2513fdf4 avoid calling cargo metadata on pre-cleanup 2022-11-03 11:26:22 +01:00
b8e72aae83 Added prefix-key cache-directories and cache-targets options (#85) 2022-10-18 23:05:42 +02:00
d4d463bd9b bump deps and rebuild 2022-10-14 21:54:25 +02:00
0d72e5f9a0 revert explicit dir close 2022-09-04 13:22:47 +02:00
be4be3720d explicitly close dir handles, add more logging, cleanups 2022-09-04 13:10:36 +02:00
b8d4fa4eaf update dependencies, use watto as example 2022-09-04 12:03:43 +02:00
5733786579 rebuild 2022-07-16 12:42:15 +02:00
0497f9301f improve registry cleanpu 2022-07-09 19:20:02 +02:00