zbox icon indicating copy to clipboard operation
zbox copied to clipboard

Fixed windows msvc download_and_install_libsodium in build.rs

Open raccoman opened this issue 2 years ago • 1 comments

I was recently working on a project using zboz, from windows with msvc.

I noticed that whenever I add the "libsodium-bundled" feature, cargo throws a File Not Found error, more precisely it cannot find libsodium.lib in the temporary ZIP archive. I checked and indeed the path is wrong. Currently I understand it to be:

  • libsodium/x64/Release/v142/static/libsodium.lib
  • libsodium/Win32/Release/v142/static/libsodium.lib

Also after changing the paths, cargo throws another error but this time from reqwest: "reqwest::get" is asynchronous. I added the "blocking" feature in Cargo.toml only in the windows target and changed the code to "reqwest::blocking::get"

raccoman avatar Dec 02 '22 11:12 raccoman

As a side note, you should really use libsodium-stable rather than the old point release.

No security issues to worry about, but portability has been improved, as well as performance. AES-GCM for example, is 2.5 times faster.

The libsodium-sys-stable crate also bundles libsodium, and is constantly updated. Maybe a better place to add Windows support, if it doesn't already support it?

jedisct1 avatar Dec 02 '22 15:12 jedisct1