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

Vendoring script breaks against upstream secp #214

Closed
TheBlueMatt opened this issue May 13, 2020 · 1 comment · Fixed by #215
Closed

Vendoring script breaks against upstream secp #214

TheBlueMatt opened this issue May 13, 2020 · 1 comment · Fixed by #215

Comments

@TheBlueMatt
Copy link
Member

(this was reported to me, I didnt verify), but apparently the vendor script was broken upstream by commit dcb2e3b.

rust-secp256k1/secp256k1-sys$ ./vendor-libsecp.sh depend 0_1_2
depend/secp256k1 will be deleted [yn]: y
Cloning into 'secp256k1'...
remote: Enumerating objects: 5163, done.
remote: Total 5163 (delta 0), reused 0 (delta 0), pack-reused 5163
Receiving objects: 100% (5163/5163), 2.13 MiB | 1.72 MiB/s, done.
Resolving deltas: 100% (3605/3605), done.
patching file secp256k1/include/secp256k1.h
Hunk #1 succeeded at 204 (offset 2 lines).
Hunk #2 succeeded at 214 (offset 2 lines).
Hunk #3 succeeded at 228 (offset 2 lines).
Hunk #4 succeeded at 304 (offset 2 lines).
Hunk #5 succeeded at 311 (offset 2 lines).
patching file secp256k1/src/secp256k1.c
Hunk #1 succeeded at 146 (offset 7 lines).
Hunk #2 succeeded at 160 (offset 7 lines).
Hunk #3 succeeded at 168 (offset 7 lines).
Hunk #4 succeeded at 184 (offset 7 lines).
patching file secp256k1/src/scratch_impl.h
patching file secp256k1/src/util.h
Hunk #1 succeeded at 72 (offset 1 line).
Update Rust extern references and Cargo.toml as well? [yn]: y
rust-secp256k1/secp256k1-sys$ cargo build
   Compiling secp256k1-sys v0.1.2 (/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys)
error: failed to run custom build command for `secp256k1-sys v0.1.2 (/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys)`
Caused by:
  process didn't exit successfully: `/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-4b8f3c05437d624b/build-script-build` (exit code: 1)
--- stdout
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/depend/check_uint128_t.o" "-c" "depend/check_uint128_t.c"
exit code: 0
running: "ar" "crs" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/libcheck_uint128_t.a" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/depend/check_uint128_t.o"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-Wall" "-Wextra" "-Wno-unused-function" "-DSECP256K1_BUILD=1" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DENABLE_MODULE_ECDH=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DUSE_FIELD_5X52=1" "-DUSE_SCALAR_4X64=1" "-DHAVE___INT128=1" "-o" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-Wall" "-Wextra" "-Wno-unused-function" "-DSECP256K1_BUILD=1" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DENABLE_MODULE_ECDH=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DUSE_FIELD_5X52=1" "-DUSE_SCALAR_4X64=1" "-DHAVE___INT128=1" "-o" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/depend/secp256k1/src/secp256k1.o" "-c" "depend/secp256k1/src/secp256k1.c"
cargo:warning=In file included from depend/secp256k1/src/ecmult_gen_impl.h:13:0,
cargo:warning=                 from depend/secp256k1/src/secp256k1.c:17:
cargo:warning=depend/secp256k1/src/ecmult_gen.h:14:4: error: #error "Set ECMULT_GEN_PREC_BITS to 2, 4 or 8."
cargo:warning= #  error "Set ECMULT_GEN_PREC_BITS to 2, 4 or 8."
cargo:warning=    ^~~~~
cargo:warning=depend/secp256k1/src/ecmult_gen.h:16:27: error: ‘ECMULT_GEN_PREC_BITS’ undeclared here (not in a function); did you mean ‘ECMULT_GEN_PREC_B’?
cargo:warning= #define ECMULT_GEN_PREC_B ECMULT_GEN_PREC_BITS
cargo:warning=                           ^
cargo:warning=depend/secp256k1/src/ecmult_gen.h:18:34: note: in expansion of macro ‘ECMULT_GEN_PREC_B’
cargo:warning= #define ECMULT_GEN_PREC_N (256 / ECMULT_GEN_PREC_B)
cargo:warning=                                  ^~~~~~~~~~~~~~~~~
cargo:warning=depend/secp256k1/src/ecmult_gen.h:33:45: note: in expansion of macro ‘ECMULT_GEN_PREC_N’
cargo:warning=     rustsecp256k1_v0_1_2_ge_storage (*prec)[ECMULT_GEN_PREC_N][ECMULT_GEN_PREC_G]; /* prec[j][i] = (PREC_G)^j * i * G + U_i */
cargo:warning=                                             ^~~~~~~~~~~~~~~~~
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:17:0:
cargo:warning=depend/secp256k1/src/ecmult_gen_impl.h: In function ‘rustsecp256k1_v0_1_2_ecmult_gen_context_build’:
cargo:warning=depend/secp256k1/src/ecmult_gen_impl.h:67:34: warning: unused variable ‘precj’ [-Wunused-variable]
cargo:warning=         rustsecp256k1_v0_1_2_gej precj[ECMULT_GEN_PREC_N * ECMULT_GEN_PREC_G]; /* Jacobian versions of prec. */
cargo:warning=                                  ^~~~~
cargo:warning=depend/secp256k1/src/ecmult_gen_impl.h:31:29: warning: unused variable ‘prec’ [-Wunused-variable]
cargo:warning=     rustsecp256k1_v0_1_2_ge prec[ECMULT_GEN_PREC_N * ECMULT_GEN_PREC_G];
cargo:warning=                             ^~~~
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:17:0:
cargo:warning=depend/secp256k1/src/ecmult_gen_impl.h: In function ‘rustsecp256k1_v0_1_2_ecmult_gen_context_is_built’:
cargo:warning=depend/secp256k1/src/ecmult_gen_impl.h:106:1: warning: control reaches end of non-void function [-Wreturn-type]
cargo:warning= }
cargo:warning= ^
exit code: 1
--- stderr

error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-Wall" "-Wextra" "-Wno-unused-function" "-DSECP256K1_BUILD=1" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DENABLE_MODULE_ECDH=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DUSE_FIELD_5X52=1" "-DUSE_SCALAR_4X64=1" "-DHAVE___INT128=1" "-o" "/home/nkohen/Desktop/SuredBits/rust-secp256k1/secp256k1-sys/target/debug/build/secp256k1-sys-3cb4b7dae96423cf/out/depend/secp256k1/src/secp256k1.o" "-c" "depend/secp256k1/src/secp256k1.c" with args "cc" did not execute successfully (status code exit code: 1).
@stevenroose
Copy link
Contributor

I can confirm the error.

real-or-random added a commit that referenced this issue May 13, 2020
This is configurable in upstream now.

Fixes #214.

So far, this just sets it to `4`. It's tempting to set it to `2` when `lowmemory` is enabled
but `lowmemory` is about RAM and not about binary size. This is better addressed by
a resolution of #193.
tomtau pushed a commit to crypto-com/rust-secp256k1-zkp that referenced this issue Jul 9, 2020
This is configurable in upstream now.

Fixes rust-bitcoin#214.

So far, this just sets it to `4`. It's tempting to set it to `2` when `lowmemory` is enabled
but `lowmemory` is about RAM and not about binary size. This is better addressed by
a resolution of rust-bitcoin#193.
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

Successfully merging a pull request may close this issue.

2 participants