Giter Club home page Giter Club logo

rust_sodium's Introduction

rust_sodium's People

Contributors

afck avatar brinchj avatar dbrgn avatar dhardy avatar dirvine avatar dnaq avatar ffflorian avatar frabrunelle avatar gawen avatar h2co3 avatar jacderida avatar kcchu avatar lionel-faber avatar maqi avatar maugier avatar nbaksalyar avatar nshtg avatar oconnor663 avatar pierrechevalier83 avatar pravarseth avatar pshc avatar retep998 avatar s-coyle avatar thedavidmeister avatar ustulation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rust_sodium's Issues

&& instead of || in bad http download logic

in build.rs

    // Only accept 2xx status codes
    if response.status_code() < 200 && response.status_code() >= 300 {
        panic!("Download error: HTTP {}", response.status_code());
    }

should be < 200 || >= 300

windows build failed,use msys2

--- stderr
thread 'main' panicked at '
"powershell" "-Command" "If ($PSVersionTable.PSVersion.Major -lt 4) { exit 1 }"

You must have Powershell v4.0 or greater installed.

mention in the readme that `build-essential` is build essential

this error:

= note: /usr/bin/ld: /tmp/rustc.ZbjniGJ7D9Ug/librust_sodium_sys-24ee5a8b5f6825c1.rlib(libsodium_la-aead_chacha20poly1305.o): relocation R_X86_64_PC32 against symbol `cr
ypto_aead_chacha20poly1305_encrypt_detached' can not be used when making a shared object; recompile with -fPIC

can appear when working with neon on linux even with pie disabled if build-essential is not installed

the readme implies (imo) that build-essential is only needed for cross compiling but it can show up in other edge cases it seems

unfortunately the linker error is very cryptic, it took me a long time to figure out that -fPIC is a red herring and that i was actually missing an apt-get dependency (newer gcc or something?)

Sodiumoxide tracking policy

Do you have any policy regarding tracking of changes from sodiumoxide?

For example, here is a feature that was recently added to sodiumoxide that I'd like to see in rust_sodium as well.

Do you plan on including sodiumoxide changes into rust_sodium from time to time, or would it be better to create a standalone pull request with the functionality?

Use Serde

We have moved to 1.16 and serde is now a reccommended and drop-in replacement for rustc-serialize for attribute deriviations of encodable and decodable. Rustc-serialize is going to be deprecated so we need to update to using serde (sodiumoxide is already using it).

Syntax errors in build.rs

When cargo tries to build the rust_sodium_sys package, it runs into several syntactical errors with make, cc, ar:

>cargo build
.......
ar: `u' modifier ignored since `D' is the default (see `U')
cc: error: 0: No such file or directory
cc: error: RESERVED_FUNCTION_POINTERS=8: No such file or directory
cc: error: unrecognized command line option '--memory-init-file'; did you mean '--warn-init-self'?
cc: error: unrecognized command line option '--pre-js'; did you mean '--prefix'?
make[3]: *** [Makefile:1194: aead_aes256gcm.js] Error 1
make[3]: *** Waiting for unfinished jobs....
cc: error: 0: No such file or directory
cc: error: RESERVED_FUNCTION_POINTERS=8: No such file or directory
cc: error: unrecognized command line option '--memory-init-file'; did you mean '--warn-init-self'?
cc: error: unrecognized command line option '--pre-js'; did you mean '--prefix'?
make[3]: *** [Makefile:1198: aead_chacha20poly1305.js] Error 1
make[2]: *** [Makefile:2176: check-am] Error 2
make[1]: *** [Makefile:394: check-recursive] Error 1
make: *** [Makefile:505: check-recursive] Error 1

', github.com-1ecc6299db9ec823/rust_sodium-sys-0.1.1/build.rs:233

new release?

last release was a year ago

its impossible to publish crates to crates.io if they have a dependency on an unpublished crate

this makes changes like the recent bump to 1.4.0 (needed to unblock lots of other ecosystem crates, e.g. wasmer) impossible to use outside development until a new release is published

Verification of downloaded libsodium

Thanks for providing this crate!

There is something that makes me a bit uneasy though, which is the fact that the downloaded libsodium library is not checked during the build.

Could we maybe verify SHA256 checksums of the downloads in the build script?

put lib directly in the repo?

the build step that downloads the tarballs is a source of sporadic build failures for us

we see it both on CI and developing locally

occasionally something will go wrong in the download and the hash will be incorrect, failing the build in a very cryptic way

given that only one version at a time is supported anyway (1.0.16 atm) why not simply include the extracted tarball in this repo, or setup a git submodule or something?

Build requires openssl

Seems that because of the reqwest dependency for building, it also pulls in hyper-tls which uses openssl which is kind of unfortunate.

Fail to build systest

humbug@home:~/rust_sodium$ cd systest/
humbug@home:~/rust_sodium/systest$ cargo build
   Compiling systest v0.2.0 (/home/humbug/rust_sodium/systest)                                                
error: failed to run custom build command for `systest v0.2.0 (/home/humbug/rust_sodium/systest)`             
process didn't exit successfully: `/home/humbug/rust_sodium/systest/target/debug/build/systest-5c31c2dd026bdef3/build-script-build` (exit code: 101)
--- stderr
../rust_sodium-sys/src/bindgen.rs:1366:14: 1366:16 error: expected ident, found `64`
../rust_sodium-sys/src/bindgen.rs:1366 #[repr(align(64))]
                                                    ^~
error: aborting due to previous error
thread 'main' panicked at 'Box<Any>', /home/humbug/.cargo/registry/src/github.com-1ecc6299db9ec823/syntex_syntax-0.27.0/src/errors/mod.rs:607:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
$ rustc -vV
rustc 1.30.1 (1433507eb 2018-11-07)
binary: rustc
commit-hash: 1433507eba7d1a114e4c6f27ae0e1a74f60f20de
commit-date: 2018-11-07
host: x86_64-unknown-linux-gnu
release: 1.30.1
LLVM version: 8.0

Port tox-rs from sodiumoxide to rust_sodium

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?

Is this library still maintained?

Hi, I'm currently trying to tidy up the bindings linked on the libsodium website. If this library is still maintained, then please let me know; otherwise, the link to this library will likely be removed from the bindings page to help users find up to date and maintained bindings.

I take it from #115 that it's not.

MacOS Catalina build error

error: failed to run custom build command for rust_sodium-sys v0.10.4

Caused by:
process didn't exit successfully: /Users/xxx/code/holochain/sim2h/target/debug/build/rust_sodium-sys-2e21ff8278bca277/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=RUST_SODIUM_LIB_DIR
cargo:rerun-if-env-changed=RUST_SODIUM_USE_PKG_CONFIG
cargo:rerun-if-env-changed=RUST_SODIUM_SHARED
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
cargo:rerun-if-env-changed=RUST_SODIUM_DISABLE_PIE

--- stderr
thread 'main' panicked at 'Failed to run './configure': No such file or directory (os error 2)
', /Users/xxx/code/holochain/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_sodium-sys-0.10.4/build.rs:393:13
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:339
9: build_script_build::get_libsodium::{{closure}}
at ./build.rs:393
10: core::result::Result<T,E>::unwrap_or_else
at /rustc/69656fa4cbafc378fd63f9186d93b0df3cdd9320/src/libcore/result.rs:818
11: build_script_build::get_libsodium
at ./build.rs:386
12: build_script_build::main
at ./build.rs:80
13: std::rt::lang_start::{{closure}}
at /rustc/69656fa4cbafc378fd63f9186d93b0df3cdd9320/src/libstd/rt.rs:64
14: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
15: std::panicking::try::do_call
at src/libstd/panicking.rs:296
16: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:82
17: std::panicking::try
at src/libstd/panicking.rs:275
18: std::panic::catch_unwind
at src/libstd/panic.rs:394
19: std::rt::lang_start_internal
at src/libstd/rt.rs:48
20: std::rt::lang_start
at /rustc/69656fa4cbafc378fd63f9186d93b0df3cdd9320/src/libstd/rt.rs:64

warning: build failed, waiting for other jobs to finish...
error: build failed

[Windows] File not found

Hi MaidSafe, thanks to #33 we are successfully building neon projects with libsodium cross-platform ๐Ÿ™‚ ... well, almost.

When I try building rust_sodium in a Jenkins Windows job, I get the error "The system cannot find the path specified". On Linux and macOS there is no such problem... It is possible that this is a Jenkins error, but maybe you have an idea what this could be about?

Here is the full log:

[...]
Compiling rust_sodium-sys v0.2.0 (https://github.com/maidsafe/rust_sodium?rev=a1a17b261a0081b94e10179a11816c7894708f34#a1a17b26)
error: failed to run custom build command for `rust_sodium-sys v0.2.0 (https://github.com/maidsafe/rust_sodium?rev=a1a17b261a0081b94e10179a11816c7894708f34#a1a17b26)`
process didn't exit successfully: `C:\Users\jenkins\Documents\jenkins\workspace\Wrapper Windows Production\electron\node_modules\libsodium-neon\native\target\release\build\rust_sodium-sys-95df8c375f7de787\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at '

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!   unwrap! called on Result::Err                                              !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
C:\Users\jenkins\.cargo\git\checkouts\rust_sodium-55555f070d27ffcc\a1a17b2\rust_sodium-sys\build.rs:154,27 in build_script_build

Err(
    Error {
        repr: Os {
            code: 3,
            message: "The system cannot find the path specified."
        }
    }
)

', C:\Users\jenkins\.cargo\registry\src\github.com-1ecc6299db9ec823\unwrap-1.1.0\src\lib.rs:67
note: Run with `RUST_BACKTRACE=1` for a backtrace.

neon ERR! cargo build failed

Thanks in advance for your help!

Fail to build on nightly: private_no_mangle_fns, private_no_mangle_statics

humbug@home:~/rust_sodium$ rustup default nightly
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'

  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.32.0-nightly (65204a97d 2018-11-12)

humbug@home:~/rust_sodium$ cargo build
   Compiling rust_sodium-sys v0.10.2 (/home/humbug/rust_sodium/rust_sodium-sys)
error: lint `private_no_mangle_fns` has been removed: `no longer an warning, #[no_mangle] functions always exported`
  --> rust_sodium-sys/src/lib.rs:11:24
   |
11 |     plugin_as_library, private_no_mangle_fns, private_no_mangle_statics, stable_features,
   |                        ^^^^^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> rust_sodium-sys/src/lib.rs:7:90
   |
7  |     exceeding_bitshifts, mutable_transmutes, no_mangle_const_items, unknown_crate_types, warnings
   |                                                                                          ^^^^^^^^
   = note: #[forbid(renamed_and_removed_lints)] implied by #[forbid(warnings)]

error: lint `private_no_mangle_statics` has been removed: `no longer an warning, #[no_mangle] statics always exported`
  --> rust_sodium-sys/src/lib.rs:11:47
   |
11 |     plugin_as_library, private_no_mangle_fns, private_no_mangle_statics, stable_features,
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile `rust_sodium-sys`.

To learn more, run the command again with --verbose.
humbug@home:~/rust_sodium$ rustc -vV
rustc 1.32.0-nightly (65204a97d 2018-11-12)
binary: rustc
commit-hash: 65204a97d4876b897df0a70c0b9248b57e2bf057
commit-date: 2018-11-12
host: x86_64-unknown-linux-gnu
release: 1.32.0-nightly
LLVM version: 8.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.