Closed nathanbeckmann closed 1 year ago
interesting, this looks like cstdint
include is missing on the protobuf dependency we pull in.
I'll update the protobuf dependency, then let's see.
For reference, what is the system environment you're building on ? Linux/BSD distribution (typically cat /etc/lsb-release
on Linux), gcc version (gcc -v
) ?
Can you try again with latest head ? The protobuf version we used was indeed missing the cstdint header (and now I am wondering how that ever was working, probably some accidental includes that your set-up was not doing)
The uint32_t
error is gone, thanks, but now I am seeing this error:
➜ verible git:(master) bazel build -c opt //...
INFO: Analyzed 1898 targets (0 packages loaded, 0 targets configured).
INFO: Found 1898 targets...
ERROR: /home/beckmann/.cache/bazel/_bazel_beckmann/d932d629abbf7de2514b0932259df566/external/com_google_boringssl/BUILD:152:11: Compiling src/crypto/bytestring/cbb.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 36 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In function 'CBB_add_asn1',
inlined from 'CBB_add_asn1_octet_string' at external/com_google_boringssl/src/crypto/bytestring/cbb.c:567:8:
external/com_google_boringssl/src/crypto/bytestring/cbb.c:388:14: error: storing the address of local variable 'child' in '*cbb.child' [-Werror=dangling-pointer=]
388 | cbb->child = out_contents;
| ~~~~~~~~~~~^~~~~~~~~~~~~~
external/com_google_boringssl/src/crypto/bytestring/cbb.c: In function 'CBB_add_asn1_octet_string':
external/com_google_boringssl/src/crypto/bytestring/cbb.c:566:7: note: 'child' declared here
566 | CBB child;
| ^~~~~
external/com_google_boringssl/src/crypto/bytestring/cbb.c:565:36: note: 'cbb' declared here
565 | int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) {
| ~~~~~^~~
In function 'CBB_add_asn1',
inlined from 'CBB_add_asn1_bool' at external/com_google_boringssl/src/crypto/bytestring/cbb.c:578:8:
external/com_google_boringssl/src/crypto/bytestring/cbb.c:388:14: error: storing the address of local variable 'child' in '*cbb.child' [-Werror=dangling-pointer=]
388 | cbb->child = out_contents;
| ~~~~~~~~~~~^~~~~~~~~~~~~~
external/com_google_boringssl/src/crypto/bytestring/cbb.c: In function 'CBB_add_asn1_bool':
external/com_google_boringssl/src/crypto/bytestring/cbb.c:577:7: note: 'child' declared here
577 | CBB child;
| ^~~~~
external/com_google_boringssl/src/crypto/bytestring/cbb.c:576:28: note: 'cbb' declared here
576 | int CBB_add_asn1_bool(CBB *cbb, int value) {
| ~~~~~^~~
cc1: all warnings being treated as errors
INFO: Elapsed time: 3.053s, Critical Path: 2.81s
INFO: 81 processes: 51 internal, 30 linux-sandbox.
FAILED: Build did NOT complete successfully
This is strange because I have installed verible from source several times on this machine recently, so I don't know why I'm running into these issues now.
And I'm on OpenSUSE:
➜ verible git:(master) cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20230616"
I have the same error on Arch with GCC 13.1.1. Clang 15.0.7 builds it successfully.
Interesting, in the CI we explicitly compile with an ancient compiler (gcc 10) to see that we don't use too new features, and a newer compiler for the c++23 compatibility test ... but that is also only gcc 12. So maybe time to include gcc 13.
I'll reproduce this on my local machine and then see if updating boringssl will fix this.
I could not reproduce that with gcc 13.1.0, which is the latest on my distro, but it looks like it is some static analysis finding. Just updated boringssl, can you try again ?
That fixed it, thanks!
(Why does verible
pull in boringssl anyway?)
We only need it for some sha256 hashing in Kythe. Slightly heavy dependency for that :/
Works on my end now as well.
@ivan444 do you know if we even need sha256 there, or just some sufficiently unique content hash ? Possible solutions
std::hash
(maybe concatenate some of the 64Bit values with different seeds)
I wonder if we can use something other than SHA256. Kythe docs explicitly mention SHA256 (https://kythe.io/docs/kythe-kzip.html).
I'll check with the Kythe team if this is really necessary. If it's not, then we have many options. If it is, I'll replace it with another SHA256 implementation.
Here is what I get after doing a
bazel clean --expunge
: