zboxfs / zbox

Zero-details, privacy-focused in-app file system.
https://zbox.io/fs/
Apache License 2.0
1.53k stars 74 forks source link

bundle libsodium with feature flag #37

Closed xmclark closed 5 years ago

xmclark commented 5 years ago

This PR adds a solution for issue #34. The build script is updated to download, build, and link libsodium statically. On unix, the sources are downloaded, built, and linked statically. On windows, for mingw and msvc, the pre-compiled binaries are downloaded and linked statically. The bundled build is toggled with a feature flag: libsodium-bundled.

I reviewed the contributing guide and tried my best to run the required tests. I made a few changes to test with the new bundled libsodium. I ran the different test commands on my windows box for both mingw and msvc targets. I also ran them on my linux subsystem which is ubuntu (I think?).

cargo test --lib --features libsodium-bundled cargo test --tests --features libsodium-bundled cargo test --doc --features libsodium-bundled cargo test --tests fuzz_test --features libsodium-bundled -- --nocapture cargo test --tests perf_test --release --features test-perf,libsodium-bundled -- --nocapture

I noticed that fuzz_test with storage-faulty did not compile for any of the targets with or without the new bundled libsodium. I am happy to submit a bug if that would help 😄 cargo test --tests fuzz_test --features storage-faulty -- --nocapture

I am happy to make changes, especially if they help with readability. I also would be happy to add a test in travis if that would increase confidence.