Skip to content

v8: add pre-built V8 library build and distribution infrastructure#3872

Draft
jwendell wants to merge 1 commit intoenvoyproxy:mainfrom
jwendell:v8-1
Draft

v8: add pre-built V8 library build and distribution infrastructure#3872
jwendell wants to merge 1 commit intoenvoyproxy:mainfrom
jwendell:v8-1

Conversation

@jwendell
Copy link
Member

Add the build script, repository rule, and module extension for building V8's wee8 static library from source and distributing it as a pre-built artifact for consumption by Envoy.

  • build_v8.sh: builds V8 in the self-contained bazel/v8/build/ workspace using a hermetic LLVM 18.1.8 toolchain with glibc 2.31 sysroot, collects PIC object files, and packages them with headers into a tarball.
  • v8_libs.bzl: repository rule that downloads (or extracts locally via V8_PREBUILT_PATH env var) the pre-built tarball, auto-detects host architecture, and exposes @v8//:wee8 with all required V8 defines.
  • extensions.bzl: bzlmod module extension for configuring the pre-built V8 library with per-architecture SHA256 hashes.

Add the build script, repository rule, and module extension for building
V8's wee8 static library from source and distributing it as a pre-built
artifact for consumption by Envoy.

- build_v8.sh: builds V8 in the self-contained bazel/v8/build/ workspace
  using a hermetic LLVM 18.1.8 toolchain with glibc 2.31 sysroot, collects
  PIC object files, and packages them with headers into a tarball.
- v8_libs.bzl: repository rule that downloads (or extracts locally via
  V8_PREBUILT_PATH env var) the pre-built tarball, auto-detects host
  architecture, and exposes @v8//:wee8 with all required V8 defines.
- extensions.bzl: bzlmod module extension for configuring the pre-built
  V8 library with per-architecture SHA256 hashes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jonh Wendell <jwendell@redhat.com>
@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit a84fda0
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/69baaaedece72a00087c0cea
😎 Deploy Preview https://deploy-preview-3872--nifty-bassi-e26446.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial review ...

if you look at the bazel .github wf/s you should see how it can auto fish the built libs out of the bazel build

# tree and copy only what's needed.
python3 -c "
import re, os, shutil, sys
v8_root = sys.argv[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put the python in a python file - also you cant just call python - it would need the python toolchain to be available

also not seeing where this is actually called

@@ -0,0 +1,45 @@
"""Module extension for pre-built V8 library configuration in bzlmod."""

load(":v8_libs.bzl", "v8_prebuilt")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the bit i would hold off on in this pr - lets get the libs building then look at how to access them workspace/bzlmod

)
"""

def _v8_prebuilt_impl(ctx):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with this

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

Successfully merging this pull request may close these issues.

2 participants