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

Build error: picotls.c: error: too many arguments to function 'subtest' #518

Open
barracuda156 opened this issue Apr 10, 2024 · 7 comments
Assignees

Comments

@barracuda156
Copy link

@h2o Building from 9de892c I get the following failure on MacOS:

:info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:32:
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1785:5: error: too many arguments to function 'subtest'
:info:build  1785 |     subtest("key-share:no", do_test_pre_shared_key, 0);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1786:30: warning: passing argument 2 of 'subtest' from incompatible pointer type [-Wincompatible-pointer-types]
:info:build  1786 |     subtest("key-share:yes", do_test_pre_shared_key, 1);
:info:build       |                              ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                              |
:info:build       |                              void (*)(int)
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1786:5: error: too many arguments to function 'subtest'
:info:build  1786 |     subtest("key-share:yes", do_test_pre_shared_key, 1);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1787:46: warning: passing argument 2 of 'subtest' from incompatible pointer type [-Wincompatible-pointer-types]
:info:build  1787 |     subtest("key-share:server-wo-key-share", do_test_pre_shared_key, 2);
:info:build       |                                              ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                              |
:info:build       |                                              void (*)(int)
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1787:5: error: too many arguments to function 'subtest'
:info:build  1787 |     subtest("key-share:server-wo-key-share", do_test_pre_shared_key, 2);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1788:35: warning: passing argument 2 of 'subtest' from incompatible pointer type [-Wincompatible-pointer-types]
:info:build  1788 |     subtest("key-share:mismatch", do_test_pre_shared_key, 3);
:info:build       |                                   ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                   |
:info:build       |                                   void (*)(int)
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1788:5: error: too many arguments to function 'subtest'
:info:build  1788 |     subtest("key-share:mismatch", do_test_pre_shared_key, 3);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1789:36: warning: passing argument 2 of 'subtest' from incompatible pointer type [-Wincompatible-pointer-types]
:info:build  1789 |     subtest("key-share:negotiate", do_test_pre_shared_key, 4);
:info:build       |                                    ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                    |
:info:build       |                                    void (*)(int)
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1789:5: error: too many arguments to function 'subtest'
:info:build  1789 |     subtest("key-share:negotiate", do_test_pre_shared_key, 4);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1791:38: warning: passing argument 2 of 'subtest' from incompatible pointer type [-Wincompatible-pointer-types]
:info:build  1791 |     subtest("fail:requires-psk-dhe", do_test_pre_shared_key, -1);
:info:build       |                                      ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                      |
:info:build       |                                      void (*)(int)
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:39: note: expected 'void (*)(void)' but argument is of type 'void (*)(int)'
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |                                ~~~~~~~^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/picotls.c:1791:5: error: too many arguments to function 'subtest'
:info:build  1791 |     subtest("fail:requires-psk-dhe", do_test_pre_shared_key, -1);
:info:build       |     ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/t/../deps/picotest/picotest.h:41:6: note: declared here
:info:build    41 | void subtest(const char *name, void (*cb)(void));
:info:build       |      ^~~~~~~
@kazuho
Copy link
Member

kazuho commented Apr 10, 2024

Submodule deps/picotest is outdated. Please run git submodule update --init --recursive.

@barracuda156
Copy link
Author

@kazuho Thank you, you are right, those errors are gone with picotest updated to the current commit.

I can build picotls now with gcc locally with no failures, however I see failures with clang on CI:

  /opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/lib/mbedtls_sign.c:619:16: error: call to undeclared function 'mbedtls_pk_load_file'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      if ((ret = mbedtls_pk_load_file(pem_fname, &buf, &n)) != 0) {
                 ^
  /opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_net_picotls/picotls/work/picotls-9de892ccf7b1d3dc9467ef92ba9314c155928037/lib/mbedtls_sign.c:619:16: note: did you mean 'mbedtls_mpi_read_file'?
  /opt/local/include/mbedtls/bignum.h:517:5: note: 'mbedtls_mpi_read_file' declared here
  int mbedtls_mpi_read_file(mbedtls_mpi *X, int radix, FILE *fin);
      ^
  1 error generated.
  make[2]: *** [CMakeFiles/picotls-mbedtls.dir/lib/mbedtls_sign.c.o] Error 1
  make[2]: Leaving directory `/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_net_picotls/picotls/work/build'
  make[1]: *** [CMakeFiles/picotls-mbedtls.dir/all] Error 2

@huitema
Copy link
Collaborator

huitema commented Apr 10, 2024

My fault. Developing this code, I used the API mbedtls_pk_load_file because it was a convenient way to load in memory the text content of a file. But this API was removed in the last versions of MbedTLS. I should have a replacement pretty soon.

@barracuda156
Copy link
Author

@huitema Please ping me once ready, I will update the port in MacPorts then.

@huitema
Copy link
Collaborator

huitema commented Apr 20, 2024

The fix is ready in PR #519. I am waiting for review by @kazuho to check it in main.

@huitema
Copy link
Collaborator

huitema commented May 21, 2024

Actually, I had to close PR #519, and restart with PR #528. The good news is that this now a complete implementation, with support for loading private keys and verifying certificates. That PR is ready, waiting for reviews before check-in.

@barracuda156
Copy link
Author

@huitema Thank you! I will update our port once the PR gets merged.

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

3 participants