quininer/sarkara

Failure to build with latest nightly

Closed this issue · 6 comments

Hey there today I tried to build sarkara, unfortunately I am encountering some errors (report below). After tracking down the messages I can find it comes from some changes in the latest nightly, unfortunately I don't have much ideas on how to fix that.

Please find here the complete track:

someone@NAME 9:14 ~/Documents/PQ/sarkara rm -rf ~/.cargo                                                                                                    [master] git:sarkara
someone@NAME 9:14 ~/Documents/PQ/sarkara ll                                                                                                                 [master] git:sarkara
total 40
-rw-r--r--  1 eliott eliott  430 30 nov.  20:28 appveyor.yml
drwxr-xr-x  2 eliott eliott 4096 30 nov.  20:28 benches
-rw-r--r--  1 eliott eliott 9387  2 déc.  08:51 Cargo.lock
-rw-r--r--  1 eliott eliott  758  2 déc.  09:11 Cargo.toml
-rw-r--r--  1 eliott eliott 1073 30 nov.  20:28 LICENSE
-rw-r--r--  1 eliott eliott 2348 30 nov.  20:28 README.md
drwxr-xr-x 12 eliott eliott 4096 30 nov.  20:28 src
drwxr-xr-x  4 eliott eliott 4096  2 déc.  08:52 target
someone@NAME 9:14 ~/Documents/PQ/sarkara cargo update                                                                                                       [master] git:sarkara
    Updating registry `https://github.com/rust-lang/crates.io-index`
someone@NAME 9:15 ~/Documents/PQ/sarkara cargo test                                                                                                         [master] git:sarkara
 Downloading hc256 v0.1.6
 Downloading blissb v0.2.3                                                      
 Downloading blake2-rfc v0.2.18                                                 
 Downloading byteorder v1.2.1                                                   
 Downloading argon2rs v0.2.5                                                    
 Downloading seckey v0.6.1                                                      
 Downloading rand v0.3.18                                                       
 Downloading ascon v0.1.4                                                       
 Downloading newhope v0.2.0                                                     
 Downloading bitpack v0.2.1                                                     
 Downloading tiny-keccak v1.4.0                                                 
 Downloading libc v0.2.34                                                       
 Downloading arrayvec v0.4.6                                                    
 Downloading constant_time_eq v0.1.3                                            
 Downloading nodrop v0.1.12                                                     
 Downloading scoped_threadpool v0.1.8                                           
 Downloading memsec v0.3.4                                                      
   Compiling sarkara v0.8.0 (file:///home/eliott/Documents/PQ/sarkara)          
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::PrivateKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
116 | / new_type!(
117 | |     /// Newhope private key.
118 | |     pub struct PrivateKey(pub Key<[u16; N]>);
119 | |     from: (input) {
...   |
129 | |     }
130 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::PublicKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
132 | / new_type!(
133 | |     /// Newhope public key.
134 | |     pub struct PublicKey(pub [u8; SENDABYTES]);
135 | |     from: (input) {
...   |
147 | |     }
148 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::Reconciliation`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
150 | / new_type!(
151 | |     /// Newhope reconciliation data.
152 | |     pub struct Reconciliation(pub [u8; SENDBBYTES]);
153 | |     from: (input) {
...   |
165 | |     }
166 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::PrivateKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
84  | / new_type!(
85  | |     /// BLISS private key.
86  | |     pub struct PrivateKey(pub Key<::blissb::PrivateKey>);
87  | |     from: (input) {
...   |
102 | |     }
103 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::PublicKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
105 | / new_type!(
106 | |     /// BLISS public key.
107 | |     pub struct PublicKey(pub ::blissb::PublicKey);
108 | |     from: (input) {
...   |
123 | |     }
124 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::SignatureData`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
126 | / new_type!(
127 | |     /// BLISS signature.
128 | |     pub struct SignatureData(pub ::blissb::Signature);
129 | |     from: (input) {
...   |
144 | |     }
145 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::PrivateKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
116 | / new_type!(
117 | |     /// Newhope private key.
118 | |     pub struct PrivateKey(pub Key<[u16; N]>);
119 | |     from: (input) {
...   |
129 | |     }
130 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::PublicKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
132 | / new_type!(
133 | |     /// Newhope public key.
134 | |     pub struct PublicKey(pub [u8; SENDABYTES]);
135 | |     from: (input) {
...   |
147 | |     }
148 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `kex::newhope::Reconciliation`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/kex/newhope.rs
    |
150 | / new_type!(
151 | |     /// Newhope reconciliation data.
152 | |     pub struct Reconciliation(pub [u8; SENDBBYTES]);
153 | |     from: (input) {
...   |
165 | |     }
166 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::PrivateKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
84  | / new_type!(
85  | |     /// BLISS private key.
86  | |     pub struct PrivateKey(pub Key<::blissb::PrivateKey>);
87  | |     from: (input) {
...   |
102 | |     }
103 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::PublicKey`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
105 | / new_type!(
106 | |     /// BLISS public key.
107 | |     pub struct PublicKey(pub ::blissb::PublicKey);
108 | |     from: (input) {
...   |
123 | |     }
124 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error[E0119]: conflicting implementations of trait `std::convert::TryFrom<_>` for type `sign::bliss::SignatureData`:
   --> src/utils/mod.rs:18:9
    |
18  | /         impl<T> TryFrom<T> for $name where T: AsRef<[u8]> {
19  | |             type Error = io::Error;
20  | |             fn try_from($input_from: T) -> io::Result<Self> {
21  | |                 let $input_from = $input_from.as_ref();
22  | |                 $from
23  | |             }
24  | |         }
    | |_________^
    | 
   ::: src/sign/bliss.rs
    |
126 | / new_type!(
127 | |     /// BLISS signature.
128 | |     pub struct SignatureData(pub ::blissb::Signature);
129 | |     from: (input) {
...   |
144 | |     }
145 | | );
    | |__- in this macro invocation
    |
    = note: conflicting implementation in crate `core`:
            - impl<T, U> std::convert::TryFrom<U> for T
              where T: std::convert::From<U>;

error: aborting due to 6 previous errors

error: Could not compile `sarkara`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to 6 previous errors

error: Could not compile `sarkara`.

To learn more, run the command again with --verbose.
zsh: exit 101   cargo test
someone@NAME 9:15 ~/Documents/PQ/sarkara                                                                                                                    [master] git:sarkara

Found a reference issue on rust-lang/rust#33417

rust-lang/rust#33417 (comment) seems to be the explanation

I have downgraded my toolchain to nightly-2017-08-03, this made the trick, I also found a project with a similar issue fixed in fschutt/printpdf@a834572, I may attempt to submit a similar pull request when I have time

I don't know what you did, it seems that newhope has been removed from the main branch, so now everything is fine, even with the latest stable, so closing this.

sarkara is rewriting, which happens on the 0.10 branch.

Nice then 😏