tch-rs
tch-rs copied to clipboard
Use windows unicode paths to get around windows 260 char path limit.
libtorch
fails to extract on Windows when the project is near the 260 char windows path limit, this adds a windows check and adjusts the path. Secondly, this normalizes paths using to_verbatim
, normalizing paths should fix any issues while using a custom CARGO_TARGET_DIR
on Windows. This PR still needs some work.
Accidentally closed this. Anyhow while this does fix the extraction issues on windows by using the long unicode paths, it reveals a new issue. MSVC's compiler driver cl.exe fails to find certain include headers when building, which coincidentally are longer than 260 characters on my windows file system. I'm not sure if there's a flag that could be passed through cc
that could fix this, might be an unresolved cl
issue.
I'm currently working with a much older commit (0.3.1), I've made changes that provide linux function fallbacks without looking as bad as this PR with the cfg macros. Most likely will forward port later when I've resolved the cl issues.