Compiling safe_app 0.6.0 fails on rust_sodium-sys


#1

Hi, I just tried to compile safe_app 0.6.0, running cargo build --release --target=x86_64-pc-windows-msvc, on windows 10. Has worked fine previously (0.4.0). But I’m getting an error now on rust_sodium-sys. And I have no idea really what this is. I guess it’s not really SAFE related, but maybe someone knows what’s going on?

My rust version is 1.27.0

error[E0277]: the trait bound `[u8; 64]: std::clone::Clone` is not satisfied
 --> C:\Users\oetyng\.cargo\registry\src\github.com-1ecc6299db9ec823\rust_sodium-sys-0.7.1\src/crypto_hash_sha256.rs:8:5
  |
8 |     buf: [u8; 64],
  |     ^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `[u8; 64]`
  |
  = help: the following implementations were found:
            <[T; 3] as std::clone::Clone>
            <[T; 28] as std::clone::Clone>
            <[T; 19] as std::clone::Clone>
            <[T; 17] as std::clone::Clone>
          and 29 others
  = note: required by `std::clone::AssertParamIsClone`

error[E0277]: the trait bound `[u8; 128]: std::clone::Clone` is not satisfied
 --> C:\Users\oetyng\.cargo\registry\src\github.com-1ecc6299db9ec823\rust_sodium-sys-0.7.1\src/crypto_hash_sha512.rs:8:5
  |
8 |     buf: [u8; 128],
  |     ^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `[u8; 128]`
  |
  = help: the following implementations were found:
            <[T; 3] as std::clone::Clone>
            <[T; 28] as std::clone::Clone>
            <[T; 19] as std::clone::Clone>
            <[T; 17] as std::clone::Clone>
          and 29 others
  = note: required by `std::clone::AssertParamIsClone`

error: aborting due to 2 previous errors

The following warnings were emitted during compilation:

warning: Failed to download libsodium from https://download.libsodium.org/libsodium/releases/libsodium-1.0.12-msvc.zip.  Falling back to MaidSafe mirror at https://raw.githubusercontent.com/maidsafe/QA/master/appveyor/libsodium-1.0.12-msvc.zip

error: Could not compile `rust_sodium-sys`.
warning: build failed, waiting for other jobs to finish...
error: build failed

#2

Hey @oetyng

Thanks for the heads-up, but I’m not able to replicate this error. Can you just confirm the exact version of Rust you’re using and the latest commit in safe_client_libs please? For me I have the following:

I:\MaidSafe\Rust\SuperProject\SAFE Client Libs\safe_app>rustc --version
rustc 1.27.0-nightly (7360d6dd6 2018-04-15)

I:\MaidSafe\Rust\SuperProject\SAFE Client Libs\safe_app>git rev-parse HEAD
03cc35227d22f2331760330792a4d2d7b2a29e06

#3

Hmhmm - when using ‘an old repository’ for building stuff I had trouble in the past once or twice until I did a cargo update and maybe some other command to get rid of old data

Just thinking loud


#4

That’s generally a good call, but we’ve actually committed the Cargo.lock file to the safe_client_libs repo to nail down the dependencies’ versions, so that should avoid the need to run cargo update. In fact, updating might cause the build to break (although that’s not the case here).


#5

Ah - I’m guessing you’re actually using Rust 1.20? This limitation was fixed in 1.21 (see the first paragraph under “Library stabilizations” in this announcement).

I just tried with rustc 1.20 and saw the same error you reported.


#6

Aah, that’s right, I was actually still on it…! Oh gosh, I hadn’t double checked after updating. I actually did notice I had an old version (1.20) and because of this error I upgraded - or so I thought! But I didn’t override in the directory… Hm :roll_eyes:

So, I did a rustup update and I got to 1.25.0 and now rust_sodium-sys-0.7.1 compiles, and 0.6.0 is compiled and done (03cc35227d22f2331760330792a4d2d7b2a29e06).

Thanks @Fraser, and sorry for the trouble.


#7

No probs :slight_smile:


#8

Glad to see you’re up and running @oetyng and thanks to @Fraser for takin’ care o’ bidness.
I’m going to close off the issue now. :slight_smile:


#9