Support for trybuild and similar macro testing tools#168
Support for trybuild and similar macro testing tools#168Swatinem merged 3 commits intoSwatinem:masterfrom
trybuild and similar macro testing tools#168Conversation
190518b to
a15c3f6
Compare
|
Hi @Swatinem, let me know if I can assist with the review in any way! 😄 |
Swatinem
left a comment
There was a problem hiding this comment.
I believe that should do the trick.
There isn’t really a lot of testing going on with rust-cache except running various cargo test variants to see if things are properly cached or not.
Signed-off-by: Filippo Costa <filippo@neysofu.me>
|
Thanks for the review! I had to fix CI (forgot to run |
|
However the caching does not fully work I believe: |
|
I suspect it's because the first run didn't include the changes to Can we try deleting the cache and doing 2 runs of |
|
Oh yeah indeed, that would explain it. Let me delete the cache and rerun this as you suggested. |
|
Works like a charm, thanks! |
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) | action | minor | `v2.6.2` -> `v2.7.0` | --- ### Release Notes <details> <summary>Swatinem/rust-cache (Swatinem/rust-cache)</summary> ### [`v2.7.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.2...v2.7.0) #### What's Changed - Fix save-if documentation in readme by [@​rukai](https://github.com/rukai) in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - Support for `trybuild` and similar macro testing tools by [@​neysofu](https://github.com/neysofu) in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) #### New Contributors - [@​rukai](https://github.com/rukai) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - [@​neysofu](https://github.com/neysofu) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) **Full Changelog**: Swatinem/rust-cache@v2.6.2...v2.7.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Mogyuchi/gh-test). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) | minor | `v2` -> `v2.7.2` | --- ### Release Notes <details> <summary>Swatinem/rust-cache (Swatinem/rust-cache)</summary> ### [`v2.7.2`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.2) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.7.0...v2.7.2) #### What's Changed - Update action runtime to `node20` by [@​rhysd](https://github.com/rhysd) in [https://github.com/Swatinem/rust-cache/pull/175](https://github.com/Swatinem/rust-cache/pull/175) - Only key by `Cargo.toml` and `Cargo.lock` files of workspace members by [@​max-heller](https://github.com/max-heller) in [https://github.com/Swatinem/rust-cache/pull/180](https://github.com/Swatinem/rust-cache/pull/180) #### New Contributors - [@​rhysd](https://github.com/rhysd) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/175](https://github.com/Swatinem/rust-cache/pull/175) - [@​max-heller](https://github.com/max-heller) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/180](https://github.com/Swatinem/rust-cache/pull/180) **Full Changelog**: Swatinem/rust-cache@v2.7.1...v2.7.2 ### [`v2.7.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.2...v2.7.0) ##### What's Changed - Fix save-if documentation in readme by [@​rukai](https://github.com/rukai) in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - Support for `trybuild` and similar macro testing tools by [@​neysofu](https://github.com/neysofu) in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) ##### New Contributors - [@​rukai](https://github.com/rukai) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - [@​neysofu](https://github.com/neysofu) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) **Full Changelog**: Swatinem/rust-cache@v2.6.2...v2.7.0 ### [`v2.6.2`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.2) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.1...v2.6.2) ##### What's Changed - dep: Use `smol-toml` instead of `toml` by [@​NobodyXu](https://github.com/NobodyXu) in [https://github.com/Swatinem/rust-cache/pull/164](https://github.com/Swatinem/rust-cache/pull/164) **Full Changelog**: Swatinem/rust-cache@v2...v2.6.2 ### [`v2.6.1`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.0...v2.6.1) - Fix hash contributions of `Cargo.lock`/`Cargo.toml` files. ### [`v2.6.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.5.1...v2.6.0) ##### What's Changed - Add "buildjet" as a second `cache-provider` backend [@​joroshiba](https://github.com/joroshiba) in [https://github.com/Swatinem/rust-cache/pull/154](https://github.com/Swatinem/rust-cache/pull/154) - Clean up sparse registry index. - Do not clean up src of `-sys` crates. - Remove `.cargo/credentials.toml` before saving. ##### New Contributors - [@​joroshiba](https://github.com/joroshiba) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/154](https://github.com/Swatinem/rust-cache/pull/154) **Full Changelog**: Swatinem/rust-cache@v2.5.1...v2.6.0 ### [`v2.5.1`](https://github.com/Swatinem/rust-cache/releases/tag/v2.5.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.5.0...v2.5.1) - Fix hash contribution of `Cargo.lock`. ### [`v2.5.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.5.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.4.0...v2.5.0) ##### What's Changed - feat: Rm workspace crates version before caching by [@​NobodyXu](https://github.com/NobodyXu) in [https://github.com/Swatinem/rust-cache/pull/147](https://github.com/Swatinem/rust-cache/pull/147) - feat: Add hash of `.cargo/config.toml` to key by [@​NobodyXu](https://github.com/NobodyXu) in [https://github.com/Swatinem/rust-cache/pull/149](https://github.com/Swatinem/rust-cache/pull/149) ##### New Contributors - [@​NobodyXu](https://github.com/NobodyXu) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/147](https://github.com/Swatinem/rust-cache/pull/147) **Full Changelog**: Swatinem/rust-cache@v2.4.0...v2.5.0 ### [`v2.4.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.4.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.3.0...v2.4.0) - Fix cache key stability. - Use 8 character hash components to reduce the key length, making it more readable. ### [`v2.3.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.3.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.2.1...v2.3.0) - Add `cache-all-crates` option, which enables caching of crates installed by workflows. - Add installed packages to cache key, so changes to workflows that install rust tools are detected and cached properly. - Fix cache restore failures due to upstream bug. - Fix `EISDIR` error due to globed directories. - Update runtime `@actions/cache`, `@actions/io` and dev `typescript` dependencies. - Update `npm run prepare` so it creates distribution files with the right line endings. ### [`v2.2.1`](https://github.com/Swatinem/rust-cache/releases/tag/v2.2.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.2.0...v2.2.1) - Update `@actions/cache` dependency to fix usage of `zstd` compression. ### [`v2.2.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.2.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.1.0...v2.2.0) - Add new `save-if` option to always restore, but only conditionally save the cache. ### [`v2.1.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.1.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.0.2...v2.1.0) - Only hash `Cargo.{lock,toml}` files in the configured workspace directories. ### [`v2.0.2`](https://github.com/Swatinem/rust-cache/releases/tag/v2.0.2) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.0.1...v2.0.2) - Avoid calling cargo metadata on pre-cleanup. - Added `prefix-key`, `cache-directories` and `cache-targets` options. ### [`v2.0.1`](https://github.com/Swatinem/rust-cache/releases/tag/v2.0.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2...v2.0.1) - Primarily just updating dependencies to fix GitHub deprecation notices. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/knope-dev/knope). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjcuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) | action | minor | `v2.5.1` -> `v2.7.3` | --- ### Release Notes <details> <summary>Swatinem/rust-cache (Swatinem/rust-cache)</summary> ### [`v2.7.3`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.3) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.7.2...v2.7.3) - Work around upstream problem that causes cache saving to hang for minutes. **Full Changelog**: Swatinem/rust-cache@v2.7.2...v2.7.3 ### [`v2.7.2`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.2) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.7.1...v2.7.2) ##### What's Changed - Update action runtime to `node20` by [@​rhysd](https://github.com/rhysd) in [https://github.com/Swatinem/rust-cache/pull/175](https://github.com/Swatinem/rust-cache/pull/175) - Only key by `Cargo.toml` and `Cargo.lock` files of workspace members by [@​max-heller](https://github.com/max-heller) in [https://github.com/Swatinem/rust-cache/pull/180](https://github.com/Swatinem/rust-cache/pull/180) ##### New Contributors - [@​rhysd](https://github.com/rhysd) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/175](https://github.com/Swatinem/rust-cache/pull/175) - [@​max-heller](https://github.com/max-heller) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/180](https://github.com/Swatinem/rust-cache/pull/180) **Full Changelog**: Swatinem/rust-cache@v2.7.1...v2.7.2 ### [`v2.7.1`](https://github.com/Swatinem/rust-cache/compare/v2.7.0...v2.7.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.7.0...v2.7.1) ### [`v2.7.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.7.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.2...v2.7.0) ##### What's Changed - Fix save-if documentation in readme by [@​rukai](https://github.com/rukai) in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - Support for `trybuild` and similar macro testing tools by [@​neysofu](https://github.com/neysofu) in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) ##### New Contributors - [@​rukai](https://github.com/rukai) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/166](https://github.com/Swatinem/rust-cache/pull/166) - [@​neysofu](https://github.com/neysofu) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/168](https://github.com/Swatinem/rust-cache/pull/168) **Full Changelog**: Swatinem/rust-cache@v2.6.2...v2.7.0 ### [`v2.6.2`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.2) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.1...v2.6.2) ##### What's Changed - dep: Use `smol-toml` instead of `toml` by [@​NobodyXu](https://github.com/NobodyXu) in [https://github.com/Swatinem/rust-cache/pull/164](https://github.com/Swatinem/rust-cache/pull/164) **Full Changelog**: Swatinem/rust-cache@v2...v2.6.2 ### [`v2.6.1`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.1) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.6.0...v2.6.1) - Fix hash contributions of `Cargo.lock`/`Cargo.toml` files. ### [`v2.6.0`](https://github.com/Swatinem/rust-cache/releases/tag/v2.6.0) [Compare Source](https://github.com/Swatinem/rust-cache/compare/v2.5.1...v2.6.0) ##### What's Changed - Add "buildjet" as a second `cache-provider` backend [@​joroshiba](https://github.com/joroshiba) in [https://github.com/Swatinem/rust-cache/pull/154](https://github.com/Swatinem/rust-cache/pull/154) - Clean up sparse registry index. - Do not clean up src of `-sys` crates. - Remove `.cargo/credentials.toml` before saving. ##### New Contributors - [@​joroshiba](https://github.com/joroshiba) made their first contribution in [https://github.com/Swatinem/rust-cache/pull/154](https://github.com/Swatinem/rust-cache/pull/154) **Full Changelog**: Swatinem/rust-cache@v2.5.1...v2.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/zharinov/verver). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzcuMTI3LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
https://github.com/dtolnay/trybuild is a Rust testing utility that invokes
rustcon user-provided source files and tests whether they run successfully or fail to compile. Given how popular it is in the ecosystem, and how easy it would be to support it, I think it makes sense to introduce some logic to handle this correctly. This PR adds support fortrybuildand a few other crates in the category:target/tests/targetforkaosandmacrotest;target/tests/trybuildfortrybuild.As far as I know
testsis not used by any other popular crates, so there should be no conflicts. These are quite ordinary nested target directories and the code changes are trivial. I might need some help with the testing, though – not sure how the current setup works. I'm allowing edits by maintainers so you can push directly to this branch, if you so prefer, I don't mind.Relevant issues in other repositories:
trybuilddependencies Sovereign-Labs/sovereign-sdk#735 (that's me!)Thank you so much for the action, by the way! I use it a bunch 😄