Repository navigation
Open
Labels
Description
Title: Build fails with GCC 11
Description:
Building envoy with GCC 11 fails with the following error. I am testing on Ubuntu 21.10.
user1@user1-MS-7B46:~/my_stuff/envoy$ bazel build -c opt envoy
INFO: Analyzed target //:envoy (753 packages loaded, 42550 targets configured).
INFO: Found 1 target...
ERROR: /home/user1/.cache/bazel/_bazel_user1/000cfbe7b945d70ffe5141196905c97b/external/boringssl/BUILD:162:11: Compiling src/crypto/curve25519/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 41 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
external/boringssl/src/crypto/curve25519/curve25519.c:503:57: error: argument 2 of type 'const uint8_t[32]' {aka 'const unsigned char[32]'} with mismatched bound [-Werror=array-parameter=]
503 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) {
| ~~~~~~~~~~~~~~^~~~~
In file included from external/boringssl/src/crypto/curve25519/curve25519.c:33:
external/boringssl/src/crypto/curve25519/internal.h:109:58: note: previously declared as 'const uint8_t *' {aka 'const unsigned char *'}
109 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s);
| ~~~~~~~~~~~~~~~^
external/boringssl/src/crypto/curve25519/curve25519.c:823:57: error: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Werror=array-parameter=]
823 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) {
| ~~~~~~~~~~~~~~~^
In file included from external/boringssl/src/crypto/curve25519/curve25519.c:33:
external/boringssl/src/crypto/curve25519/internal.h:117:56: note: previously declared as an array 'const uint8_t[32]' {aka 'const unsigned char[32]'}
117 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]);
| ~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 12.226s, Critical Path: 5.53s
INFO: 194 processes: 14 internal, 180 linux-sandbox.
FAILED: Build did NOT complete successfully
user1@user1-MS-7B46:~/my_stuff/envoy$
This appears to be a known issue in BoringSSL here and was fixed here, so bumping the BoringSSL version is likely to fix it.
Repro steps:
- Use Ubuntu 21.10
- Build envoy as per the instructions here
Reacted by Ali Hashemi
Activity
phlax commentedon Oct 28, 2021
hi, thanks for reporting this
i tried following the instructions for updating boringssl from here
envoy/bazel/repository_locations.bzl
Lines 75 to 85 in 4a2b01f
unfortunately afaict the master-with-bazel branch doesnt have the commit (revision?) suggested (45c8be91f34741b140bcbfc4043795eb14669008)
not sure if i was following the instructions correctly or how to update this
cc @moderation @PiotrSikora
phlax commentedon Oct 28, 2021
related links:
https://omahaproxy.appspot.com/
https://chromium.googlesource.com/chromium/src/+/refs/tags/97.0.4682.3/DEPS#261
https://github.com/google/boringssl/commits/master-with-bazel
phlax commentedon Oct 28, 2021
wierd, i got an email about a comment, but its not here on the issue
i got this from (following the instructions, but perhaps incorrectly) the
boringssl_revisionthat is set here:https://chromium.googlesource.com/chromium/src/+/refs/tags/97.0.4682.3/DEPS#261
im not seeing exactly where you got that hash, but can i suggest opening a PR to update boringssl
jesseschalken commentedon Oct 28, 2021
@phlax Yes I deleted the comment when I realised the hash was from the Chromium DEPS file.
google/boringssl@45c8be9 isn't in
master-with-bazelbut it is inmain-with-bazel(I don't know why the Github UI doesn't includemain-with-bazelin the list of branches that include the commit).I think we're supposed to look at
main-with-bazelasmaster-with-bazelhasn't been updated since July butmain-with-bazelhas been kept up to date, and at the point thatmaster-with-bazelwas last updated, the tree was the same asmain-with-bazel(google/boringssl@90bc679 is equal with google/boringssl@fc44652).The commit in
main-with-bazelthat merges google/boringssl@45c8be9 is google/boringssl@1285d53 which I think is the right version to use inrepository_locations.bzl.phlax commentedon Oct 28, 2021
sounds like a plan, do you want to PR ?
jesseschalken commentedon Oct 28, 2021
I am trying but google/boringssl@dddb60e makes
X509_STORE_CTXopaque and envoy was assigning to thectxmember inSPIFFEValidator::doVerifyCertChain, and there is no equivelantX509_STORE_CTX_set_ctxfunction or similar. That breaking change is included in theboringssl_revisionpointed to by the current linux/dev chromium release, which is what the comment says to use.Can we use any boringssl revision that is used by a released version of chromium? If so then I can just try to find the earliest such revision that includes google/boringssl@92c6fbf.
phlax commentedon Oct 28, 2021
my suggestion would be to open a PR with the version that works out of the box, and fixes your original issue, with some explanation as to why you have pinned to that version.
this dep will need review from others, so we can cc them from there
PiotrSikora commentedon Oct 28, 2021
You could grab BoringSSL version from Chromium 94.0.4606.81 (previous linux/stable), i.e. google/boringssl@519c298 (google/boringssl@648cbaf in
main-with-bazel). It predates the breaking change.github-actions commentedon Nov 27, 2021
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
jesseschalken commentedon Nov 30, 2021
This is still an issue and still should be fixed, but the task that required me to fix this is put on hold. I will try @PiotrSikora's suggestion when I get around to needing to build envoy again.
phlax commentedon Nov 30, 2021
@jesseschalken thanks for input so far - i reckon we should raise a PR to address this
@kfaseela is this something you want to look at ? im happy to assist
kfaseela commentedon Nov 30, 2021
@phlax I can take a look
kfaseela commentedon Dec 1, 2021
@jesseschalken : I tried to pick the latest version as per https://omahaproxy.appspot.com/, and https://chromium.googlesource.com/chromium/src/+/refs/tags/98.0.4710.4/DEPS, however this revision of boring_ssl brings in a breaking change as you already reported above, that needs some refactoring in SPIFFEValidator::doVerifyCertChain in envoy. Hence moved back to 94.0.4606.81 as suggested by @PiotrSikora and that does not seem to have the build issue. PR linked above for your reference. Let me know if it solves your issue.
phlax commentedon Dec 1, 2021
@jesseschalken as #19152 has hopefully addressed this issue, so this should be fixed
please do reopen if its still an issue
jesseschalken commentedon Dec 1, 2021
@kfaseela @phlax Thanks. I tried to build #19152 earlier today and the build still failed because of brotli but not boringssl. So I think the boringssl build failure is fixed but I didn't run it with
--keep_goingbefore opening this issue to see that boringssl wasn't the only problem. I started building it with--keep_goingto capture all the issues but didn't have time to wait for it to finish.I don't have permission to reopen but if this is a general "Build fails with GCC 11" issue I'll put the errors from
--keep_goinghere for the issue to be reopened. Otherwise I'll open another issue.kfaseela commentedon Dec 1, 2021
@jesseschalken please update all the issues which you are hitting afterwards here.
Updates @boringssl to the latest available commit.