diff --git a/control_plane/src/compute.rs b/control_plane/src/compute.rs index 1279d941e7..fe2204b539 100644 --- a/control_plane/src/compute.rs +++ b/control_plane/src/compute.rs @@ -355,6 +355,7 @@ impl PostgresNode { ) .env_clear() .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) .status() .with_context(|| "pg_ctl failed")?; if !pg_ctl.success() { @@ -473,6 +474,7 @@ impl PostgresNode { ]) .env_clear() .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) .env("PGPORT", self.address.port().to_string()) .env("PGUSER", self.whoami()) .env("PGHOST", self.address.ip().to_string()) @@ -487,6 +489,7 @@ impl PostgresNode { let _pg_bench_init = Command::new(self.env.pg_bin_dir().join("pgbench")) .args(&["-i", "-p", port.as_str(), "postgres"]) .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) .status() .expect("pgbench -i"); let _pg_bench_run = Command::new(self.env.pg_bin_dir().join("pgbench")) @@ -504,6 +507,7 @@ impl PostgresNode { "postgres", ]) .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) .status() .expect("pgbench run"); } diff --git a/control_plane/src/local_env.rs b/control_plane/src/local_env.rs index ce3badf857..ac6eb0bfb5 100644 --- a/control_plane/src/local_env.rs +++ b/control_plane/src/local_env.rs @@ -133,14 +133,18 @@ pub fn init_repo(local_env: &mut LocalEnv) -> Result<()> { // the repository. Use "tempdir()" or something? Or just create it directly // in the repo? let initdb_path = local_env.pg_bin_dir().join("initdb"); - let _initdb = Command::new(initdb_path) + let initdb = Command::new(initdb_path) .args(&["-D", "tmp"]) .arg("--no-instructions") .env_clear() .env("LD_LIBRARY_PATH", local_env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", local_env.pg_lib_dir().to_str().unwrap()) .stdout(Stdio::null()) .status() .with_context(|| "failed to execute initdb")?; + if !initdb.success() { + anyhow::bail!("initdb failed"); + } println!("initdb succeeded"); // Read control file to extract the LSN and system id diff --git a/control_plane/src/storage.rs b/control_plane/src/storage.rs index 1a85de68f9..635e486e4e 100644 --- a/control_plane/src/storage.rs +++ b/control_plane/src/storage.rs @@ -184,7 +184,8 @@ impl PageServerNode { .env("RUST_BACKTRACE", "1") .env("ZENITH_REPO_DIR", self.repo_path()) .env("PATH", self.env.pg_bin_dir().to_str().unwrap()) // needs postres-wal-redo binary - .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()); + .env("LD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()) + .env("DYLD_LIBRARY_PATH", self.env.pg_lib_dir().to_str().unwrap()); if !cmd.status()?.success() { anyhow::bail!( diff --git a/vendor/postgres b/vendor/postgres index eb757400f8..77624689b7 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit eb757400f8c13980f020dbeaa650805881f1cebd +Subproject commit 77624689b7c93a3285186900a4dc51965d6761b6