Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(flox): fix node-rdkafka build on hosts with glibc older than 2.38 (#129393)

Georges-Antoine Assicec6b0e6628f
diff --git a/.flox/env/on-activate.sh b/.flox/env/on-activate.sh
index 6e785b0dbac4..08f9a2087861 100755
--- a/.flox/env/on-activate.sh
+++ b/.flox/env/on-activate.sh
@@ -340,6 +340,11 @@ if [[ "$_PNPM_SKIP" -eq 0 ]]; then
_ACTIVATION_TMPFILES+=("$_BG_PNPM_LOG")
if [[ "$_DEV_SANDBOX_INSTALLS" -eq 1 ]]; then
( "$FLOX_ENV_PROJECT/bin/dev-sandbox" "pnpm install" ) >"$_BG_PNPM_LOG" 2>&1 &
+ elif [[ "$(uname -s)" == "Linux" ]]; then
+ # LDFLAGS links against flox's libs, which need the nix glibc. On a host with an
+ # older glibc, the host linker then rejects librdkafka's example programs, which
+ # node-rdkafka builds but never uses. Scoped to this install so other builds keep strict linking.
+ ( LDFLAGS="${LDFLAGS:-} -Wl,--allow-shlib-undefined" pnpm install ) >"$_BG_PNPM_LOG" 2>&1 &
else
( pnpm install ) >"$_BG_PNPM_LOG" 2>&1 &
fi