30 Commits

Author SHA1 Message Date
Arpad Borsos
f0deed1e0e 2.7.7
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2024-12-29 08:48:10 +01:00
Arpad Borsos
008623fb83 also cache cargo install metadata 2024-12-29 08:47:45 +01:00
Arpad Borsos
720f7e45cc 2.7.6
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2024-12-28 08:37:30 +01:00
Arpad Borsos
4b1f006ad2 update dependencies, in particular @actions/cache 2024-12-28 08:36:36 +01:00
Benjy Weinberger
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
Rano | Ranadeep
9a2e0d3212 add runner OS in cache key (#220) 2024-12-09 22:32:01 +01:00
Daniel LeCheminant
c00f3025ca Adds an option to do lookup-only of the cache (#217) 2024-11-08 20:36:34 +01:00
guylamar2006
68b3cb7503 Updated artifact upload action to v4 (#212) 2024-10-17 09:52:18 +02:00
Arpad Borsos
82a92a6e8f 2.7.5
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2024-10-12 12:15:11 +02:00
Arpad Borsos
598fe25fa1 update dependencies, rebuild 2024-10-12 12:14:29 +02:00
Jiahao XU
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
Gunnar Lilleaasen
96a8d65dba Only run macOsWorkaround() on macOS (#206) 2024-09-17 17:45:02 +02:00
Hamir Mahal
9bdad043e8 fix: usage of deprecated version of node (#197) 2024-05-03 16:02:43 +02:00
Arpad Borsos
f7a52f6914 "add jsonpath test" 2024-03-24 10:00:25 +01:00
Arpad Borsos
2bceda3912 "update dependencies" 2024-03-24 09:56:50 +01:00
Carsten Wenderdel
640a22190e Upgrade checkout action from version 3 to 4 (#190)
This fixes issue #189.

This is necessary because GitHub actions are going to drop support for Node.js 16.
Version 4 uses Node.js 20.
See https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
2024-02-27 08:23:34 +01:00
Arpad Borsos
1582741630 update dependencies 2024-02-04 09:29:45 +01:00
Arpad Borsos
23bce251a8 2.7.3
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2024-01-14 09:31:14 +01:00
Arpad Borsos
378c8285a4 Work around upstream GitHub issue and update dependencies 2024-01-14 09:26:03 +01:00
Arpad Borsos
a226033982 2.7.2
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2024-01-10 19:34:14 +01:00
Max Heller
d30f1144e8 Only key by Cargo.toml and Cargo.lock files of workspace members (#180) 2023-12-03 11:57:51 +01:00
Linda_pp
b1db5f9d5f Update action runtime to node20 (#175) 2023-10-25 20:36:38 +02:00
Arpad Borsos
3cf7f8cc28 2.7.1
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2023-10-21 10:37:46 +02:00
Arpad Borsos
e03705e031 changelog 2023-10-21 10:37:41 +02:00
Arpad Borsos
b86d1c6caa bump all the other dependencies too 2023-10-21 10:36:18 +02:00
Wyatt Herkamp
f27990c89a Update Dependencies (#172)
Update smol-toml 1.1.3
2023-10-20 15:35:55 +02:00
Arpad Borsos
a95ba19544 2.7.0
Some checks failed
buildjet / Test buildjet provider on ubuntu-latest (push) Failing after 0s
coverage / Test `cargo-llvm-cov` on ubuntu-latest (push) Failing after 0s
git-registry / Test cargo "git" registry on ubuntu-latest (push) Failing after 0s
install / Test `cargo install` on ubuntu-latest (push) Failing after 0s
simple / Test `cargo check/test/build` on ubuntu-latest (push) Failing after 0s
target-dir / Test custom target-dir on ubuntu-latest (push) Failing after 0s
workspaces / Test multiple workspaces on ubuntu-latest (push) Failing after 0s
buildjet / Test buildjet provider on macos-latest (push) Has been cancelled
buildjet / Test buildjet provider on windows-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on macos-latest (push) Has been cancelled
coverage / Test `cargo-llvm-cov` on windows-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on macos-latest (push) Has been cancelled
git-registry / Test cargo "git" registry on windows-latest (push) Has been cancelled
install / Test `cargo install` on macos-latest (push) Has been cancelled
install / Test `cargo install` on windows-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on macos-latest (push) Has been cancelled
simple / Test `cargo check/test/build` on windows-latest (push) Has been cancelled
target-dir / Test custom target-dir on macos-latest (push) Has been cancelled
target-dir / Test custom target-dir on windows-latest (push) Has been cancelled
workspaces / Test multiple workspaces on macos-latest (push) Has been cancelled
workspaces / Test multiple workspaces on windows-latest (push) Has been cancelled
2023-09-12 19:34:11 +02:00
Arpad Borsos
82c8487d00 changelog 2023-09-12 19:34:01 +02:00
Filippo Neysofu Costa
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
Lucas Kent
44b6087283 Fix save-if documentation in readme (#166) 2023-08-24 15:18:39 +02:00
27 changed files with 126254 additions and 79914 deletions

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -1,26 +1,26 @@
name: check dist/ name: check dist/
on: on:
push: push:
branches: branches:
- master - master
paths-ignore: paths-ignore:
- '**.md' - "**.md"
pull_request: pull_request:
paths-ignore: paths-ignore:
- '**.md' - "**.md"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
check-dist: check-dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Setup Node.js 16.x - name: Setup Node.js 20.x
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 16.x node-version: 20.x
cache: npm cache: npm
- name: Install dependencies - name: Install dependencies
@@ -38,7 +38,7 @@ jobs:
fi fi
id: diff id: diff
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update - run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update

View File

@@ -17,7 +17,7 @@ jobs:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update - run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update

View File

@@ -1,5 +1,21 @@
# Changelog # Changelog
## 2.7.3
- Work around upstream problem that causes cache saving to hang for minutes.
## 2.7.2
- Only key by `Cargo.toml` and `Cargo.lock` files of workspace members.
## 2.7.1
- Update toml parser to fix parsing errors.
## 2.7.0
- Properly cache `trybuild` tests.
## 2.6.2 ## 2.6.2
- Fix `toml` parsing. - Fix `toml` parsing.

View File

@@ -6,7 +6,7 @@ sensible defaults.
## Example usage ## Example usage
```yaml ```yaml
- uses: actions/checkout@v3 - uses: actions/checkout@v4
# selecting a toolchain either by action or manual `rustup` calls should happen # selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key # before the plugin, as the cache uses the current rustc version as its cache key
@@ -60,19 +60,29 @@ sensible defaults.
# default: "false" # default: "false"
cache-all-crates: "" cache-all-crates: ""
# Determiners whether the cache should be saved. # Determines whether the cache should be saved.
# If `false`, the cache is only restored. # If `false`, the cache is only restored.
# Useful for jobs where the matrix is additive e.g. additional Cargo features, # Useful for jobs where the matrix is additive e.g. additional Cargo features,
# or when only runs from `master` should be saved to the cache. # or when only runs from `master` should be saved to the cache.
# default: "true" # default: "true"
save-if: "" save-if: ""
# To only cache runs from `master`: # To only cache runs from `master`:
save-if: ${{ github.ref == 'refs/head/master' }} save-if: ${{ github.ref == 'refs/heads/master' }}
# Determines whether the cache should be restored.
# If `true` the cache key will be checked and the `cache-hit` output will be set
# but the cache itself won't be restored
# default: "false"
lookup-only: ""
# Specifies what to use as the backend providing cache # Specifies what to use as the backend providing cache
# Can be set to either "github" or "buildjet" # Can be set to either "github" or "buildjet"
# default: "github" # default: "github"
cache-provider: "" cache-provider: ""
# Determines whether to cache the ~/.cargo/bin directory.
# default: "true"
cache-bin: ""
``` ```
Further examples are available in the [.github/workflows](./.github/workflows/) directory. Further examples are available in the [.github/workflows](./.github/workflows/) directory.
@@ -169,4 +179,7 @@ to see those details as well as further details related to caching operations.
## Known issues ## Known issues
- The cache cleaning process currently removes all the files from `~/.cargo/bin` - The cache cleaning process currently removes all the files from `~/.cargo/bin`
that were present before the action ran (for example `rustc`). that were present before the action ran (for example `rustc`), by default.
This can be an issue on long-running self-hosted runners, where such state
is expected to be preserved across runs. You can work around this by setting
`cache-bin: "false"`.

View File

@@ -40,11 +40,19 @@ inputs:
description: "Determines which provider to use for caching. Options are github or buildjet, defaults to github." description: "Determines which provider to use for caching. Options are github or buildjet, defaults to github."
required: false required: false
default: "github" default: "github"
cache-bin:
description: "Determines whether to cache ${CARGO_HOME}/bin."
required: false
default: "true"
lookup-only:
description: "Check if a cache entry exists without downloading the cache"
required: false
default: "false"
outputs: outputs:
cache-hit: cache-hit:
description: "A boolean value that indicates an exact match was found." description: "A boolean value that indicates an exact match was found."
runs: runs:
using: "node16" using: "node20"
main: "dist/restore/index.js" main: "dist/restore/index.js"
post: "dist/save/index.js" post: "dist/save/index.js"
post-if: "success() || env.CACHE_ON_FAILURE == 'true'" post-if: "success() || env.CACHE_ON_FAILURE == 'true'"

102329
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

102336
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

778
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "rust-cache", "name": "rust-cache",
"version": "2.6.2", "version": "2.7.7",
"description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.", "description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.",
"keywords": [ "keywords": [
"actions", "actions",
@@ -23,17 +23,18 @@
"homepage": "https://github.com/Swatinem/rust-cache#readme", "homepage": "https://github.com/Swatinem/rust-cache#readme",
"dependencies": { "dependencies": {
"@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0", "@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0",
"@actions/cache": "^3.2.2", "@actions/cache": "^4.0.0",
"@actions/core": "^1.10.0", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/glob": "^0.4.0", "@actions/glob": "^0.5.0",
"@actions/io": "^1.1.3", "@actions/io": "^1.1.3",
"smol-toml": "^1.1.1" "smol-toml": "^1.3.0"
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.36.1", "@types/node": "^22.7.5",
"@vercel/ncc": "^0.38.2",
"linefix": "^0.1.1", "linefix": "^0.1.1",
"typescript": "5.1.6" "typescript": "5.7.2"
}, },
"scripts": { "scripts": {
"prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts && linefix dist" "prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts && linefix dist"

View File

@@ -4,6 +4,7 @@ import fs from "fs";
import path from "path"; import path from "path";
import { CARGO_HOME } from "./config"; import { CARGO_HOME } from "./config";
import { exists } from "./utils";
import { Packages } from "./workspace"; import { Packages } from "./workspace";
export async function cleanTargetDir(targetDir: string, packages: Packages, checkTimestamp = false) { export async function cleanTargetDir(targetDir: string, packages: Packages, checkTimestamp = false) {
@@ -34,6 +35,26 @@ export async function cleanTargetDir(targetDir: string, packages: Packages, chec
async function cleanProfileTarget(profileDir: string, packages: Packages, checkTimestamp = false) { async function cleanProfileTarget(profileDir: string, packages: Packages, checkTimestamp = false) {
core.debug(`cleaning profile directory "${profileDir}"`); core.debug(`cleaning profile directory "${profileDir}"`);
// Quite a few testing utility crates store compilation artifacts as nested
// workspaces under `target/tests`. Notably, `target/tests/target` and
// `target/tests/trybuild`.
if (path.basename(profileDir) === "tests") {
try {
// https://github.com/vertexclique/kaos/blob/9876f6c890339741cc5be4b7cb9df72baa5a6d79/src/cargo.rs#L25
// https://github.com/eupn/macrotest/blob/c4151a5f9f545942f4971980b5d264ebcd0b1d11/src/cargo.rs#L27
cleanTargetDir(path.join(profileDir, "target"), packages, checkTimestamp);
} catch {}
try {
// https://github.com/dtolnay/trybuild/blob/eec8ca6cb9b8f53d0caf1aa499d99df52cae8b40/src/cargo.rs#L50
cleanTargetDir(path.join(profileDir, "trybuild"), packages, checkTimestamp);
} catch {}
// Delete everything else.
await rmExcept(profileDir, new Set(["target", "trybuild"]), checkTimestamp);
return;
}
let keepProfile = new Set(["build", ".fingerprint", "deps"]); let keepProfile = new Set(["build", ".fingerprint", "deps"]);
await rmExcept(profileDir, keepProfile); await rmExcept(profileDir, keepProfile);
@@ -288,12 +309,3 @@ async function rmRF(dirName: string) {
core.debug(`deleting "${dirName}"`); core.debug(`deleting "${dirName}"`);
await io.rmRF(dirName); await io.rmRF(dirName);
} }
async function exists(path: string) {
try {
await fs.promises.access(path);
return true;
} catch {
return false;
}
}

View File

@@ -8,7 +8,7 @@ import path from "path";
import * as toml from "smol-toml"; import * as toml from "smol-toml";
import { getCargoBins } from "./cleanup"; import { getCargoBins } from "./cleanup";
import { CacheProvider, getCmdOutput } from "./utils"; import { CacheProvider, exists, getCmdOutput } from "./utils";
import { Workspace } from "./workspace"; import { Workspace } from "./workspace";
const HOME = os.homedir(); const HOME = os.homedir();
@@ -25,6 +25,9 @@ export class CacheConfig {
/** The secondary (restore) key that only contains the prefix and environment */ /** The secondary (restore) key that only contains the prefix and environment */
public restoreKey = ""; public restoreKey = "";
/** Whether to cache CARGO_HOME/.bin */
public cacheBin: boolean = true;
/** The workspace configurations */ /** The workspace configurations */
public workspaces: Array<Workspace> = []; public workspaces: Array<Workspace> = [];
@@ -71,6 +74,10 @@ export class CacheConfig {
} }
} }
// Add runner OS to the key to avoid cross-contamination of cache
const runnerOS = os.type();
key += `-${runnerOS}`;
self.keyPrefix = key; self.keyPrefix = key;
// Construct environment portion of the key: // Construct environment portion of the key:
@@ -116,6 +123,8 @@ export class CacheConfig {
// This considers all the files found via globbing for various manifests // This considers all the files found via globbing for various manifests
// and lockfiles. // and lockfiles.
self.cacheBin = core.getInput("cache-bin").toLowerCase() == "true";
// Constructs the workspace config and paths to restore: // Constructs the workspace config and paths to restore:
// The workspaces are given using a `$workspace -> $target` syntax. // The workspaces are given using a `$workspace -> $target` syntax.
@@ -142,7 +151,9 @@ export class CacheConfig {
)), )),
); );
const cargo_manifests = sort_and_uniq(await globFiles(`${root}/**/Cargo.toml`)); const workspaceMembers = await workspace.getWorkspaceMembers();
const cargo_manifests = sort_and_uniq(workspaceMembers.map((member) => path.join(member.path, "Cargo.toml")));
for (const cargo_manifest of cargo_manifests) { for (const cargo_manifest of cargo_manifests) {
try { try {
@@ -183,23 +194,23 @@ export class CacheConfig {
hasher.update(JSON.stringify(parsed)); hasher.update(JSON.stringify(parsed));
parsedKeyFiles.push(cargo_manifest); parsedKeyFiles.push(cargo_manifest);
} catch (e) { // Fallback to caching them as regular file } catch (e) {
// Fallback to caching them as regular file
core.warning(`Error parsing Cargo.toml manifest, fallback to caching entire file: ${e}`); core.warning(`Error parsing Cargo.toml manifest, fallback to caching entire file: ${e}`);
keyFiles.push(cargo_manifest); keyFiles.push(cargo_manifest);
} }
} }
const cargo_locks = sort_and_uniq(await globFiles(`${root}/**/Cargo.lock`)); const cargo_lock = path.join(workspace.root, "Cargo.lock");
if (await exists(cargo_lock)) {
for (const cargo_lock of cargo_locks) {
try { try {
const content = await fs_promises.readFile(cargo_lock, { encoding: "utf8" }); const content = await fs_promises.readFile(cargo_lock, { encoding: "utf8" });
const parsed = toml.parse(content); const parsed = toml.parse(content);
if (parsed.version !== 3 || !("package" in parsed)) { if ((parsed.version !== 3 && parsed.version !== 4) || !("package" in parsed)) {
// Fallback to caching them as regular file since this action // Fallback to caching them as regular file since this action
// can only handle Cargo.lock format version 3 // can only handle Cargo.lock format version 3
core.warning('Unsupported Cargo.lock format, fallback to caching entire file'); core.warning("Unsupported Cargo.lock format, fallback to caching entire file");
keyFiles.push(cargo_lock); keyFiles.push(cargo_lock);
continue; continue;
} }
@@ -211,7 +222,8 @@ export class CacheConfig {
hasher.update(JSON.stringify(packages)); hasher.update(JSON.stringify(packages));
parsedKeyFiles.push(cargo_lock); parsedKeyFiles.push(cargo_lock);
} catch (e) { // Fallback to caching them as regular file } catch (e) {
// Fallback to caching them as regular file
core.warning(`Error parsing Cargo.lock manifest, fallback to caching entire file: ${e}`); core.warning(`Error parsing Cargo.lock manifest, fallback to caching entire file: ${e}`);
keyFiles.push(cargo_lock); keyFiles.push(cargo_lock);
} }
@@ -233,7 +245,15 @@ export class CacheConfig {
key += `-${lockHash}`; key += `-${lockHash}`;
self.cacheKey = key; self.cacheKey = key;
self.cachePaths = [CARGO_HOME]; self.cachePaths = [path.join(CARGO_HOME, "registry"), path.join(CARGO_HOME, "git")];
if (self.cacheBin) {
self.cachePaths = [
path.join(CARGO_HOME, "bin"),
path.join(CARGO_HOME, ".crates.toml"),
path.join(CARGO_HOME, ".crates2.json"),
...self.cachePaths,
];
}
const cacheTargets = core.getInput("cache-targets").toLowerCase() || "true"; const cacheTargets = core.getInput("cache-targets").toLowerCase() || "true";
if (cacheTargets === "true") { if (cacheTargets === "true") {
self.cachePaths.push(...workspaces.map((ws) => ws.target)); self.cachePaths.push(...workspaces.map((ws) => ws.target));

View File

@@ -24,6 +24,8 @@ async function run() {
if (cacheOnFailure !== "true") { if (cacheOnFailure !== "true") {
cacheOnFailure = "false"; cacheOnFailure = "false";
} }
var lookupOnly = core.getInput("lookup-only").toLowerCase() === "true";
core.exportVariable("CACHE_ON_FAILURE", cacheOnFailure); core.exportVariable("CACHE_ON_FAILURE", cacheOnFailure);
core.exportVariable("CARGO_INCREMENTAL", 0); core.exportVariable("CARGO_INCREMENTAL", 0);
@@ -31,15 +33,17 @@ async function run() {
config.printInfo(cacheProvider); config.printInfo(cacheProvider);
core.info(""); core.info("");
core.info(`... Restoring cache ...`); core.info(`... ${lookupOnly ? "Checking" : "Restoring"} cache ...`);
const key = config.cacheKey; const key = config.cacheKey;
// Pass a copy of cachePaths to avoid mutating the original array as reported by: // Pass a copy of cachePaths to avoid mutating the original array as reported by:
// https://github.com/actions/toolkit/pull/1378 // https://github.com/actions/toolkit/pull/1378
// TODO: remove this once the underlying bug is fixed. // TODO: remove this once the underlying bug is fixed.
const restoreKey = await cacheProvider.cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey]); const restoreKey = await cacheProvider.cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey], {
lookupOnly,
});
if (restoreKey) { if (restoreKey) {
const match = restoreKey === key; const match = restoreKey === key;
core.info(`Restored from cache key "${restoreKey}" full match: ${match}.`); core.info(`${lookupOnly ? "Found" : "Restored from"} cache key "${restoreKey}" full match: ${match}.`);
if (!match) { if (!match) {
// pre-clean the target directory on cache mismatch // pre-clean the target directory on cache mismatch
for (const workspace of config.workspaces) { for (const workspace of config.workspaces) {
@@ -64,6 +68,7 @@ async function run() {
reportError(e); reportError(e);
} }
process.exit();
} }
function setCacheHitOutput(cacheHit: boolean): void { function setCacheHitOutput(cacheHit: boolean): void {

View File

@@ -32,11 +32,13 @@ async function run() {
core.info(""); core.info("");
// TODO: remove this once https://github.com/actions/toolkit/pull/553 lands // TODO: remove this once https://github.com/actions/toolkit/pull/553 lands
await macOsWorkaround(); if (process.env["RUNNER_OS"] == "macOS") {
await macOsWorkaround();
}
const allPackages = []; const allPackages = [];
for (const workspace of config.workspaces) { for (const workspace of config.workspaces) {
const packages = await workspace.getPackages(); const packages = await workspace.getPackagesOutsideWorkspaceRoot();
allPackages.push(...packages); allPackages.push(...packages);
try { try {
core.info(`... Cleaning ${workspace.target} ...`); core.info(`... Cleaning ${workspace.target} ...`);
@@ -54,11 +56,13 @@ async function run() {
core.debug(`${(e as any).stack}`); core.debug(`${(e as any).stack}`);
} }
try { if (config.cacheBin) {
core.info(`... Cleaning cargo/bin ...`); try {
await cleanBin(config.cargoBins); core.info(`... Cleaning cargo/bin ...`);
} catch (e) { await cleanBin(config.cargoBins);
core.debug(`${(e as any).stack}`); } catch (e) {
core.debug(`${(e as any).stack}`);
}
} }
try { try {
@@ -76,6 +80,7 @@ async function run() {
} catch (e) { } catch (e) {
reportError(e); reportError(e);
} }
process.exit();
} }
run(); run();

View File

@@ -2,6 +2,7 @@ import * as core from "@actions/core";
import * as exec from "@actions/exec"; import * as exec from "@actions/exec";
import * as buildjetCache from "@actions/buildjet-cache"; import * as buildjetCache from "@actions/buildjet-cache";
import * as ghCache from "@actions/cache"; import * as ghCache from "@actions/cache";
import fs from "fs";
export function reportError(e: any) { export function reportError(e: any) {
const { commandFailed } = e; const { commandFailed } = e;
@@ -61,3 +62,12 @@ export function getCacheProvider(): CacheProvider {
cache: cache, cache: cache,
}; };
} }
export async function exists(path: string) {
try {
await fs.promises.access(path);
return true;
} catch {
return false;
}
}

View File

@@ -8,26 +8,33 @@ const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
export class Workspace { export class Workspace {
constructor(public root: string, public target: string) {} constructor(public root: string, public target: string) {}
public async getPackages(): Promise<Packages> { async getPackages(filter: (p: Meta["packages"][0]) => boolean, ...extraArgs: string[]): Promise<Packages> {
let packages: Packages = []; let packages: Packages = [];
try { try {
core.debug(`collecting metadata for "${this.root}"`); core.debug(`collecting metadata for "${this.root}"`);
const meta: Meta = JSON.parse( const meta: Meta = JSON.parse(
await getCmdOutput("cargo", ["metadata", "--all-features", "--format-version", "1"], { await getCmdOutput("cargo", ["metadata", "--all-features", "--format-version", "1", ...extraArgs], {
cwd: this.root, cwd: this.root,
}), }),
); );
core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`); core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`);
for (const pkg of meta.packages) { for (const pkg of meta.packages.filter(filter)) {
if (pkg.manifest_path.startsWith(this.root)) {
continue;
}
const targets = pkg.targets.filter((t) => t.kind.some((kind) => SAVE_TARGETS.has(kind))).map((t) => t.name); const targets = pkg.targets.filter((t) => t.kind.some((kind) => SAVE_TARGETS.has(kind))).map((t) => t.name);
packages.push({ name: pkg.name, version: pkg.version, targets, path: path.dirname(pkg.manifest_path) }); packages.push({ name: pkg.name, version: pkg.version, targets, path: path.dirname(pkg.manifest_path) });
} }
} catch {} } catch (err) {
console.error(err);
}
return packages; return packages;
} }
public async getPackagesOutsideWorkspaceRoot(): Promise<Packages> {
return await this.getPackages((pkg) => !pkg.manifest_path.startsWith(this.root));
}
public async getWorkspaceMembers(): Promise<Packages> {
return await this.getPackages((_) => true, "--no-deps");
}
} }
export interface PackageDefinition { export interface PackageDefinition {

469
tests/Cargo.lock generated
View File

@@ -14,6 +14,15 @@ version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
[[package]]
name = "basic-toml"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@@ -69,6 +78,12 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "1.8.0" version = "1.8.0"
@@ -149,10 +164,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "h2" name = "glob"
version = "0.3.14" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "h2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@@ -160,7 +181,7 @@ dependencies = [
"futures-sink", "futures-sink",
"futures-util", "futures-util",
"http", "http",
"indexmap", "indexmap 2.2.6",
"slab", "slab",
"tokio", "tokio",
"tokio-util", "tokio-util",
@@ -174,10 +195,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "http" name = "hashbrown"
version = "0.2.8" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
[[package]]
name = "http"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@@ -186,12 +213,24 @@ dependencies = [
[[package]] [[package]]
name = "http-body" name = "http-body"
version = "0.4.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
dependencies = [ dependencies = [
"bytes", "bytes",
"http", "http",
]
[[package]]
name = "http-body-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d"
dependencies = [
"bytes",
"futures-core",
"http",
"http-body",
"pin-project-lite", "pin-project-lite",
] ]
@@ -201,47 +240,60 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.14.20" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
"futures-core",
"futures-util", "futures-util",
"h2", "h2",
"http", "http",
"http-body", "http-body",
"httparse", "httparse",
"httpdate",
"itoa", "itoa",
"pin-project-lite", "pin-project-lite",
"socket2", "smallvec",
"tokio", "tokio",
"tower-service",
"tracing",
"want", "want",
] ]
[[package]] [[package]]
name = "hyper-tls" name = "hyper-tls"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
dependencies = [ dependencies = [
"bytes", "bytes",
"http-body-util",
"hyper", "hyper",
"hyper-util",
"native-tls", "native-tls",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tower-service",
]
[[package]]
name = "hyper-util"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http",
"http-body",
"hyper",
"pin-project-lite",
"socket2 0.5.6",
"tokio",
"tower",
"tower-service",
"tracing",
] ]
[[package]] [[package]]
@@ -262,7 +314,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown 0.12.3",
]
[[package]]
name = "indexmap"
version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
"equivalent",
"hashbrown 0.14.3",
] ]
[[package]] [[package]]
@@ -295,6 +357,17 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "jsonpath_lib_polars_vendor"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4bd9354947622f7471ff713eacaabdb683ccb13bba4edccaab9860abf480b7d"
dependencies = [
"log",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
@@ -309,9 +382,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.132" version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]] [[package]]
name = "log" name = "log"
@@ -349,7 +422,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"wasi", "wasi",
"windows-sys", "windows-sys 0.36.1",
] ]
[[package]] [[package]]
@@ -399,7 +472,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.99",
] ]
[[package]] [[package]]
@@ -427,6 +500,26 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "pin-project"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.55",
]
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.9" version = "0.2.9"
@@ -447,18 +540,18 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.43" version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@@ -483,9 +576,9 @@ dependencies = [
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.11.18" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" checksum = "e333b1eb9fe677f6893a9efcb0d277a2d3edd83f358a236b657c32301dc6e5f6"
dependencies = [ dependencies = [
"base64", "base64",
"bytes", "bytes",
@@ -495,8 +588,10 @@ dependencies = [
"h2", "h2",
"http", "http",
"http-body", "http-body",
"http-body-util",
"hyper", "hyper",
"hyper-tls", "hyper-tls",
"hyper-util",
"ipnet", "ipnet",
"js-sys", "js-sys",
"log", "log",
@@ -505,9 +600,12 @@ dependencies = [
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"rustls-pemfile",
"serde", "serde",
"serde_json", "serde_json",
"serde_urlencoded", "serde_urlencoded",
"sync_wrapper",
"system-configuration",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tower-service", "tower-service",
@@ -522,11 +620,22 @@ dependencies = [
name = "rust-cache" name = "rust-cache"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"jsonpath_lib_polars_vendor",
"reqwest", "reqwest",
"tikv-jemallocator", "tikv-jemallocator",
"trybuild",
"watto", "watto",
] ]
[[package]]
name = "rustls-pemfile"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
dependencies = [
"base64",
]
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.11" version = "1.0.11"
@@ -540,7 +649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"windows-sys", "windows-sys 0.36.1",
] ]
[[package]] [[package]]
@@ -568,9 +677,23 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.144" version = "1.0.185"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.185"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.55",
]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
@@ -578,6 +701,7 @@ version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
dependencies = [ dependencies = [
"indexmap 1.9.1",
"itoa", "itoa",
"ryu", "ryu",
"serde", "serde",
@@ -604,6 +728,12 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "smallvec"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.4.7" version = "0.4.7"
@@ -614,6 +744,16 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "socket2"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
dependencies = [
"libc",
"windows-sys 0.52.0",
]
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.99" version = "1.0.99"
@@ -625,6 +765,44 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "syn"
version = "2.0.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "sync_wrapper"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "system-configuration"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
dependencies = [
"bitflags",
"core-foundation",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.3.0" version = "3.3.0"
@@ -639,6 +817,15 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.33" version = "1.0.33"
@@ -656,7 +843,7 @@ checksum = "c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.99",
] ]
[[package]] [[package]]
@@ -707,7 +894,7 @@ dependencies = [
"mio", "mio",
"once_cell", "once_cell",
"pin-project-lite", "pin-project-lite",
"socket2", "socket2 0.4.7",
"winapi", "winapi",
] ]
@@ -735,6 +922,28 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite",
"tokio",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower-layer"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
[[package]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.2" version = "0.3.2"
@@ -748,6 +957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"log",
"pin-project-lite", "pin-project-lite",
"tracing-core", "tracing-core",
] ]
@@ -767,6 +977,21 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]]
name = "trybuild"
version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501dbdbb99861e4ab6b60eb6a7493956a9defb644fd034bc4a5ef27c693c8a3a"
dependencies = [
"basic-toml",
"glob",
"once_cell",
"serde",
"serde_derive",
"serde_json",
"termcolor",
]
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.8" version = "0.3.8"
@@ -843,7 +1068,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.99",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -877,7 +1102,7 @@ checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.99",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -923,6 +1148,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "winapi-x86_64-pc-windows-gnu" name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
@@ -935,37 +1169,157 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [ dependencies = [
"windows_aarch64_msvc", "windows_aarch64_msvc 0.36.1",
"windows_i686_gnu", "windows_i686_gnu 0.36.1",
"windows_i686_msvc", "windows_i686_msvc 0.36.1",
"windows_x86_64_gnu", "windows_x86_64_gnu 0.36.1",
"windows_x86_64_msvc", "windows_x86_64_msvc 0.36.1",
] ]
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.4",
]
[[package]]
name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [
"windows_aarch64_gnullvm 0.48.5",
"windows_aarch64_msvc 0.48.5",
"windows_i686_gnu 0.48.5",
"windows_i686_msvc 0.48.5",
"windows_x86_64_gnu 0.48.5",
"windows_x86_64_gnullvm 0.48.5",
"windows_x86_64_msvc 0.48.5",
]
[[package]]
name = "windows-targets"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
dependencies = [
"windows_aarch64_gnullvm 0.52.4",
"windows_aarch64_msvc 0.52.4",
"windows_i686_gnu 0.52.4",
"windows_i686_msvc 0.52.4",
"windows_x86_64_gnu 0.52.4",
"windows_x86_64_gnullvm 0.52.4",
"windows_x86_64_msvc 0.52.4",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.36.1" version = "0.36.1"
@@ -973,10 +1327,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]] [[package]]
name = "winreg" name = "windows_x86_64_msvc"
version = "0.10.1" version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
[[package]]
name = "winreg"
version = "0.50.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
dependencies = [ dependencies = [
"winapi", "cfg-if",
"windows-sys 0.48.0",
] ]

View File

@@ -6,8 +6,12 @@ authors = ["Arpad Borsos <arpad.borsos@googlemail.com>"]
edition = "2021" edition = "2021"
[dependencies] [dependencies]
reqwest = "0.11.18" reqwest = "0.12.1"
jsonpath_lib_polars_vendor = "0.0.1"
watto = { git = "https://github.com/getsentry/watto", rev = "d71c8218506bddba102a124a460d64da25e303dc", features = ["strings"] } watto = { git = "https://github.com/getsentry/watto", rev = "d71c8218506bddba102a124a460d64da25e303dc", features = ["strings"] }
[dev-dependencies]
trybuild = "1"
[target.'cfg(not(target_env = "msvc"))'.dependencies] [target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.5.4" tikv-jemallocator = "0.5.4"

6
tests/tests/trybuild.rs Normal file
View File

@@ -0,0 +1,6 @@
#[test]
fn test_trybuild() {
let t = trybuild::TestCases::new();
t.pass("tests/trybuild/empty_main.rs");
t.compile_fail("tests/trybuild/fail_to_compile.rs");
}

View File

@@ -0,0 +1 @@
fn main() {}

View File

@@ -0,0 +1,3 @@
fn main() {
"foobar".foobar();
}

View File

@@ -0,0 +1,5 @@
error[E0599]: no method named `foobar` found for reference `&'static str` in the current scope
--> tests/trybuild/fail_to_compile.rs:2:14
|
2 | "foobar".foobar();
| ^^^^^^ method not found in `&str`