frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

Path manipulation code assumes a Unix filesystem, fails on Windows #93

Closed obi1kenobi closed 1 year ago

obi1kenobi commented 1 year ago

Example failure:

Error: failed to make directory 'C:\Users\runneradmin\.cargo\registry/index\github.com-1ecc6299db9ec823': The system cannot find the path specified.
; class=Os (2)

Encountered in: https://github.com/obi1kenobi/cargo-semver-checks-action/pull/21#issuecomment-1374964447

Appears to correspond to this bit of path manipulation code, which hardcodes a / path separator: https://github.com/frewsxcv/rust-crates-index/blob/11fd70142de64a87eb490a15273c0abd3455853d/src/bare_index.rs#L86

I also noticed another bit of code that also appears to hardcode a / path separator, though it's a bit tricky to replicate: https://github.com/frewsxcv/rust-crates-index/blob/11fd70142de64a87eb490a15273c0abd3455853d/src/bare_index.rs#L17