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

Unable to build - Compile error #94

Open
rkonda20 opened this issue Sep 30, 2021 · 10 comments
Open

Unable to build - Compile error #94

rkonda20 opened this issue Sep 30, 2021 · 10 comments

Comments

@rkonda20
Copy link

Compiling libsecp256k1 v0.6.0
error: could not compile libsecp256k1

Caused by:
process didn't exit successfully: rustc --crate-name libsecp256k1 --edition=2018 /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="hmac"' --cfg 'feature="hmac-drbg"' --cfg 'feature="sha2"' --cfg 'feature="static-context"' --cfg 'feature="std"' --cfg 'feature="typenum"' -C metadata=ff75ffe663998c68 -C extra-filename=-ff75ffe663998c68 --out-dir /home/ubuntu/solana/target/debug/deps -L dependency=/home/ubuntu/solana/target/debug/deps --extern arrayref=/home/ubuntu/solana/target/debug/deps/libarrayref-1170f8c828ab8d28.rmeta --extern base64=/home/ubuntu/solana/target/debug/deps/libbase64-3a8d5a57fd8274f7.rmeta --extern digest=/home/ubuntu/solana/target/debug/deps/libdigest-7c04696e4c42676b.rmeta --extern hmac_drbg=/home/ubuntu/solana/target/debug/deps/libhmac_drbg-4c12dff52eca0361.rmeta --extern libsecp256k1_core=/home/ubuntu/solana/target/debug/deps/liblibsecp256k1_core-5f3c6c6031e9b3bd.rmeta --extern rand=/home/ubuntu/solana/target/debug/deps/librand-df7d32eff7424b90.rmeta --extern serde=/home/ubuntu/solana/target/debug/deps/libserde-d9f9ddfe27b2d698.rmeta --extern sha2=/home/ubuntu/solana/target/debug/deps/libsha2-6bbaa12590c3611b.rmeta --extern typenum=/home/ubuntu/solana/target/debug/deps/libtypenum-17020373090ddbe4.rmeta --cap-lints allow (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
{"message":"environment variable OUT_DIR not defined","code":null,"level":"error","spans":[{"file_name":"/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs","byte_start":1716,"byte_end":1731,"line_start":56,"line_end":56,"column_start":59,"column_end":74,"is_primary":true,"text":[{"text":" unsafe { ECMultContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };","highlight_start":59,"highlight_end":74}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs","byte_start":1716,"byte_end":1731,"line_start":56,"line_end":56,"column_start":59,"column_end":74,"is_primary":false,"text":[{"text":" unsafe { ECMultContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };","highlight_start":59,"highlight_end":74}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"env!","def_site_span":{"file_name":"/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/macros/mod.rs","byte_start":30584,"byte_end":30747,"line_start":887,"line_end":890,"column_start":5,"column_end":6,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: environment variable OUT_DIR not defined\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs:56:59\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m56\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| ...\u001b[0m\u001b[0m_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the macro env (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"message":"environment variable OUT_DIR not defined","code":null,"level":"error","spans":[{"file_name":"/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs","byte_start":2029,"byte_end":2044,"line_start":62,"line_end":62,"column_start":62,"column_end":77,"is_primary":true,"text":[{"text":" unsafe { ECMultGenContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };","highlight_start":62,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs","byte_start":2029,"byte_end":2044,"line_start":62,"line_end":62,"column_start":62,"column_end":77,"is_primary":false,"text":[{"text":" unsafe { ECMultGenContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };","highlight_start":62,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"env!","def_site_span":{"file_name":"/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/macros/mod.rs","byte_start":30584,"byte_end":30747,"line_start":887,"line_end":890,"column_start":5,"column_end":6,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: environment variable OUT_DIR not defined\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.6.0/src/lib.rs:62:62\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m62\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| ...\u001b[0m\u001b[0m_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the macro env (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"artifact":"/home/ubuntu/solana/target/debug/deps/libsecp256k1-ff75ffe663998c68.d","emit":"dep-info"}
{"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 2 previous errors\u001b[0m\n\n"}

@rkonda20
Copy link
Author

I tried with version 0.7

cargo build
Compiling libsecp256k1 v0.7.0 (/home/ubuntu/libsecp256k1)
error: could not compile libsecp256k1

Caused by:
process didn't exit successfully: rustc --crate-name libsecp256k1 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="hmac"' --cfg 'feature="hmac-drbg"' --cfg 'feature="sha2"' --cfg 'feature="static-context"' --cfg 'feature="std"' --cfg 'feature="typenum"' -C metadata=1357dc0dc97834f0 -C extra-filename=-1357dc0dc97834f0 --out-dir /home/ubuntu/libsecp256k1/target/debug/deps -C incremental=/home/ubuntu/libsecp256k1/target/debug/incremental -L dependency=/home/ubuntu/libsecp256k1/target/debug/deps --extern arrayref=/home/ubuntu/libsecp256k1/target/debug/deps/libarrayref-dfd5feafb83e6c19.rmeta --extern base64=/home/ubuntu/libsecp256k1/target/debug/deps/libbase64-259e0c79731ac582.rmeta --extern digest=/home/ubuntu/libsecp256k1/target/debug/deps/libdigest-24716e0bdbc1377d.rmeta --extern hmac_drbg=/home/ubuntu/libsecp256k1/target/debug/deps/libhmac_drbg-a16a258c68f0b580.rmeta --extern libsecp256k1_core=/home/ubuntu/libsecp256k1/target/debug/deps/liblibsecp256k1_core-1af814787eb8552a.rmeta --extern rand=/home/ubuntu/libsecp256k1/target/debug/deps/librand-cd9b6b6d26de7e5e.rmeta --extern serde=/home/ubuntu/libsecp256k1/target/debug/deps/libserde-ac0ca606ed95f59c.rmeta --extern sha2=/home/ubuntu/libsecp256k1/target/debug/deps/libsha2-7d35ecf8ad6acdc9.rmeta --extern typenum=/home/ubuntu/libsecp256k1/target/debug/deps/libtypenum-81ca94bc9a0f2863.rmeta (signal: 9, SIGKILL: kill)

Tried rustc directly


rustc --crate-name libsecp256k1 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="hmac"' --cfg 'feature="hmac-drbg"' --cfg 'feature="sha2"' --cfg 'feature="static-context"' --cfg 'feature="std"' --cfg 'feature="typenum"' -C metadata=1357dc0dc97834f0 -C extra-filename=-1357dc0dc97834f0 --out-dir /home/ubuntu/libsecp256k1/target/debug/deps -C incremental=/home/ubuntu/libsecp256k1/target/debug/incremental -L dependency=/home/ubuntu/libsecp256k1/target/debug/deps --extern arrayref=/home/ubuntu/libsecp256k1/target/debug/deps/libarrayref-dfd5feafb83e6c19.rmeta --extern base64=/home/ubuntu/libsecp256k1/target/debug/deps/libbase64-259e0c79731ac582.rmeta --extern digest=/home/ubuntu/libsecp256k1/target/debug/deps/libdigest-24716e0bdbc1377d.rmeta --extern hmac_drbg=/home/ubuntu/libsecp256k1/target/debug/deps/libhmac_drbg-a16a258c68f0b580.rmeta --extern libsecp256k1_core=/home/ubuntu/libsecp256k1/target/debug/deps/liblibsecp256k1_core-1af814787eb8552a.rmeta --extern rand=/home/ubuntu/libsecp256k1/target/debug/deps/librand-cd9b6b6d26de7e5e.rmeta --extern serde=/home/ubuntu/libsecp256k1/target/debug/deps/libserde-ac0ca606ed95f59c.rmeta --extern sha2=/home/ubuntu/libsecp256k1/target/debug/deps/libsha2-7d35ecf8ad6acdc9.rmeta --extern typenum=/home/ubuntu/libsecp256k1/target/debug/deps/libtypenum-81ca94bc9a0f2863.rmeta
{"message":"environment variable OUT_DIR not defined","code":null,"level":"error","spans":[{"file_name":"src/lib.rs","byte_start":1602,"byte_end":1617,"line_start":53,"line_end":53,"column_start":59,"column_end":74,"is_primary":true,"text":[{"text":" unsafe { ECMultContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };","highlight_start":59,"highlight_end":74}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/lib.rs","byte_start":1602,"byte_end":1617,"line_start":53,"line_end":53,"column_start":59,"column_end":74,"is_primary":false,"text":[{"text":" unsafe { ECMultContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };","highlight_start":59,"highlight_end":74}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"env!","def_site_span":{"file_name":"/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/macros/mod.rs","byte_start":30584,"byte_end":30747,"line_start":887,"line_end":890,"column_start":5,"column_end":6,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: environment variable OUT_DIR not defined\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:53:59\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m53\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| ...\u001b[0m\u001b[0m_from_raw(include!(concat!(env!("OUT_DIR"), "/const.rs"))) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the macro env (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"message":"environment variable OUT_DIR not defined","code":null,"level":"error","spans":[{"file_name":"src/lib.rs","byte_start":1958,"byte_end":1973,"line_start":59,"line_end":59,"column_start":62,"column_end":77,"is_primary":true,"text":[{"text":" unsafe { ECMultGenContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };","highlight_start":62,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"src/lib.rs","byte_start":1958,"byte_end":1973,"line_start":59,"line_end":59,"column_start":62,"column_end":77,"is_primary":false,"text":[{"text":" unsafe { ECMultGenContext::new_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };","highlight_start":62,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"env!","def_site_span":{"file_name":"/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/macros/mod.rs","byte_start":30584,"byte_end":30747,"line_start":887,"line_end":890,"column_start":5,"column_end":6,"is_primary":false,"text":[],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: environment variable OUT_DIR not defined\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/lib.rs:59:62\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m59\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| ...\u001b[0m\u001b[0m_from_raw(include!(concat!(env!("OUT_DIR"), "/const_gen.rs"))) };\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the macro env (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 2 previous errors\u001b[0m\n\n"}

@rkonda20
Copy link
Author

My OS is UBUNTU 20.0.3

@bmeeder22
Copy link

+1

@Faolain
Copy link

Faolain commented Oct 17, 2021

Same issue on raspberry pi 3 model b on Raspbian buster. Can see linked ticket above for more details regarding versions.

@longfin
Copy link

longfin commented Oct 20, 2021

It seemed caused by environment variable OUT_DIR not defined. I solved this issue through just source ~/.cargo/env.

@imclint21
Copy link

imclint21 commented Nov 25, 2021

Any news about this @rkonda20 ?

@rkonda20
Copy link
Author

rkonda20 commented Nov 26, 2021 via email

@imclint21
Copy link

It's actually caused by not enough memory

Ah okey @rkonda20 interesting, do you know how much memory is needed?

@rkonda20
Copy link
Author

rkonda20 commented Dec 6, 2021 via email

@Lolaletten
Copy link

Its a memory issue, make sure you have at least 2GB RAM on your server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants