in my library's build.rs, i need to download and cache prebuilt library from github release. my problem is where's the best directory for doing this, how to avoid race, and if there are some helping tools.
existing crates: ort-sys donwloads to user cache dir. seems no race protection. tensorflow-sys downloads to OUT_DIR. no race protection. but cargo build already has lock, so it's fine?
my prebulit library is about 20M for each arch.
update: found cached-path useful for download, unzip and cache in one call.
downloads to OUT_DIR. no race protection. but cargo build already has lock, so it's fine?
Yes, that should be fine. Lots of things would break if build scripts could be run overlapped like that. You get the unique OUT_DIR and you get assurance only one build script run will be accessing it.