push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
Empty the pg_config system information view. This view keeps references to
several -dev outputs, which we want to avoid to keep closure size down.
The alternative to this patch would be to nuke references across the board,
but this will also affect the output of the pg_config utility. By emptying
the view only, we keep the pg_config binary intact. It resides in the -dev
output, so it's fine to have all those references there.
---
--- a/src/backend/utils/misc/pg_config.c
+++ b/src/backend/utils/misc/pg_config.c
@@ -32,20 +32,5 @@ pg_config(PG_FUNCTION_ARGS)
/* initialize our tuplestore */
InitMaterializedSRF(fcinfo, 0);
- configdata = get_configdata(my_exec_path, &configdata_len);
- for (i = 0; i < configdata_len; i++)
- {
- Datum values[2];
- bool nulls[2];
-
- memset(values, 0, sizeof(values));
- memset(nulls, 0, sizeof(nulls));
-
- values[0] = CStringGetTextDatum(configdata[i].name);
- values[1] = CStringGetTextDatum(configdata[i].setting);
-
- tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
- }
-
return (Datum) 0;
}
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -29,7 +29,7 @@ select name, ident, parent, level, total_bytes >= free_bytes
(1 row)
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) = 0 as ok from pg_config;
ok
----
t
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -18,7 +18,7 @@ select name, ident, parent, level, total_bytes >= free_bytes
from pg_backend_memory_contexts where level = 0;
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) = 0 as ok from pg_config;
-- We expect no cursors in this test; see also portals.sql
select count(*) = 0 as ok from pg_cursors;

View File

@@ -0,0 +1,50 @@
Empty the pg_config system information view. This view keeps references to
several -dev outputs, which we want to avoid to keep closure size down.
The alternative to this patch would be to nuke references across the board,
but this will also affect the output of the pg_config utility. By emptying
the view only, we keep the pg_config binary intact. It resides in the -dev
output, so it's fine to have all those references there.
---
--- a/src/backend/utils/misc/pg_config.c
+++ b/src/backend/utils/misc/pg_config.c
@@ -69,16 +69,6 @@ pg_config(PG_FUNCTION_ARGS)
/* initialize our tuplestore */
tupstore = tuplestore_begin_heap(true, false, work_mem);
- configdata = get_configdata(my_exec_path, &configdata_len);
- for (i = 0; i < configdata_len; i++)
- {
- values[0] = configdata[i].name;
- values[1] = configdata[i].setting;
-
- tuple = BuildTupleFromCStrings(attinmeta, values);
- tuplestore_puttuple(tupstore, tuple);
- }
-
/*
* no longer need the tuple descriptor reference created by
* TupleDescGetAttInMetadata()
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -20,7 +20,7 @@ select count(*) >= 0 as ok from pg_available_extensions;
(1 row)
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) = 0 as ok from pg_config;
ok
----
t
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -13,7 +13,7 @@ select count(*) >= 0 as ok from pg_available_extension_versions;
select count(*) >= 0 as ok from pg_available_extensions;
-- At introduction, pg_config had 23 entries; it may grow
-select count(*) > 20 as ok from pg_config;
+select count(*) = 0 as ok from pg_config;
-- We expect no cursors in this test; see also portals.sql
select count(*) = 0 as ok from pg_cursors;

View File

@@ -0,0 +1,13 @@
See https://postgr.es/m/eb249761-56e2-4e42-a2c5-b9ae18c1ca1f%40technowledgy.de
---
--- a/src/makefiles/Makefile.darwin
+++ b/src/makefiles/Makefile.darwin
@@ -5,6 +5,8 @@ DLSUFFIX = .so
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = DYLD_LIBRARY_PATH
+export_dynamic = -Wl,-export_dynamic
+
ifdef PGXS
BE_DLLLIBS = -bundle_loader $(bindir)/postgres
else

View File

@@ -0,0 +1,11 @@
--- a/src/include/fe_utils/print.h
+++ b/src/include/fe_utils/print.h
@@ -18,7 +18,7 @@
/* This is not a particularly great place for this ... */
#ifndef __CYGWIN__
-#define DEFAULT_PAGER "more"
+#define DEFAULT_PAGER "less"
#else
#define DEFAULT_PAGER "less"
#endif

View File

@@ -0,0 +1,11 @@
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -611,7 +611,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
aliases = (CollAliasData *) palloc(maxaliases * sizeof(CollAliasData));
naliases = 0;
- locale_a_handle = OpenPipeStream("locale -a", "r");
+ locale_a_handle = OpenPipeStream("@locale@ -a", "r");
if (locale_a_handle == NULL)
ereport(ERROR,
(errcode_for_file_access(),

View File

@@ -0,0 +1,22 @@
--- a/src/common/config_info.c
+++ b/src/common/config_info.c
@@ -118,7 +118,7 @@
i++;
configdata[i].name = pstrdup("PGXS");
+ strlcpy(path, "@dev@/lib", sizeof(path));
- get_pkglib_path(my_exec_path, path);
strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path));
cleanup_path(path);
configdata[i].setting = pstrdup(path);
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -116,7 +116,7 @@ endif
libdir := @libdir@
-pkglibdir = $(libdir)
+pkglibdir = @out@/lib
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
override pkglibdir := $(pkglibdir)/postgresql

View File

@@ -0,0 +1,41 @@
Nix outputs put the `name' in each store path like
/nix/store/...-<name>. This was confusing the Postgres make script
because it thought its data directory already had postgresql in its
directory. This lead to Postgres installing all of its fils in
$out/share. To fix this, we just look for postgres or psql in the part
after the / using make's notdir.
---
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -102,15 +102,15 @@ datarootdir := @datarootdir@
bindir := @bindir@
datadir := @datadir@
-ifeq "$(findstring pgsql, $(datadir))" ""
-ifeq "$(findstring postgres, $(datadir))" ""
+ifeq "$(findstring pgsql, $(notdir $(datadir)))" ""
+ifeq "$(findstring postgres, $(notdir $(datadir)))" ""
override datadir := $(datadir)/postgresql
endif
endif
sysconfdir := @sysconfdir@
-ifeq "$(findstring pgsql, $(sysconfdir))" ""
-ifeq "$(findstring postgres, $(sysconfdir))" ""
+ifeq "$(findstring pgsql, $(notdir $(sysconfdir)))" ""
+ifeq "$(findstring postgres, $(notdir $(sysconfdir)))" ""
override sysconfdir := $(sysconfdir)/postgresql
endif
endif
@@ -136,8 +136,8 @@ endif
mandir := @mandir@
docdir := @docdir@
-ifeq "$(findstring pgsql, $(docdir))" ""
-ifeq "$(findstring postgres, $(docdir))" ""
+ifeq "$(findstring pgsql, $(notdir $(docdir)))" ""
+ifeq "$(findstring postgres, $(notdir $(docdir)))" ""
override docdir := $(docdir)/postgresql
endif
endif

View File

@@ -0,0 +1,13 @@
On NixOS we *want* stuff relative to symlinks.
---
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -238,6 +238,8 @@
static int
normalize_exec_path(char *path)
{
+ return 0;
+
/*
* We used to do a lot of work ourselves here, but now we just let
* realpath(3) do all the heavy lifting.

View File

@@ -0,0 +1,13 @@
On NixOS we *want* stuff relative to symlinks.
---
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -218,6 +218,8 @@
static int
resolve_symlinks(char *path)
{
+ return 0;
+
#ifdef HAVE_READLINK
struct stat buf;
char orig_wd[MAXPGPATH],

View File

@@ -0,0 +1,11 @@
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -201,7 +201,7 @@
* support them yet.
*/
#ifndef WIN32
-#define DEFAULT_PGSOCKET_DIR "/tmp"
+#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
#else
#define DEFAULT_PGSOCKET_DIR ""
#endif