PointOneNav / polaris

Software for communicating with Point One Navigation's Polaris GNSS Corrections Service
MIT License
24 stars 12 forks source link

Bazel builds may be broken by boring-ssl #55

Closed anathan closed 5 months ago

anathan commented 1 year ago

Likely a change in our bazel workflow. Needs investigation.

adamshapiro0 commented 1 year ago

It failed a couple times in a row as I was fixing other things in https://github.com/PointOneNav/polaris/pull/54, but then it passed just fine on the last CI build for that PR. I don't think I changed anything applicable -- I was only really changing CMake stuff -- but also not sure why it would be nondeterministic?

I attached console output from each: successful_build.txt failed_build.txt

It seems like the 2 builds are hitting the same compiler warning, but in the failure case it's being treated as an error as if -Werror is on. No idea why the two runs would be different though since I wasn't modifying the Bazel stuff in that branch. Unfortunately the successful case doesn't print out its gcc call, but the failure case does and -Werror isn't present.

Broken:

2023-08-16T01:30:05.7036638Z [58 / 325] Compiling src/third_party/fiat/curve25519.c; 0s linux-sandbox ... (2 actions, 1 running)
2023-08-16T01:30:06.2545684Z ERROR: /home/runner/.cache/bazel/_bazel_runner/0763c6b38a2c24187ddfa8eb181fc17c/external/boringssl/BUILD:131:11: Compiling src/third_party/fiat/curve25519.c failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 37 argument(s) skipped)
2023-08-16T01:30:06.2546776Z 
2023-08-16T01:30:06.2547826Z Use --sandbox_debug to see verbose messages from the sandbox
2023-08-16T01:30:06.2576154Z external/boringssl/src/third_party/fiat/curve25519.c:511:57: error: argument 2 of type 'const uint8_t[32]' {aka 'const unsigned char[32]'} with mismatched bound [-Werror=array-parameter=]
2023-08-16T01:30:06.2576977Z   511 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) {
2023-08-16T01:30:06.2577858Z       |                                           ~~~~~~~~~~~~~~^~~~~
2023-08-16T01:30:06.2578615Z In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
2023-08-16T01:30:06.2579624Z external/boringssl/src/third_party/fiat/internal.h:117:58: note: previously declared as 'const uint8_t *' {aka 'const unsigned char *'}
2023-08-16T01:30:06.2679800Z   117 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s);
2023-08-16T01:30:06.2680143Z       |                                           ~~~~~~~~~~~~~~~^
2023-08-16T01:30:06.2680895Z external/boringssl/src/third_party/fiat/curve25519.c:831:57: error: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Werror=array-parameter=]
2023-08-16T01:30:06.2681378Z   831 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) {
2023-08-16T01:30:06.2681683Z       |                                          ~~~~~~~~~~~~~~~^
2023-08-16T01:30:06.2682020Z In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
2023-08-16T01:30:06.2682695Z external/boringssl/src/third_party/fiat/internal.h:125:56: note: previously declared as an array 'const uint8_t[32]' {aka 'const unsigned char[32]'}
2023-08-16T01:30:06.2683145Z   125 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]);
2023-08-16T01:30:06.2683436Z       |                                          ~~~~~~~~~~~~~~^~~~~
2023-08-16T01:30:06.2683708Z cc1: all warnings being treated as errors

Working:

2023-08-16T02:00:31.0917638Z [54 / 322] Compiling src/third_party/fiat/curve25519.c; 0s linux-sandbox ... (2 actions, 1 running)
2023-08-16T02:00:32.0353191Z INFO: From Compiling src/third_party/fiat/curve25519.c:
2023-08-16T02:00:32.0481627Z external/boringssl/src/third_party/fiat/curve25519.c:511:57: warning: argument 2 of type 'const uint8_t[32]' {aka 'const unsigned char[32]'} with mismatched bound [-Warray-parameter=]
2023-08-16T02:00:32.0482396Z   511 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) {
2023-08-16T02:00:32.0482882Z       |                                           ~~~~~~~~~~~~~~^~~~~
2023-08-16T02:00:32.0483341Z In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
2023-08-16T02:00:32.0484230Z external/boringssl/src/third_party/fiat/internal.h:117:58: note: previously declared as 'const uint8_t *' {aka 'const unsigned char *'}
2023-08-16T02:00:32.0484844Z   117 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s);
2023-08-16T02:00:32.0485682Z       |                                           ~~~~~~~~~~~~~~~^
2023-08-16T02:00:32.0486743Z external/boringssl/src/third_party/fiat/curve25519.c:831:57: warning: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Warray-parameter=]
2023-08-16T02:00:32.0487604Z   831 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) {
2023-08-16T02:00:32.0488016Z       |                                          ~~~~~~~~~~~~~~~^
2023-08-16T02:00:32.0488489Z In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
2023-08-16T02:00:32.0489302Z external/boringssl/src/third_party/fiat/internal.h:125:56: note: previously declared as an array 'const uint8_t[32]' {aka 'const unsigned char[32]'}
2023-08-16T02:00:32.0489966Z   125 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]);
2023-08-16T02:00:32.0490442Z       |                                          ~~~~~~~~~~~~~~^~~~~
adamshapiro0 commented 5 months ago

This was patched in the Bazel build in 1.3.1, and should be resolved in the latest PR #60, which updated BoringSSL to 2023/3/25. Closing this ticket.