From ed6826b1786742cd4ef6c22e01c1a643b7222a58 Mon Sep 17 00:00:00 2001 From: Valery Meleshkin Date: Wed, 15 Feb 2023 20:16:32 +0100 Subject: [PATCH 1/2] Newer versions of Ubuntu output locale names differently, breaking the locale detection. --- pgx-pg-config/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgx-pg-config/src/lib.rs b/pgx-pg-config/src/lib.rs index d8ca9d1da..fc4109a36 100644 --- a/pgx-pg-config/src/lib.rs +++ b/pgx-pg-config/src/lib.rs @@ -32,7 +32,7 @@ pub fn get_c_locale_flags() -> &'static [&'static str] { #[cfg(not(target_os = "macos"))] { match Command::new("locale").arg("-a").output() { - Ok(cmd) if String::from_utf8_lossy(&cmd.stdout).lines().any(|l| l == "C.UTF-8") => { + Ok(cmd) if String::from_utf8_lossy(&cmd.stdout).lines().any(|l| l == "C.UTF-8" || l == "C.utf8") => { &["--locale=C.UTF-8"] } // fallback to C if we can't list locales or don't have C.UTF-8 From 373d1e5b93c7992c050463c1bef745df218964d0 Mon Sep 17 00:00:00 2001 From: Valery Meleshkin Date: Wed, 15 Feb 2023 20:27:52 +0100 Subject: [PATCH 2/2] cargo fmt-ed --- pgx-pg-config/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pgx-pg-config/src/lib.rs b/pgx-pg-config/src/lib.rs index fc4109a36..37f46d1e1 100644 --- a/pgx-pg-config/src/lib.rs +++ b/pgx-pg-config/src/lib.rs @@ -32,7 +32,11 @@ pub fn get_c_locale_flags() -> &'static [&'static str] { #[cfg(not(target_os = "macos"))] { match Command::new("locale").arg("-a").output() { - Ok(cmd) if String::from_utf8_lossy(&cmd.stdout).lines().any(|l| l == "C.UTF-8" || l == "C.utf8") => { + Ok(cmd) + if String::from_utf8_lossy(&cmd.stdout) + .lines() + .any(|l| l == "C.UTF-8" || l == "C.utf8") => + { &["--locale=C.UTF-8"] } // fallback to C if we can't list locales or don't have C.UTF-8