Skip to content

Commit

Permalink
Switch EdgeDB 6 to PostgreSQL 17 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans authored Oct 17, 2024
1 parent 688c602 commit 4b606a6
Show file tree
Hide file tree
Showing 8 changed files with 1,962 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.12"
- uses: psf/black@stable
- uses: python/mypy@master
with:
Expand Down
18 changes: 16 additions & 2 deletions edgedbpkg/edgedb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ class EdgeDB(packages.BundledPythonPackage):
"python-edgedb (~= 3.11.0)",
"pgext-pgvector (~= 0.4.0)",
],
">=5.0.dev1": [
">=5.0.dev1,<6.0.dev8898": [
"postgresql-edgedb (~= 16.0)",
"python-edgedb (~= 3.12.0)",
"pgext-pgvector (~= 0.6.0)",
],
">=6.0.dev8898": [
"postgresql-edgedb (~= 17.0)",
"python-edgedb (~= 3.12.0)",
"pgext-pgvector (~= 0.7.0)",
],
}

artifact_build_requirements = {
Expand All @@ -98,25 +103,34 @@ class EdgeDB(packages.BundledPythonPackage):
"pyentrypoint (>=1.0.0)",
"pypkg-setuptools (<70.2.0)",
],
">=5.0.dev1": [
">=5.0.dev1,<6.0.dev8898": [
"postgresql-edgedb (~= 16.0)",
"python-edgedb (~= 3.12.0)",
"pgext-pgvector (~= 0.6.0)",
"pyentrypoint (>=1.0.0)",
"pypkg-setuptools (<70.2.0)",
],
">=6.0.dev8898": [
"postgresql-edgedb (~= 17.0)",
"python-edgedb (~= 3.12.0)",
"pgext-pgvector (~= 0.7.0)",
"pyentrypoint (>=1.0.0)",
"pypkg-setuptools (<70.2.0)",
],
}

bundle_deps = [
postgresql.PostgreSQL(version="14.11"),
postgresql.PostgreSQL(version="15.6"),
postgresql.PostgreSQL(version="16.4"),
postgresql.PostgreSQL(version="17.0"),
python_bundle.Python(version="3.10.11"),
python_bundle.Python(version="3.11.8"),
python_bundle.Python(version="3.12.2"),
pyentrypoint.PyEntryPoint(version="1.0.0"),
pgvector.PgVector("v0.4.2"),
pgvector.PgVector("v0.6.0"),
pgvector.PgVector("v0.7.4"),
]

@classmethod
Expand Down
1 change: 1 addition & 0 deletions edgedbpkg/postgresql/install.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{bindir}/initdb
{bindir}/pg_basebackup
{bindir}/pg_combinebackup
{bindir}/pg_ctl
{bindir}/pg_config
{bindir}/pg_dump
Expand Down
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

Loading

0 comments on commit 4b606a6

Please sign in to comment.