From 7300e96574cc0eeb95985881fbbc2cf95886cca2 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Tue, 2 Apr 2024 10:26:07 +0200 Subject: [PATCH 1/2] Add two missing files to the generated include dir --- pq-src/build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pq-src/build.rs b/pq-src/build.rs index a2a1556..1d6631d 100644 --- a/pq-src/build.rs +++ b/pq-src/build.rs @@ -232,6 +232,8 @@ fn main() { let out = env::var("OUT_DIR").expect("Set by cargo"); let include_path = PathBuf::from(&out).join("include"); let lib_pq_path = PathBuf::from(format!("{path}/{pq_path}")); + let postgres_include_path = PathBuf::from(format!("{path}src/include")); + let additional_includes_path = PathBuf::from(format!("{crate_dir}/additional_include")); fs::create_dir_all(&include_path).expect("Failed to create include directory"); fs::create_dir_all(include_path.join("postgres").join("internal")) .expect("Failed to create include directory"); @@ -245,6 +247,16 @@ fn main() { include_path.join("libpq-events.h"), ) .expect("Copying headers failed"); + fs::copy( + postgres_include_path.join("postgres_ext.h"), + include_path.join("postgres_ext.h"), + ) + .expect("Copying headers failed"); + fs::copy( + additional_includes_path.join("pg_config_ext.h"), + include_path.join("pg_config_ext.h"), + ) + .expect("Copying headers failed"); fs::copy( lib_pq_path.join("libpq-int.h"), From 3b0b90d9390ad5d53c7e6b2bcd167d8ef2a3a1e4 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 3 Apr 2024 10:55:03 +0200 Subject: [PATCH 2/2] We don't need to bundle strlcat as that might cause problems if someone else includes it --- pq-src/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pq-src/build.rs b/pq-src/build.rs index 1d6631d..2044043 100644 --- a/pq-src/build.rs +++ b/pq-src/build.rs @@ -2,7 +2,6 @@ use std::path::PathBuf; use std::{env, fs}; const LIBPORTS_BASE: &[&str] = &[ - "strlcat.c", "strlcpy.c", "snprintf.c", "pg_crc32c_sb8.c", @@ -48,6 +47,7 @@ const LIBPORTS_WINDOWS: &[&str] = &[ "win32stat.c", "open.c", "dirmod.c", + "strlcat.c", ]; const LIBCOMMON_BASE: &[&str] = &[