paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.97k stars 1.2k forks source link

beta6 make install-op | failed to run custom build command for `sha3-asm v0.1.0` #7908

Closed popconst closed 6 months ago

popconst commented 6 months ago

Describe the bug

Issue

Cannot successfully build reth for OP.

Error

failed to run custom build command for sha3-asm v0.1.0

Environment:

OS:

➜  reth git:(main) lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy

RUST:

➜  reth git:(main) cargo --version
cargo 1.77.2 (e52e36006 2024-03-26)

Steps to reproduce

Step 1: git clone git@github.com:paradigmxyz/reth.git && \ cd reth && \ make install-op

Step 1 (with full trace): RUST_BACKTRACE=full make install-op

Node logs

➜  reth git:(main) RUST_BACKTRACE=full make install-op
cargo install --path bin/reth --bin op-reth --force --locked \
    --features "optimism,jemalloc asm-keccak" \
    --profile "release" \

  Installing reth v0.2.0-beta.6 (/home/ubuntu/base-reth/reth/bin/reth)
    Updating crates.io index
   Compiling serde v1.0.198
   Compiling arbitrary v1.3.2
   Compiling zeroize v1.7.0
   Compiling tracing v0.1.40
   Compiling thiserror v1.0.58
   Compiling futures-util v0.3.30
   Compiling sha3-asm v0.1.0
   Compiling pin-project v1.1.5
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling proc-macro-crate v3.1.0
   Compiling alloy-sol-macro-input v0.7.0
   Compiling c-kzg v1.0.0
   Compiling zstd-sys v2.0.10+zstd.1.5.6
   Compiling enumn v0.1.13
   Compiling auto_impl v1.2.0
   Compiling darling_macro v0.20.8
   Compiling strum_macros v0.26.2
   Compiling bytemuck_derive v1.6.0
   Compiling async-trait v0.1.80
   Compiling clap_derive v4.5.4
   Compiling modular-bitfield-impl v0.11.2
   Compiling reth-codecs-derive v0.2.0-beta.6 (/home/ubuntu/base-reth/reth/crates/storage/codecs/derive)
   Compiling regex-automata v0.4.6
   Compiling libsecp256k1-gen-genmult v0.3.0
   Compiling libsecp256k1-gen-ecmult v0.3.0
error: failed to run custom build command for `sha3-asm v0.1.0`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/home/ubuntu/base-reth/reth/target/release/build/sha3-asm-31241ca736e825d8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_FEATURE
  cargo:rerun-if-env-changed=SHA3_ASM_SCRIPT
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH
  cargo:rerun-if-env-changed=OUT_DIR
  cargo:rustc-env=SHA3_ASM_SRC=keccak1600-x86_64
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ENV
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_FAMILY
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH

  --- stderr
  target features: ["fxsr", "sse", "sse2"]
  selected cryptogams script: cryptogams/x86_64/keccak1600-x86_64.pl
  selected cryptogams script flavor: Some("elf")
  running script: "perl" "cryptogams/x86_64/keccak1600-x86_64.pl" "elf" "/home/ubuntu/base-reth/reth/target/release/build/sha3-asm-6d547b15d8663a75/out/keccak1600-x86_64.s"
  thread 'main' panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sha3-asm-0.1.0/build.rs:138:5:
  non-empty stderr for cryptogams/x86_64/keccak1600-x86_64.pl:
  perl: warning: Setting locale failed.
  perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL = "iTerm2",
    LANG = "C.UTF-8"
      are supported and installed on your system.
  perl: warning: Falling back to a fallback locale ("C.UTF-8").
  perl: warning: Setting locale failed.
  perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL = "iTerm2",
    LANG = "C.UTF-8"
      are supported and installed on your system.
  perl: warning: Falling back to a fallback locale ("C.UTF-8").
  stack backtrace:
     0:     0x5589af711136 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h410d4c66be4e37f9
     1:     0x5589af737960 - core::fmt::write::he40921d4802ce2ac
     2:     0x5589af70dd2f - std::io::Write::write_fmt::h5de5a4e7037c9b20
     3:     0x5589af710f14 - std::sys_common::backtrace::print::h11c067a88e3bdb22
     4:     0x5589af712e47 - std::panicking::default_hook::{{closure}}::h8c832ecb03fde8ea
     5:     0x5589af712ba9 - std::panicking::default_hook::h1633e272b4150cf3
     6:     0x5589af7132d8 - std::panicking::rust_panic_with_hook::hb164d19c0c1e71d4
     7:     0x5589af7131b2 - std::panicking::begin_panic_handler::{{closure}}::h0369088c533c20e9
     8:     0x5589af711636 - std::sys_common::backtrace::__rust_end_short_backtrace::hc11d910daf35ac2e
     9:     0x5589af712f04 - rust_begin_unwind
    10:     0x5589af65b895 - core::panicking::panic_fmt::ha6effc2775a0749c
    11:     0x5589af66021d - build_script_build::perl::h7b3b856f4a38a3ad
    12:     0x5589af65e03a - build_script_build::main::h0406b7cf745e15ad
    13:     0x5589af661233 - core::ops::function::FnOnce::call_once::hc1523de6c8e137b6
    14:     0x5589af660d06 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5fe7ec86ff328683
    15:     0x5589af660e39 - std::rt::lang_start::{{closure}}::h5f13f006c50c1f74
    16:     0x5589af708501 - std::rt::lang_start_internal::h4d236095b69a230b
    17:     0x5589af660e17 - std::rt::lang_start::hf93c31840c576813
    18:     0x5589af660875 - main
    19:     0x7fd5995add90 - <unknown>
    20:     0x7fd5995ade40 - __libc_start_main
    21:     0x5589af65c005 - _start
    22:                0x0 - <unknown>
warning: build failed, waiting for other jobs to finish...
error: failed to compile `reth v0.2.0-beta.6 (/home/ubuntu/base-reth/reth/bin/reth)`, intermediate artifacts can be found at `/home/ubuntu/base-reth/reth/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
make: *** [Makefile:55: install-op] Error 101


### Platform(s)

Linux (x86)

### What version/commit are you on?

commit fd46df069ee5c9478a9cc689320e0aeafa9a529f (HEAD -> main, origin/main, origin/HEAD)

### What database version are you on?

n/a could not build.

### Which chain / network are you on?

BASE / OP

### What type of node are you running?

Archive (default)

### What prune config do you use, if any?

default from repo clone.

### If you've built Reth from source, provide the full command you used

RUST_BACKTRACE=full make install-op

### Code of Conduct

- [X] I agree to follow the Code of Conduct
popconst commented 6 months ago

Just ran it on a different machine with the same environment but different CPU model and got the same issue.

mattsse commented 6 months ago

@DaniPopes looks like this is due to the perl: warning which is logged to stderr triggering this assert

https://github.com/DaniPopes/keccak-asm/blob/1f923027912940fde91bd4008e1b1ecb9ec47e06/sha3-asm/build.rs#L138

could you try after:

export LANGUAGE=C.UTF-8
export LC_ALL=C.UTF-8
popconst commented 6 months ago

Thank you! That was indeed the issue!

I will close the issue.

    Finished release [optimized] target(s) in 2m 07s
  Installing /home/ubuntu/.cargo/bin/op-reth
   Installed package `reth v0.2.0-beta.6 (/home/ubuntu/base-reth/reth/bin/reth)` (executable `op-reth`)