-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix istio proxy build after moving Envoy to hermteic toolchain #6726
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
Skipping CI for Draft Pull Request. |
|
😊 Welcome @krinkinmu! This is either your first contribution to the Istio proxy repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
/test all |
howardjohn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean you can finally just run bazel build and it works??? amazing!!
Almost, but there are corner cases. E.g., llvm tools themselves are not built statically, so they still depend on some external libraries, but at the very least installing clang should not be necessary. And we still need to figure out if we want to go this way or rely on a local toolchain. |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
|
@krinkinmu can you update your PR base on envoyproxy/envoy#42572? |
|
@zirain will do that later today |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
|
Interesting... It works locally, but not on CI. I need to dig a bit more. |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
|
At least it's building now... |
|
@zirain it looks like it builds. I'd need to double check what it's actually building and that the version of GLIBC it needs is indeed 2.28, but on the surface it looks ok. |
|
Aha... I missed something in the configuration apparently - it didn't really use the hermetic sysroot and instead used host GLIBC, which is ok when building insider a container, but not what we actually wanted. |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
|
I tested it locally and it builds using the right sysroot with glibc 2.28 |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
/test all |
|
Regarding the libncurses library, looking at the clang binary in the hermetic llvm toolchain it's conviniently adds RUNPATH: That means that if we package llvm toolchain with |
|
@krinkinmu what's status of this PR? |
|
The PR works on CI and I confirmed that we use 2.28 glibc with this PR.
There is one caveat mentioned in the PR description - I can check for
options to address that caveat if we agree on the general direction to use
hermetic toolchain.
…On Wed 17 Dec 2025, 01:15 zirain, ***@***.***> wrote:
*zirain* left a comment (istio/proxy#6726)
<#6726 (comment)>
@krinkinmu <https://github.com/krinkinmu> what's status of this PR?
—
Reply to this email directly, view it on GitHub
<#6726 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7Q46H6PDDKP2RL35JZIL4CCVEBAVCNFSM6AAAAACOESDD7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNRTGEZTSOJWG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think using hermetic toolchain is the right direction. |
|
Yes, of course, using upstream clang would give you clang 18 and better compilation. |
|
A small update on the issue with It looks like this is the only weird dependency that causes this problem and LLVM folks said that they removed this dependency in the later version of clang, so say with clang-19 we wouldn't have this problem. However, fixing the latest 18.1.8 release of clang-18 or doing another release (e.g. 18.1.9) is unlikely (LLVM folks made some changes to the process in LLVM 19, so they are not particularly keen on trying to release 18 again). So two options that make sense to try IMO:
I think if the option 1 works, it would be the best fix - no divergence, newer compiler, should work the same way on CI and on a local computer. |
What this PR does / why we need it:
It makes changes to the Istio proxy Bazel configs to migrate to using Envoy's hermetic LLVM toolchain for builds. The "hermetic" here means that as part of the build process Bazel will download the LLVM toolchain, including compiler, linker and libraries, and will use them to build.
One thing worth calling out specifically, is that Envoy will also download a sysroot that packages glibc vers 2.28, which is, I think, the same version of glibc that we are currently using, so we still should be able to run the resulting Envoy binary outside of the container environment on old OSes.
NOTE: llvm toolchain itself is not statically built, unfortunately, and not all required libraries come with the toolchain. One library specifically that I noticed might cause problems is libncurses. Clang in the hermetic llvm toolchain is built against libncurses version 5, while some major distributions (i.e., Ubuntu) moved towards version 6.
It does not matter when building inside a container - we use a pretty old base image that should have the required version of the libncurses library, however building things outside the container may require jumping through a few hoops to install the right libraries if the hermetic toolchain is used.
I don't think there is a sensible way to workaround this issue in the hermetic toolchain itself (I wish LLVM folks just released a static version of the toolchain, but alas they don't do that). So IMO the best path forward would be to just allow easy switching between hermetic toolchain and host toolchain, which this PR does not implement yet. However, if we ok in principle with this approach, I can probably add support for that.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer: