From 55069012df5f38cb05262a6732d1c0c3475c6d1b Mon Sep 17 00:00:00 2001 From: Jared Lunde Date: Sat, 21 Nov 2026 19:07:43 -0800 Subject: [PATCH 1/3] ci: build aws-lc-sys for the musl test binary (musl-tools, CC_x86_64_unknown_linux_musl) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f6e58c..ae12948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,13 @@ on: jobs: test: runs-on: ubuntu-latest + env: + # aws-lc-sys (rustls) builds C for the musl test binary and looks for x86_64-linux-musl-gcc; musl-tools ships only musl-gcc. + CC_x86_64_unknown_linux_musl: musl-gcc steps: - uses: actions/checkout@v6 - name: Install system dependencies - run: sudo apt-get install -y libreadline-dev uuid-dev + run: sudo apt-get install -y libreadline-dev uuid-dev musl-tools - uses: jdx/mise-action@v4 - name: Install musl target run: rustup target add x86_64-unknown-linux-musl From 8435a3b21a1d3601806538f04fdc02ecf6e1e218 Mon Sep 17 00:00:00 2001 From: Jared Lunde Date: Sat, 21 Nov 2026 19:18:12 -0800 Subject: [PATCH 2/3] tests: the initdb wrapper runs gosu only as root The supervisor drops to postgres before it runs initdb, so the wrapper's gosu ran as non-root, and gosu 1.20 (now in postgres:18) refuses that: 'failed switching to postgres: operation not permitted'. Every Docker supervisor/boot test failed at initdb. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc --- tests/boot.rs | 3 ++- tests/handoff_e2e.rs | 3 ++- tests/supervisor.rs | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/boot.rs b/tests/boot.rs index c578160..2a11e6f 100644 --- a/tests/boot.rs +++ b/tests/boot.rs @@ -157,7 +157,8 @@ impl BootEnv { const BOOT_CMD: &str = "printf '%s\\n' '#!/bin/sh' \ 'for a in \"$@\"; do case \"$a\" in --pwfile=*) chmod 0644 \"${a#--pwfile=}\" 2>/dev/null;; esac; done' \ 'chown postgres:postgres /var/lib/postgresql/18/main 2>/dev/null || true' \ - 'exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' \ + '[ \"$(id -u)\" != 0 ] || exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' \ + 'exec /usr/lib/postgresql/18/bin/initdb \"$@\"' \ > /usr/local/bin/initdb && \ chmod +x /usr/local/bin/initdb && \ mkdir -p /etc/postgresql/18/hooks/pre-start.d && \ diff --git a/tests/handoff_e2e.rs b/tests/handoff_e2e.rs index c9ad40e..f9182c1 100644 --- a/tests/handoff_e2e.rs +++ b/tests/handoff_e2e.rs @@ -230,7 +230,8 @@ fn start_init_container( "printf '%s\\n' '#!/bin/sh' ", "'for a in \"$@\"; do case \"$a\" in --pwfile=*) chmod 0644 \"${a#--pwfile=}\" 2>/dev/null;; esac; done' ", "'chown postgres:postgres /var/lib/postgresql/18 /var/lib/postgresql/18/main 2>/dev/null || true' ", - "'exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'[ \"$(id -u)\" != 0 ] || exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'exec /usr/lib/postgresql/18/bin/initdb \"$@\"' ", "> /usr/local/bin/initdb && chmod +x /usr/local/bin/initdb; ", "exec /usr/local/bin/beyond-pg-init", ); diff --git a/tests/supervisor.rs b/tests/supervisor.rs index 489ddee..e28f81f 100644 --- a/tests/supervisor.rs +++ b/tests/supervisor.rs @@ -420,7 +420,8 @@ impl SupervisorHarness { "printf '%s\\n' '#!/bin/sh' ", "'for a in \"$@\"; do case \"$a\" in --pwfile=*) chmod 0644 \"${a#--pwfile=}\" 2>/dev/null;; esac; done' ", "'chown postgres:postgres /var/lib/postgresql/18/main 2>/dev/null || true' ", - "'exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'[ \"$(id -u)\" != 0 ] || exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'exec /usr/lib/postgresql/18/bin/initdb \"$@\"' ", "> /usr/local/bin/initdb && ", "chmod +x /usr/local/bin/initdb; ", "trap 'kill \"$SVPID\" 2>/dev/null; wait \"$SVPID\"; exit $?' TERM INT; ", @@ -531,7 +532,8 @@ impl SupervisorHarness { "printf '%s\\n' '#!/bin/sh' ", "'for a in \"$@\"; do case \"$a\" in --pwfile=*) chmod 0644 \"${a#--pwfile=}\" 2>/dev/null;; esac; done' ", "'chown postgres:postgres /var/lib/postgresql/18/main 2>/dev/null || true' ", - "'exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'[ \"$(id -u)\" != 0 ] || exec gosu postgres /usr/lib/postgresql/18/bin/initdb \"$@\"' ", + "'exec /usr/lib/postgresql/18/bin/initdb \"$@\"' ", "> /usr/local/bin/initdb && ", "chmod +x /usr/local/bin/initdb; ", "trap 'kill \"$SVPID\" 2>/dev/null; wait \"$SVPID\"; exit $?' TERM INT; ", From 0d92cb974eb1d7d8c4c22e3fe511d4139d0fa26f Mon Sep 17 00:00:00 2001 From: Jared Lunde Date: Sat, 21 Nov 2026 19:38:13 -0800 Subject: [PATCH 3/3] tests: docker harness uses the unix RPC socket (seccomp refuses AF_VSOCK) and disables channel binding for the SCRAM login Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc --- tests/supervisor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/supervisor.rs b/tests/supervisor.rs index e28f81f..f3f2230 100644 --- a/tests/supervisor.rs +++ b/tests/supervisor.rs @@ -433,6 +433,10 @@ impl SupervisorHarness { let mut args: Vec = vec![ "run".into(), "-d".into(), + // Docker's default seccomp profile may refuse AF_VSOCK, which the cold start binds for its RPC by default: use the unix socket the + // supervisor offers for tests (`rpc::bind_cold_start`). + "-e".into(), + "BEYOND_PG_RPC_UNIX_PATH=/run/beyond-pg-rpc.sock".into(), "--platform".into(), self.platform.into(), "-v".into(), @@ -545,6 +549,9 @@ impl SupervisorHarness { let mut args = vec![ "run".to_owned(), "-d".to_owned(), + // See `start_extra_args`: AF_VSOCK may be refused by Docker's default seccomp profile. + "-e".to_owned(), + "BEYOND_PG_RPC_UNIX_PATH=/run/beyond-pg-rpc.sock".to_owned(), "--platform".to_owned(), self.platform.to_owned(), "-v".to_owned(), @@ -693,6 +700,8 @@ fn supervisor_with_only_a_verifier_accepts_the_original_password_over_scram() { container.exec(&[ "env", &format!("PGPASSWORD={password}"), + // The server's TLS certificate has no signature digest libpq can bind the channel to ("could not find digest for NID UNDEF"). + "PGCHANNELBINDING=disable", "psql", "-h", "127.0.0.1",