deislabs / bindle

Bindle: Object Storage for Collections
Apache License 2.0
263 stars 37 forks source link

build error in Mac M1 #326

Closed VishnuJin closed 2 years ago

VishnuJin commented 2 years ago

hey guys, I tried to build our main branch and it throws many errors related to cpu architecture

error: no rules expected the token `aarch64_apple`

Rustup Version

❯ rustup -V                                                                  ─╯
rustup 1.24.3 (2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.59.0 (9d1b2106e 2022-02-23)`

Cargo Version

❯ cargo -V                                                                   ─╯
cargo 1.59.0 (49d8809dc 2022-02-10)

rustup default

❯ rustup default                                                             ─╯
nightly-aarch64-apple-darwin (default)

Full Error Log

❯ make build                                                                 ─╯
cargo build --features cli --bin bindle-server
   Compiling ring v0.16.20
   Compiling crypto-common v0.1.3
   Compiling digest v0.9.0
   Compiling block-buffer v0.9.0
   Compiling block-buffer v0.10.2
   Compiling inout v0.1.2
   Compiling regex v1.5.5
   Compiling flate2 v1.0.22
error: no rules expected the token `aarch64_apple`
   --> /Users/vishnujin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:257:13
    |
165 |     macro_rules! features {
    |     --------------------- when calling this macro
...
257 |             aarch64_apple: true,
    |             ^^^^^^^^^^^^^ no rules expected this token in macro call

error[E0425]: cannot find value `AES` in module `cpu::arm`
   --> /Users/vishnujin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/aead/aes.rs:381:65
    |
381 |         if cpu::intel::AES.available(cpu_features) || cpu::arm::AES.available(cpu_features) {
    |                                                                 ^^^ not found in `cpu::arm`
    |
help: consider importing this constant
    |
15  | use crate::cpu::intel::AES;
    |

error[E0425]: cannot find value `PMULL` in module `cpu::arm`
   --> /Users/vishnujin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/aead/gcm.rs:315:26
    |
315 |             || cpu::arm::PMULL.available(cpu_features)
    |                          ^^^^^ not found in `cpu::arm`

error[E0425]: cannot find value `ARMCAP_STATIC` in this scope
   --> /Users/vishnujin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:235:41
    |
235 |             if self.mask == self.mask & ARMCAP_STATIC {
    |                                         ^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `ARMCAP_STATIC` in this scope
   --> /Users/vishnujin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:288:36
    |
288 |     static mut GFp_armcap_P: u32 = ARMCAP_STATIC;
    |                                    ^^^^^^^^^^^^^ not found in this scope

   Compiling serde_derive v1.0.136
   Compiling tokio-macros v1.7.0
   Compiling futures-macro v0.3.21
   Compiling tracing-attributes v0.1.20
   Compiling rand_chacha v0.3.1
For more information about this error, try `rustc --explain E0425`.
error: could not compile `ring` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
make: *** [build-server] Error 101
VishnuJin commented 2 years ago

Building in Rust Stable works fine

thomastaylor312 commented 2 years ago

Hmm...we'll have to debug this. Looks like ring is having trouble with stuff, likely due to conditional compilation

yenicelik commented 2 years ago

Getting the same error. Would appreciate any pointers! :)

yenicelik commented 2 years ago

Is this a rust-core issue? https://github.com/rust-lang/rust/issues/95267

VishnuJin commented 2 years ago

@yenicelik my guess is also the same, for now I can say bindle builds fine in Rust Stable

BTW thanks for linking the issue 👍🏻

❯ rustup default stable                                                      ─╯
info: using existing install for 'stable-aarch64-apple-darwin'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin unchanged - rustc 1.59.0 (9d1b2106e 2022-02-23)
❯ make build                                                                 ─╯
cargo build --features cli --bin bindle-server
    Finished dev [unoptimized + debuginfo] target(s) in 0.47s
cargo build --features=cli --bin bindle
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
yenicelik commented 2 years ago

yeah rust stable worked indeed. maybe because of the rust update since Feb 24th or something

thomastaylor312 commented 2 years ago

Thanks for pointing out that issue @yenicelik! @VishnuJin You ok to close this?

VishnuJin commented 2 years ago

@thomastaylor312 yep !!