Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Cache .crates2.json and .crates.toml #120

Merged
merged 6 commits into from
Dec 25, 2024

Conversation

yutannihilation
Copy link
Contributor

This pull request should fix this error. (Clearing cache might be needed)

error: binary `wasm-pack` already exists in destination
Add --force to overwrite
Error: Process completed with exit code 101.

It seems cargo install uses specific files to store information about the installed crates. This seems the same issue:

https://users.rust-lang.org/t/get-cargo-install-to-fail-silently-if-the-binary-already-exists/99507/2

The answer suggests to cache ~/.cargo/.crates.toml and ~/.cargo/.crates2.json. According to Cargo's document, these two files are used by cargo install. I'm not sure if both files are needed, but caching this just worked fine.

.crates.toml, .crates2.json These hidden files contain package information of crates installed via cargo install. Do NOT edit by hand!
(https://doc.rust-lang.org/cargo/guide/cargo-home.html)

Test run: https://github.com/yutannihilation/mimium-rs/actions/runs/12488356953/job/34850638474#step:5:10

@tomoyanonymous
Copy link
Collaborator

Thanks, I added or command chain(which wasm-pack || cargo install wasm-pack), suggested at the thread at main branch a47e6df , which isn't merged back to dev.
The build succeeds with that workaround but I'll merge this because it looks more consistent

@tomoyanonymous tomoyanonymous merged commit 1851962 into mimium-org:dev Dec 25, 2024
9 checks passed
@yutannihilation
Copy link
Contributor Author

Oh, I didn't notice the commit. Either should be fine!

@yutannihilation yutannihilation deleted the ci/cache-crates2.json branch December 25, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants