status-im / nimbus-eth1

Nimbus: an Ethereum Execution Client for Resource-Restricted Devices
https://status-im.github.io/nimbus-eth1/
Apache License 2.0
571 stars 115 forks source link

build error with "impossible constraints" #2127

Closed holiman closed 3 months ago

holiman commented 5 months ago

For some reason, this happened when I tried building a docker image on one machine -- but not when I build it on another. Any idea what can be the cause of this?

 => ERROR [golang-builder 11/12] RUN cd nimbus-eth1 && make -j8 evmstate                                                                                                                                                                                                               47.2s
------                                                                                                                                                                                                                                                                                       
 > [golang-builder 11/12] RUN cd nimbus-eth1 && make -j8 evmstate:                                                                                                                                                                                                                           
0.252 Building: install/usr/lib/libbacktrace.a                                                                                                                                                                                                                                               
8.675 Building: install/usr/lib/libbacktracenim.a                                                                                                                                                                                                                                            
18.55 /go/nimbus-eth1/nimbus/evm/interpreter_dispatch.nim(87, 22) Warning: *** Linux64/VM2 handler switch => computedGoto [User]                                                                                                                                                             
46.66 In file included from /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_impl.h:20,                                                                                                                                                                         
46.66                  from /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/secp256k1.c:28:
46.66 /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h: In function 'secp256k1_scalar_reduce_512':
46.66 /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h:360:5: error: 'asm' operand has impossible constraints
46.66   360 |     __asm__ __volatile__(
46.66       |     ^~~~~~~
46.66 /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h:466:5: error: 'asm' operand has impossible constraints
46.66   466 |     __asm__ __volatile__(
46.66       |     ^~~~~~~
47.17 Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread -I/go/nimbus-eth1/vendor/nim-libbacktrace -I/go/nimbus-eth1/vendor/nim-libbacktrace/install/usr/include -I/go/nimbus-eth1/vendor/nim-bearssl/bearssl/abi -I/go/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/src/ -I/go/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/inc/ -I/go/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/tools/ -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1  -DBR_amd64=1 -DBR_INT128=1 -I/go/nimbus-eth1/vendor/nim-zlib/zlib/csources -DHAVE_UNISTD_H -D__BLST_PORTABLE__ -I"/go/nimbus-eth1/vendor/nim-kzg4844/kzg4844/csources/blst/bindings" -I"/go/nimbus-eth1/vendor/nim-kzg4844/kzg4844/csources/src/" -DMP_32BIT -I/go/nimbus-eth1/vendor/libtommath -march=native -fno-omit-frame-pointer -g3 -Og -O3 -fno-strict-aliasing -fno-ident  -DENABLE_MODULE_ECDH=1 -DENABLE_MODULE_RECOVERY=1 -DENABLE_MODULE_SCHNORRSIG=1 -DENABLE_MODULE_EXTRAKEYS=1 -I/go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1 -I/go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src -DUSE_ASM_X86_64  -I/go/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib -I/go/nimbus-eth1/tools/evmstate -o nimcache/release/evmstate/@m..@s..@svendor@snim-secp256k1@svendor@ssecp256k1@ssrc@ssecp256k1.c.o /go/nimbus-eth1/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/secp256k1.c' failed with exit code: 1
47.17 
47.17 
47.18 make: *** [Makefile:351: evmstate] Error 1
jangko commented 5 months ago

The failure come from a C library linked with Nim(libsecp256k1). I suspect it is because of the C conditional compilation problem.

jangko commented 5 months ago

similar error message: https://github.com/waku-org/nwaku/issues/2560. Are you using the new AMD CPU too? @holiman

namiloh commented 5 months ago

Not sure. @fredriksvantes do you know? It was on the boulder02 machine

holiman commented 5 months ago
processor   : 191
vendor_id   : AuthenticAMD
cpu family  : 25
model       : 17
model name  : AMD EPYC 9654P 96-Core Processor
stepping    : 1
microcode   : 0xa101111
cpu MHz     : 1500.000
cache size  : 1024 KB
physical id : 0
siblings    : 192
core id     : 79
cpu cores   : 96
apicid      : 159
initial apicid  : 159
fpu     : yes
fpu_exception   : yes
cpuid level : 16
wp      : yes
fredriksvantes commented 5 months ago

Yes they are running AMD EPYC 9654P UP 96C/192T CPUs

edit: seems the previous msg was lost in spam 😥