Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fc7449c
dynamic modules: port rust sdk to golang to match envoy abi capabilities
AdamEAnderson Apr 29, 2026
65754f9
bugfixes
AdamEAnderson Apr 29, 2026
8954c3c
Merge remote-tracking branch 'origin/main' into go-sdk-parity
AdamEAnderson Apr 29, 2026
8a6eb9a
Merge remote-tracking branch 'origin/main' into go-sdk-parity
AdamEAnderson Apr 29, 2026
c900ee5
apply style shifts
AdamEAnderson Apr 29, 2026
37d83fd
tests
AdamEAnderson Apr 29, 2026
d6c85bb
fix
AdamEAnderson Apr 29, 2026
9620733
more tests
AdamEAnderson Apr 30, 2026
562409c
fix
AdamEAnderson Apr 30, 2026
e4df890
fix
AdamEAnderson Apr 30, 2026
bef852c
fix
AdamEAnderson Apr 30, 2026
335d09d
fix
AdamEAnderson Apr 30, 2026
8243412
fix
AdamEAnderson Apr 30, 2026
75d7eb4
fix
AdamEAnderson Apr 30, 2026
51a07fa
fix
AdamEAnderson Apr 30, 2026
dcea2f1
fix
AdamEAnderson Apr 30, 2026
e56c8f2
fix
AdamEAnderson Apr 30, 2026
3227741
fix
AdamEAnderson Apr 30, 2026
05b0249
fix
AdamEAnderson Apr 30, 2026
04a7c5c
fix
AdamEAnderson Apr 30, 2026
3f88ca5
fix
AdamEAnderson Apr 30, 2026
08b79f6
fix
AdamEAnderson Apr 30, 2026
c0862c3
fix
AdamEAnderson Apr 30, 2026
54404d3
fix
AdamEAnderson May 1, 2026
c4defbd
fix
AdamEAnderson May 1, 2026
5173ab6
fix
AdamEAnderson May 1, 2026
6fb572f
fix
AdamEAnderson May 4, 2026
bf4c35d
try this
AdamEAnderson May 4, 2026
495f372
fix
AdamEAnderson May 4, 2026
2fada9c
try this
AdamEAnderson May 4, 2026
2a4c2ee
remove weak
AdamEAnderson May 4, 2026
801f9a1
fix
AdamEAnderson May 4, 2026
c353ed4
fix
AdamEAnderson May 5, 2026
bfdeda3
retest
AdamEAnderson May 5, 2026
dfa5648
Merge upstream/main into go-sdk-parity
AdamEAnderson May 6, 2026
d696e0c
fix
AdamEAnderson May 6, 2026
6dcdf8b
fix
AdamEAnderson May 6, 2026
640743c
fix format
AdamEAnderson May 6, 2026
1c0a778
fixes
AdamEAnderson May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 72 additions & 5 deletions source/extensions/dynamic_modules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,102 @@ envoy_cc_library(
alwayslink = True,
)

# A meta-target that aggregates every per-surface abi_impl-style C++ library that
# implements the `envoy_dynamic_module_callback_*` host callbacks.
#
# The Go SDK's `abi/*.go` package is monolithic — importing it pulls in references to
# every surface's callbacks. So a Go test_data .so always references all of them. Tests
# that load such .so files must provide all of those symbols in the test binary's
# symbol table; otherwise dlopen's RTLD_LAZY can't resolve them and load fails. This
# meta-target lets a test depend on a single line and get every callback the Go SDK
# may have referenced.
envoy_cc_library(
name = "all_abi_impls",
deps = [
":abi_impl",
"//source/extensions/access_loggers/dynamic_modules:access_log_lib",
"//source/extensions/bootstrap/dynamic_modules:abi_impl",
"//source/extensions/clusters/dynamic_modules:cluster_lib",
"//source/extensions/filters/http/dynamic_modules:abi_impl",
"//source/extensions/filters/http/dynamic_modules:filter_lib",
"//source/extensions/filters/listener/dynamic_modules:filter_lib",
"//source/extensions/filters/network/dynamic_modules:filter_lib",
"//source/extensions/filters/udp/dynamic_modules:filter_lib",
"//source/extensions/load_balancing_policies/dynamic_modules:abi_impl",
"//source/extensions/matching/input_matchers/dynamic_modules:matcher_lib",
"//source/extensions/tracers/dynamic_modules:abi_impl",
"//source/extensions/transport_sockets/tls/cert_validator/dynamic_modules:config",
"//source/extensions/upstreams/http/dynamic_modules:abi_impl",
],
alwayslink = True,
)

# The shared package is pure Go (no cgo) — interfaces, types, and EmptyXxx no-ops shared
# across the SDK and module code. Modules depend on this transitively via go_sdk and
# go_sdk_abi.
go_library(
name = "go_sdk_shared",
srcs = [
"sdk/go/shared/api.go",
"sdk/go/shared/base.go",
"sdk/go/shared/access_log.go",
"sdk/go/shared/bootstrap.go",
"sdk/go/shared/cert_validator.go",
"sdk/go/shared/cluster.go",
"sdk/go/shared/dns_resolver.go",
"sdk/go/shared/http.go",
"sdk/go/shared/listener_api.go",
"sdk/go/shared/listener_base.go",
"sdk/go/shared/load_balancer.go",
"sdk/go/shared/matcher.go",
"sdk/go/shared/network_api.go",
"sdk/go/shared/network_base.go",
"sdk/go/shared/program.go",
"sdk/go/shared/tracer.go",
"sdk/go/shared/transport_socket.go",
"sdk/go/shared/types.go",
"sdk/go/shared/udp_listener_api.go",
"sdk/go/shared/udp_listener_base.go",
"sdk/go/shared/upstream_http_tcp_bridge.go",
],
cgo = True,
importpath = "github.com/envoyproxy/envoy/source/extensions/dynamic_modules/sdk/go/shared",
visibility = ["//visibility:public"],
)

# The top-level sdk package — pure Go. Holds the factory registries and program-handle
# indirection. Imports shared.
go_library(
name = "go_sdk",
srcs = ["sdk/go/sdk.go"],
cgo = True,
importpath = "github.com/envoyproxy/envoy/source/extensions/dynamic_modules/sdk/go",
visibility = ["//visibility:public"],
deps = [
"//source/extensions/dynamic_modules:go_sdk_shared",
],
)

# The abi package — cgo-heavy. Implements the C-callable trampolines that Envoy invokes
# and the Go-callable wrappers that bridge into Envoy's host callbacks.
go_library(
name = "go_sdk_abi",
srcs = [
"sdk/go/abi/internal.go",
"sdk/go/abi/access_log.go",
"sdk/go/abi/bootstrap.go",
# Stand-alone .c file that defines C trampolines passed by address from
# Go to Envoy. Cannot live in the cgo preamble; see file header for why.
"sdk/go/abi/bootstrap_trampolines.c",
"sdk/go/abi/cert_validator.go",
"sdk/go/abi/cluster.go",
"sdk/go/abi/dns_resolver.go",
"sdk/go/abi/http.go",
"sdk/go/abi/listener.go",
"sdk/go/abi/load_balancer.go",
"sdk/go/abi/matcher.go",
"sdk/go/abi/network.go",
"sdk/go/abi/program.go",
"sdk/go/abi/scheduler.go",
"sdk/go/abi/tracer.go",
"sdk/go/abi/transport_socket.go",
"sdk/go/abi/udp_listener.go",
"sdk/go/abi/upstream_http_tcp_bridge.go",
"//source/extensions/dynamic_modules/abi:abi.h",
],
cgo = True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn parse_proto_duration(s: &str) -> Option<std::time::Duration> {
if let Some(stripped) = s.strip_suffix('s') {
if let Some((whole, frac)) = stripped.split_once('.') {
let secs: u64 = whole.parse().ok()?;
let nanos: u32 = format!("{:0<9}", frac)[..9].parse().ok()?;
let nanos: u32 = format!("{frac:0<9}")[..9].parse().ok()?;
Some(std::time::Duration::new(secs, nanos))
} else {
let secs: u64 = stripped.parse().ok()?;
Expand Down
Loading
Loading