maidsafe / rust_sodium

This crate is no longer maintained. Looking for maintainers.
BSD 3-Clause "New" or "Revised" License
77 stars 34 forks source link

Port tox-rs from sodiumoxide to rust_sodium #85

Closed kpp closed 5 years ago

kpp commented 5 years ago

Hi!

We would like to port our tox-rs from sodiumoxide to your crate. Is there anything we should know before we start porting our code to your crate? What's the difference between your crate and sodiumoxide?

There are some questions:

  1. How do I use system libsodium to link it to rust_sodium-sys?
  2. How do I force downloading and building libsodium even if I have an installed libsodium?
  3. How do I tell rust_sodium to use libsodium from custom directory?

Did you test your crate on:

  1. ArchLinux?
  2. FreeBSD?
  3. CentOS?
kpp commented 5 years ago

Please help us build it on AppveyorCI, see full build log.

running: "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "bzip2-1.0.6" "-D_WIN32" "-DBZ_EXPORT" "-DBZ_NO_STDIO" "-o" "C:\\projects\\tox\\target\\debug\\build\\bzip2-sys-d0f67c7c306aa840\\out\\bzip2-1.0.6\\blocksort.o" "-c" "bzip2-1.0.6/blocksort.c"
--- stderr
thread 'main' panicked at '
Internal error occurred: Failed to find tool. Is `gcc.exe` installed? (see https://github.com/alexcrichton/cc-rs#compile-time-requirements for help)

our local PR: https://github.com/tox-rs/tox/pull/259

Fraser999 commented 5 years ago

Hi there,

Looks like you're already well on the way to porting, but just to answer your intial questions:

  1. That should just be a case of specifying the path to the lib using the env var RUST_SODIUM_LIB_DIR, or if you've got pkgconfig installed and configured to point to the right copy of libsodium, you can try RUST_SODIUM_USE_PKG_CONFIG=1.
  2. That is the default behaviour of rust_sodium, so as long as you don't specify RUST_SODIUM_LIB_DIR or RUST_SODIUM_USE_PKG_CONFIG it should pull down its own copy.
  3. Same answer as 1.

Regarding "What's the difference between your crate and sodiumoxide?", that's covered in the four bullet points in our readme. We try to bring relelvant updates from sodiumoxide over to rust_sodium periodically, but we have no set schedule for doing so.

Regarding the three OSs you asked about, we don't officially test on any of those. However, some of the team use these as their main dev environment, so the chances are good that rust_sodium works on all of them. Having said that, a breakage on one of these OSs wouldn't be a high priority issue for us (although if we got a PR fixing it, we certainly wouldn't ignore it).

I also had a look at your PR, and see that you've changed from the gnu compiler to the msvc one, which looks to have resolved your issue. The problem was that gcc wasn't installed in your previous attempt. If you do want to revert to using the gnu compiler, you can see how we set up our AppVeyor environment for our own CI tests in this powershell script. It takes care of installing gcc using pacman from a bash instance.

I'll close this issue, since your AppVeyor tests are green now, but of course if you have any further problems/questions, feel free to re-open this or open a new issue.

suhr commented 5 years ago

@Fraser999 We have got an unexpected PDB error: https://ci.appveyor.com/project/kpp/tox/builds/20167512. Do you have an idea why?

Fraser999 commented 5 years ago

No - I don't have any ideas I'm afraid. I can't reproduce this error locally. I suppose it's not a spurious failure? Did you try just re-running the test on AppVeyor?