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

docker: fix dockerFile for secp256k1 building #1531

Merged
merged 3 commits into from
Apr 22, 2019

Conversation

rjl493456442
Copy link
Contributor

Fix #1352

@hadv
Copy link
Contributor

hadv commented Mar 6, 2019

@rjl493456442 this fix is for bitwalker/alpine-elixir-phoenix:latest, not for 1.7.1, right? because if I use 1.7.1 then still can build docker image without error

@rjl493456442
Copy link
Contributor Author

@hadv It seems. I'll try to build with the current dockerfile. If it works I'll close it.

Thank you for reminding.

@rjl493456442
Copy link
Contributor Author

I run the current dockerfile, still has such error:

make[1]: Leaving directory '/opt/app/deps/libsecp256k1/c_src/secp256k1'
cc -I/usr/lib/erlang/erts-10.0.3/include -I c_src/secp256k1 -I c_src/secp256k1/src -I c_src/secp256k1/include -I../libsecp256k1/src -fPIC -shared -o priv/libsecp256k1_nif.so c_src/libsecp256k1_nif.c c_src/secp256k1/.libs/libsecp256k1.a -lgmp
c_src/libsecp256k1_nif.c: In function 'ecdsa_sign':
c_src/libsecp256k1_nif.c:494:51: warning: passing argument 2 of 'secp256k1_ecdsa_signature_serialize_der' from incompatible pointer type [-Wincompatible-pointer-types]
  if (secp256k1_ecdsa_signature_serialize_der(ctx, &intermediatesig, &siglen, &signature) != 1) {
                                                   ^
In file included from c_src/libsecp256k1_nif.c:9:0:
c_src/secp256k1/src/secp256k1.c:261:5: note: expected 'unsigned char *' but argument is of type 'unsigned char (*)[74]'
 int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c_src/secp256k1/src/secp256k1.c:9:0,
                 from c_src/libsecp256k1_nif.c:9:
c_src/libsecp256k1_nif.c:497:64: warning: passing argument 3 of 'secp256k1_ecdsa_signature_parse_der' from incompatible pointer type [-Wincompatible-pointer-types]
     CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature, &intermediatesig, siglen) == 1);
                                                                ^
c_src/secp256k1/src/util.h:40:39: note: in definition of macro 'EXPECT'
 #define EXPECT(x,c) __builtin_expect((x),(c))
                                       ^
c_src/libsecp256k1_nif.c:497:5: note: in expansion of macro 'CHECK'
     CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature, &intermediatesig, siglen) == 1);
     ^~~~~
In file included from c_src/libsecp256k1_nif.c:9:0:
c_src/secp256k1/src/secp256k1.c:224:5: note: expected 'const unsigned char *' but argument is of type 'unsigned char (*)[74]'
 int secp256k1_ecdsa_signature_parse_der(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [Makefile:31: priv/libsecp256k1_nif.so] Error 1
==> libsecp256k1
[warning] Mix compiler :make_bindings was supposed to return :ok | :noop | {:ok | :noop | :error, [diagnostic]} but it returned :error

@hadv
Copy link
Contributor

hadv commented Mar 6, 2019

@rjl493456442 ah, sorry! Actually. I use your Dockerfile on puppeth's repo some days ago and can build with 1.7.1 I didnot check the Dockerfile on this repo

Copy link
Contributor

@acravenho acravenho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@mattkanwisher
Copy link

Any reason this never got merged? We are experiencing similar issue

@rjl493456442
Copy link
Contributor Author

@acravenho Can you merge this PR :) I think the fix really makes sense.

@ghost ghost assigned vbaranov Apr 22, 2019
@ghost ghost added the in progress label Apr 22, 2019
@acravenho
Copy link
Contributor

@vbaranov can you please take a look and see if this can get merged? Thanks 👍

@vbaranov vbaranov self-requested a review April 22, 2019 11:15
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjl493456442 LGTM. I don't see the error mentioned in #1352 anymore.

@vbaranov vbaranov merged commit a0c9078 into blockscout:master Apr 22, 2019
@ghost ghost removed the in progress label Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

secp256k1 / libsecp256k1 errors when building with Docker
5 participants