-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch EdgeDB 6 to PostgreSQL 17 (#117)
- Loading branch information
Showing
8 changed files
with
1,962 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
edgedbpkg/postgresql/patches/postgresql-edgedb__no_env_clobbering-17.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
From e77a269af07fdef6b24fa9d9efbe3493af847171 Mon Sep 17 00:00:00 2001 | ||
From: Elvis Pranskevichus <[email protected]> | ||
Date: Tue, 16 Aug 2022 22:00:31 -0700 | ||
Subject: [PATCH 3/5] Add an envvar escape hatch to disable argv clobbering | ||
|
||
The `set_ps_display` business clobbers the environment block on Linux, | ||
thus butchering all prior `getenv` calls, which includes | ||
`getenv(LD_LIBRARY_PATH)` done by `ld-musl.so`. Musl is at fault too, | ||
because it really ought to `strdup` the entry, but until that's fixed, | ||
setting `PG_DISABLE_PS_DISPLAY=1` is the fix. | ||
--- | ||
src/backend/utils/misc/ps_status.c | 21 +++++++++++++++++++++ | ||
1 file changed, 21 insertions(+) | ||
|
||
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c | ||
index 9da6377402..f82f04bf9f 100644 | ||
--- a/src/backend/utils/misc/ps_status.c | ||
+++ b/src/backend/utils/misc/ps_status.c | ||
@@ -14,6 +14,7 @@ | ||
|
||
#include "postgres.h" | ||
|
||
+#include <stdlib.h> | ||
#include <unistd.h> | ||
#if defined(__darwin__) | ||
#include <crt_externs.h> | ||
@@ -27,6 +28,7 @@ extern char **environ; | ||
|
||
/* GUC variable */ | ||
bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; | ||
+bool disable_ps_display = false; | ||
|
||
/* | ||
* Alternative ways of updating ps display: | ||
@@ -116,9 +118,16 @@ static char **save_argv; | ||
char ** | ||
save_ps_display_args(int argc, char **argv) | ||
{ | ||
+ char *disable_env = getenv("PG_DISABLE_PS_DISPLAY"); | ||
+ | ||
save_argc = argc; | ||
save_argv = argv; | ||
|
||
+ disable_ps_display = disable_env != NULL && *disable_env != '\0'; | ||
+ | ||
+ if (disable_ps_display) | ||
+ return argv; | ||
+ | ||
#if defined(PS_USE_CLOBBER_ARGV) | ||
|
||
/* | ||
@@ -266,6 +275,9 @@ save_ps_display_args(int argc, char **argv) | ||
void | ||
init_ps_display(const char *fixed_part) | ||
{ | ||
+ if (disable_ps_display) | ||
+ return; | ||
+ | ||
#ifndef PS_USE_NONE | ||
bool save_update_process_title; | ||
#endif | ||
@@ -342,6 +354,9 @@ init_ps_display(const char *fixed_part) | ||
static bool | ||
update_ps_display_precheck(void) | ||
{ | ||
+ if (disable_ps_display) | ||
+ return false; | ||
+ | ||
/* update_process_title=off disables updates */ | ||
if (!update_process_title) | ||
return false; | ||
@@ -529,6 +544,12 @@ flush_ps_display(void) | ||
const char * | ||
get_ps_display(int *displen) | ||
{ | ||
+ if (disable_ps_display) | ||
+ { | ||
+ *displen = 0; | ||
+ return ""; | ||
+ } | ||
+ | ||
#ifdef PS_USE_CLOBBER_ARGV | ||
/* If ps_buffer is a pointer, it might still be null */ | ||
if (!ps_buffer) | ||
-- | ||
2.45.2 | ||
|
Oops, something went wrong.