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

Support mulitple processes on same download dir #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BaxHugh
Copy link

@BaxHugh BaxHugh commented Nov 21, 2024

Thanks @jdahlq for this crate!

I have a cargo workspace where a few crates are all using protoc-fetcher in their build.rs script. Some of them depend on other crates too.
When I run cargo build on the workspace, or on a crate that has a dependency also using protoc-fetcher, protoc-fetcher runs in multiple instances at the same time on the same download directory (i.e. only one download directory for the cargo workspace)

I took a while to figure out what the issue was, but it's that there's multiple writes happening to the same dir at the same time.
I've added a test for this case and have implemented a lock file to solve the issue.

Other changes I implemented while figuring out the issue in this PR:
use zip crate instead of zip-extract
updated dependencies
add additional context to failures with anyhow::Context, since I was seeing "Permissions Error" with no context, that made debugging difficult.

… once, all use protoc-fetcher

Currently this test fails on my machine
in an attempt to improve performance in concurrent usage test
zip has far more  downloads than zip-extract so assume it's a better solution
@BaxHugh BaxHugh force-pushed the fix/support-mulitple-processes-on-same-download-dir branch from 952d0f8 to 80da248 Compare November 22, 2024 11:43
@BaxHugh BaxHugh force-pushed the fix/support-mulitple-processes-on-same-download-dir branch from 80da248 to ac3c521 Compare November 22, 2024 11:43
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.

1 participant