Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicer error message when toolchain version and sp1-zkvm versions are incompatible #1625

Open
MCJOHN974 opened this issue Oct 10, 2024 · 1 comment · May be fixed by #1791
Open

Nicer error message when toolchain version and sp1-zkvm versions are incompatible #1625

MCJOHN974 opened this issue Oct 10, 2024 · 1 comment · May be fixed by #1791
Labels
compilation Issues preventing programs from compiling enhancement New feature or request rust Pull requests that update Rust code

Comments

@MCJOHN974
Copy link

Hi all! I worked on some project which used SP1. It was depending on a fixed commit, rather than latest version. I cloned the project, downloaded and setted up sp1 following sp1 book, runned cargo prove build and faced this monstrous error:

[sp1]  error: linking with `rust-lld` failed: exit status: 1
[sp1]    |
[sp1]    = note: LC_ALL="C" PATH="/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/ubuntu/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/.sp1/bin" VSLANG="1033" "rust-lld" "-flavor" "gnu" "/tmp/rustccdw9e3/symbols.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.00.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.01.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.02.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.03.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.04.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.05.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.06.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.07.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.08.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.btcx_program_utreexo.521aa5b66d154da0-cgu.09.rcgu.o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209.3sfs8e2jzztw19zwkpm4zsoso.rcgu.o" "--as-needed" "-L" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps" "-L" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/release/deps" "-L" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/build/secp256k1-sys-6aa7d35b6c810732/out" "-L" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib" "-Bstatic" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsp1_zkvm-7b54cff2631918d2.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/liblibm-a642305d7e8918e1.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/librand-2bcf4e3acc8788b7.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/librand_chacha-009ba25b18cbf60c.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libppv_lite86-6acf7bb8059fad0a.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libzerocopy-f78f6940e68589ab.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbyteorder-c4bc6bda9e7a1bdf.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsp1_precompiles-06bc797acebf26ce.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbincode-84dcf203ee2f6b74.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum-eab74f79a17570a4.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_iter-302dcbfd76bc3cc4.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_rational-9aa5f5f460b09071.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_complex-edd676c0153da51b.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_bigint-2e996efb1dae3be5.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_integer-26cb1c88e1e1fb33.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libnum_traits-9e0028e37228eee4.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libk256-c81c8d23412ee323.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libecdsa-f60fdac84d116bdd.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/librfc6979-c0b8ccfdfb710996.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libhmac-c0e8ca4474e994da.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsignature-d6b1806abd72105e.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libonce_cell-975b6ff52bdea210.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libelliptic_curve-41e8e5de9f3ebc4a.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libpkcs8-df68cb5097c026b6.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libspki-f5d27b5ec72adcb3.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsec1-b7b0555a9433e0f4.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libder-fb886d5852befe18.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libcrypto_bigint-08126ef9b59e1e2f.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbase16ct-befa6d6030af403b.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libgroup-72e8acd920f45a74.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libff-4c30210311158cab.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/librand_core-234f45c1b89e6729.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libgetrandom-0341dc1f5a0a8551.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitvec-a37e7c17654b0583.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libwyz-0b2604acfb2ab7bd.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libtap-9eeb9517330ad8a9.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libradium-67c3347ee5741301.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libfunty-72b11300241fa75c.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libanyhow-9e2f413b0ad6cbb9.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsnowbridge_amcl-e04bea16bf3b29c5.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libscale_info-8322cfbb4b1dd98b.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libparity_scale_codec-14eb5993c32a1910.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbyte_slice_cast-b364923f3b9dc93f.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsha2-1a01d7d9db617506.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libdigest-b168ce49c5bd8397.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsubtle-3f1a3e3a0857d3f7.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libconst_oid-a03e875ddda9b19a.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libblock_buffer-6f86beea987f45e4.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libcrypto_common-ecff08e912d28b9b.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libgeneric_array-dbe732b19888aa39.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libtypenum-3a3073518bec4f77.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libzeroize-bd3b4f45c7d7b072.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/librustreexo-ab4e9d11cf6df5b6.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitcoin-50a65af0e32642f7.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitcoin_units-11d213c23993fb5a.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libhex_lit-b04e0a0e6d8f15a7.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbech32-4492bd9552251a75.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsecp256k1-b9210f9fb900016a.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libsecp256k1_sys-34c672b0379ebbbf.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbase58ck-149ea1b7d76580d2.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitcoin_hashes-ed74154d0478fe3d.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitcoin_io-a53dd4811a6e6ed9.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libhex_conservative-ddea4621cd56744b.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libarrayvec-55daf26d94f8e15c.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbitcoin_internals-98c0fe3c6bf9e5e6.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libserde-eea6df19f4ddc3d1.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/liballoy_sol_types-c8383ef0929d9af7.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/liballoy_primitives-95e8f8887e6ea3cc.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libitoa-1178e5b93971d81c.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libhex_literal-bf76d4dc4bf5cc60.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libbytes-14af737362f2f685.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libconst_hex-713a89d99ebfc349.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libcfg_if-5505f0aa14fa4c07.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libruint-3926e4af4863a56f.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libtiny_keccak-c90f5a52ad61c1f1.rlib" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/libcrunchy-1b48c5d9a96c6ed0.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libstd-04f0d9efef767fb1.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libpanic_abort-c6db6158bb4ec8a3.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/librustc_demangle-d0581eef155b13bd.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libstd_detect-d04004a4709e63a1.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libhashbrown-b7944ebae122f127.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/librustc_std_workspace_alloc-9952df1bff0dcb85.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libminiz_oxide-5bcfd405c485a633.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libadler-792583987f9e0b6b.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libunwind-2b2cbc0ba50b636c.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libcfg_if-4a5d20705091dfb0.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/liblibc-12e5032008f8aa7d.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/liballoc-b06a2b9440fae2cd.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/librustc_std_workspace_core-5a6d18430cded1ae.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libcore-832f6514678f0470.rlib" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libcompiler_builtins-a58322ae5765cd0b.rlib" "-Bdynamic" "-z" "noexecstack" "-L" "/home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib" "-o" "/home/ubuntu/utreexo/program/utreexo/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/deps/btcx_program_utreexo-9757158854ba0209" "--gc-sections" "-O1" "--strip-debug" "-Ttext=0x00200800"
[sp1]    = note: rust-lld: error: undefined symbol: sys_rand
[sp1]            >>> referenced by std.9fcca9aebb9ac38a-cgu.06
[sp1]            >>>               std-04f0d9efef767fb1.std.9fcca9aebb9ac38a-cgu.06.rcgu.o:(std::sys::pal::zkvm::hashmap_random_keys::hb8d795989ff2f44c) in archive /home/ubuntu/.sp1/toolchains/xJrX8JJPp3/lib/rustlib/riscv32im-succinct-zkvm-elf/lib/libstd-04f0d9efef767fb1.rlib
[sp1] 

What was even more frustrating, exact same code worked on my coworker machine. After some time of digging, I finally found that the problem was that my toolchain version was newer than sp1-zkvm crate, and my coworker used older toolchain, thus on his machine everything worked, but not on mine. I spent really significant time discovering it, thus, probably, it worth to add warning, if you compile with different versions of sp1-zkvm and cargo prove toolchain.

@nhtyy nhtyy linked a pull request Nov 14, 2024 that will close this issue
@nhtyy nhtyy added enhancement New feature or request rust Pull requests that update Rust code compilation Issues preventing programs from compiling labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation Issues preventing programs from compiling enhancement New feature or request rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@nhtyy @MCJOHN974 and others