public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v2] Fix various shared memory estimates.
44+ messages / 7 participants
[nested] [flat]
* [PATCH v2] Fix various shared memory estimates.
@ 2021-02-27 07:45 Julien Rouhaud <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Julien Rouhaud @ 2021-02-27 07:45 UTC (permalink / raw)
---
contrib/pg_prewarm/autoprewarm.c | 2 +-
.../pg_stat_statements/pg_stat_statements.c | 2 +-
src/backend/access/common/syncscan.c | 2 +-
src/backend/access/nbtree/nbtutils.c | 3 +-
src/backend/access/transam/multixact.c | 2 +-
src/backend/access/transam/slru.c | 2 +-
src/backend/access/transam/twophase.c | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/commands/async.c | 1 +
src/backend/postmaster/autovacuum.c | 3 +-
src/backend/postmaster/bgworker.c | 2 +-
src/backend/postmaster/checkpointer.c | 2 +-
src/backend/postmaster/pgstat.c | 17 ++---
src/backend/postmaster/postmaster.c | 2 +-
src/backend/replication/logical/launcher.c | 3 +-
src/backend/replication/logical/origin.c | 3 +-
src/backend/replication/slot.c | 2 +-
src/backend/replication/walreceiverfuncs.c | 2 +-
src/backend/replication/walsender.c | 2 +-
src/backend/storage/buffer/buf_init.c | 14 ++--
src/backend/storage/buffer/buf_table.c | 3 +-
src/backend/storage/buffer/freelist.c | 2 +-
src/backend/storage/ipc/dsm.c | 2 +-
src/backend/storage/ipc/pmsignal.c | 2 +-
src/backend/storage/ipc/procarray.c | 8 +--
src/backend/storage/ipc/procsignal.c | 2 +-
src/backend/storage/ipc/sinvaladt.c | 2 +-
src/backend/storage/lmgr/lock.c | 16 ++++-
src/backend/storage/lmgr/lwlock.c | 2 +-
src/backend/storage/lmgr/predicate.c | 22 +++---
src/backend/storage/lmgr/proc.c | 12 ++--
src/backend/utils/hash/dynahash.c | 69 ++++++++++++++-----
src/backend/utils/time/snapmgr.c | 2 +-
src/include/storage/predicate_internals.h | 4 +-
src/include/storage/shmem.h | 13 ++++
src/include/utils/hsearch.h | 2 +
36 files changed, 146 insertions(+), 87 deletions(-)
diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c
index b3f73ea92d..887e68b288 100644
--- a/contrib/pg_prewarm/autoprewarm.c
+++ b/contrib/pg_prewarm/autoprewarm.c
@@ -138,7 +138,7 @@ _PG_init(void)
EmitWarningsOnPlaceholders("pg_prewarm");
- RequestAddinShmemSpace(MAXALIGN(sizeof(AutoPrewarmSharedState)));
+ RequestAddinShmemSpace(CACHELINEALIGN(sizeof(AutoPrewarmSharedState)));
/* Register autoprewarm worker, if enabled. */
if (autoprewarm)
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 62cccbfa44..4e045ffba7 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -1933,7 +1933,7 @@ pgss_memsize(void)
{
Size size;
- size = MAXALIGN(sizeof(pgssSharedState));
+ size = CACHELINEALIGN(sizeof(pgssSharedState));
size = add_size(size, hash_estimate_size(pgss_max, sizeof(pgssEntry)));
return size;
diff --git a/src/backend/access/common/syncscan.c b/src/backend/access/common/syncscan.c
index b7a28af4ad..c19f9cab59 100644
--- a/src/backend/access/common/syncscan.c
+++ b/src/backend/access/common/syncscan.c
@@ -125,7 +125,7 @@ static BlockNumber ss_search(RelFileNode relfilenode,
Size
SyncScanShmemSize(void)
{
- return SizeOfScanLocations(SYNC_SCAN_NELEM);
+ return (Size) CACHELINEALIGN(SizeOfScanLocations(SYNC_SCAN_NELEM));
}
/*
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index d524310723..310ea904df 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -2066,7 +2066,8 @@ BTreeShmemSize(void)
size = offsetof(BTVacInfo, vacuums);
size = add_size(size, mul_size(MaxBackends, sizeof(BTOneVacInfo)));
- return size;
+
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 1f9f1a1fa1..c789623c34 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -1830,7 +1830,7 @@ MultiXactShmemSize(void)
add_size(offsetof(MultiXactStateData, perBackendXactIds) + sizeof(MultiXactId), \
mul_size(sizeof(MultiXactId) * 2, MaxOldestSlot))
- size = SHARED_MULTIXACT_STATE_SIZE;
+ size = CACHELINEALIGN(SHARED_MULTIXACT_STATE_SIZE);
size = add_size(size, SimpleLruShmemSize(NUM_MULTIXACTOFFSET_BUFFERS, 0));
size = add_size(size, SimpleLruShmemSize(NUM_MULTIXACTMEMBER_BUFFERS, 0));
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index 82149ad782..2271e092e9 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -168,7 +168,7 @@ SimpleLruShmemSize(int nslots, int nlsns)
if (nlsns > 0)
sz += MAXALIGN(nslots * nlsns * sizeof(XLogRecPtr)); /* group_lsn[] */
- return BUFFERALIGN(sz) + BLCKSZ * nslots;
+ return (Size) CACHELINEALIGN(BUFFERALIGN(sz) + BLCKSZ * nslots);
}
/*
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index 80d2d20d6c..fca70fabac 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -245,7 +245,7 @@ TwoPhaseShmemSize(void)
size = add_size(size, mul_size(max_prepared_xacts,
sizeof(GlobalTransactionData)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
void
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 377afb8732..64de453340 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5096,7 +5096,7 @@ XLOGShmemSize(void)
* routine again below to compute the actual allocation size.
*/
- return size;
+ return (Size) CACHELINEALIGN(size);
}
void
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 4b16fb5682..6a0fd6ca10 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -513,6 +513,7 @@ AsyncShmemSize(void)
/* This had better match AsyncShmemInit */
size = mul_size(MaxBackends + 1, sizeof(QueueBackendStatus));
size = add_size(size, offsetof(AsyncQueueControl, backend));
+ size = (Size) CACHELINEALIGN(size);
size = add_size(size, SimpleLruShmemSize(NUM_NOTIFY_BUFFERS, 0));
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 23ef23c13e..7ddf86af74 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -3414,7 +3414,8 @@ AutoVacuumShmemSize(void)
size = MAXALIGN(size);
size = add_size(size, mul_size(autovacuum_max_workers,
sizeof(WorkerInfoData)));
- return size;
+
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index bbbc09b0b5..d2f838eaed 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -148,7 +148,7 @@ BackgroundWorkerShmemSize(void)
size = add_size(size, mul_size(max_worker_processes,
sizeof(BackgroundWorkerSlot)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 76f9f98ebb..6acd5e4c2b 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -862,7 +862,7 @@ CheckpointerShmemSize(void)
size = offsetof(CheckpointerShmemStruct, requests);
size = add_size(size, mul_size(NBuffers, sizeof(CheckpointerRequest)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index f75b52719d..b08f7f1d56 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -2930,25 +2930,20 @@ BackendStatusShmemSize(void)
Size size;
/* BackendStatusArray: */
- size = mul_size(sizeof(PgBackendStatus), NumBackendStatSlots);
+ size = mul_size_and_shmem_align(sizeof(PgBackendStatus), NumBackendStatSlots);
/* BackendAppnameBuffer: */
- size = add_size(size,
- mul_size(NAMEDATALEN, NumBackendStatSlots));
+ size = add_shmem_aligned_size(size, mul_size(NAMEDATALEN, NumBackendStatSlots));
/* BackendClientHostnameBuffer: */
- size = add_size(size,
- mul_size(NAMEDATALEN, NumBackendStatSlots));
+ size = add_shmem_aligned_size(size, mul_size(NAMEDATALEN, NumBackendStatSlots));
/* BackendActivityBuffer: */
- size = add_size(size,
- mul_size(pgstat_track_activity_query_size, NumBackendStatSlots));
+ size = add_shmem_aligned_size(size, mul_size(pgstat_track_activity_query_size, NumBackendStatSlots));
#ifdef USE_SSL
/* BackendSslStatusBuffer: */
- size = add_size(size,
- mul_size(sizeof(PgBackendSSLStatus), NumBackendStatSlots));
+ size = add_shmem_aligned_size(size, mul_size(sizeof(PgBackendSSLStatus), NumBackendStatSlots));
#endif
#ifdef ENABLE_GSS
/* BackendGssStatusBuffer: */
- size = add_size(size,
- mul_size(sizeof(PgBackendGSSStatus), NumBackendStatSlots));
+ size = add_shmem_aligned_size(size, mul_size(sizeof(PgBackendGSSStatus), NumBackendStatSlots));
#endif
return size;
}
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index edab95a19e..716f7434e6 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -6425,7 +6425,7 @@ restore_backend_variables(BackendParameters *param, Port *port)
Size
ShmemBackendArraySize(void)
{
- return mul_size(MaxLivePostmasterChildren(), sizeof(Backend));
+ return mul_size_and_shmem_align(MaxLivePostmasterChildren(), sizeof(Backend));
}
void
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index cb462a052a..7d20877920 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -697,7 +697,8 @@ ApplyLauncherShmemSize(void)
size = MAXALIGN(size);
size = add_size(size, mul_size(max_logical_replication_workers,
sizeof(LogicalRepWorker)));
- return size;
+
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 39471fddad..b9e9fa121a 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -503,7 +503,8 @@ ReplicationOriginShmemSize(void)
size = add_size(size,
mul_size(max_replication_slots, sizeof(ReplicationState)));
- return size;
+
+ return (Size) CACHELINEALIGN(size);
}
void
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 75a087c2f9..c399c491e9 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -124,7 +124,7 @@ ReplicationSlotsShmemSize(void)
size = add_size(size,
mul_size(max_replication_slots, sizeof(ReplicationSlot)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/replication/walreceiverfuncs.c b/src/backend/replication/walreceiverfuncs.c
index 63e60478ea..a8cab3fa28 100644
--- a/src/backend/replication/walreceiverfuncs.c
+++ b/src/backend/replication/walreceiverfuncs.c
@@ -45,7 +45,7 @@ WalRcvShmemSize(void)
size = add_size(size, sizeof(WalRcvData));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/* Allocate and initialize walreceiver-related shared memory */
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 23baa4498a..d1c91cf354 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -3055,7 +3055,7 @@ WalSndShmemSize(void)
size = offsetof(WalSndCtlData, walsnds);
size = add_size(size, mul_size(max_wal_senders, sizeof(WalSnd)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/* Allocate and initialize walsender-related shared memory */
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c
index e9e4f35bb5..b92fdeef14 100644
--- a/src/backend/storage/buffer/buf_init.c
+++ b/src/backend/storage/buffer/buf_init.c
@@ -159,15 +159,13 @@ BufferShmemSize(void)
Size size = 0;
/* size of buffer descriptors */
- size = add_size(size, mul_size(NBuffers, sizeof(BufferDescPadded)));
- /* to allow aligning buffer descriptors */
- size = add_size(size, PG_CACHE_LINE_SIZE);
+ size = add_shmem_aligned_size(size, mul_size(NBuffers, sizeof(BufferDescPadded)));
/* size of data pages */
- size = add_size(size, mul_size(NBuffers, BLCKSZ));
+ size = add_shmem_aligned_size(size, mul_size(NBuffers, BLCKSZ));
/* size of stuff controlled by freelist.c */
- size = add_size(size, StrategyShmemSize());
+ size = add_shmem_aligned_size(size, StrategyShmemSize());
/*
* It would be nice to include the I/O locks in the BufferDesc, but that
@@ -178,12 +176,10 @@ BufferShmemSize(void)
* locks are not highly contended, we lay out the array with minimal
* padding.
*/
- size = add_size(size, mul_size(NBuffers, sizeof(LWLockMinimallyPadded)));
- /* to allow aligning the above */
- size = add_size(size, PG_CACHE_LINE_SIZE);
+ size = add_shmem_aligned_size(size, mul_size(NBuffers, sizeof(LWLockMinimallyPadded)));
/* size of checkpoint sort array in bufmgr.c */
- size = add_size(size, mul_size(NBuffers, sizeof(CkptSortItem)));
+ size = add_shmem_aligned_size(size, mul_size(NBuffers, sizeof(CkptSortItem)));
return size;
}
diff --git a/src/backend/storage/buffer/buf_table.c b/src/backend/storage/buffer/buf_table.c
index caa03ae123..4200f99340 100644
--- a/src/backend/storage/buffer/buf_table.c
+++ b/src/backend/storage/buffer/buf_table.c
@@ -41,7 +41,8 @@ static HTAB *SharedBufHash;
Size
BufTableShmemSize(int size)
{
- return hash_estimate_size(size, sizeof(BufferLookupEnt));
+ return hash_estimate_size_ext(size, sizeof(BufferLookupEnt),
+ size, true);
}
/*
diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c
index 6be80476db..33e9e74f40 100644
--- a/src/backend/storage/buffer/freelist.c
+++ b/src/backend/storage/buffer/freelist.c
@@ -459,7 +459,7 @@ StrategyShmemSize(void)
size = add_size(size, BufTableShmemSize(NBuffers + NUM_BUFFER_PARTITIONS));
/* size of the shared replacement strategy control block */
- size = add_size(size, MAXALIGN(sizeof(BufferStrategyControl)));
+ size = add_shmem_aligned_size(size, sizeof(BufferStrategyControl));
return size;
}
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c
index b461a5f7e9..6ecf195c55 100644
--- a/src/backend/storage/ipc/dsm.c
+++ b/src/backend/storage/ipc/dsm.c
@@ -440,7 +440,7 @@ dsm_set_control_handle(dsm_handle h)
size_t
dsm_estimate_size(void)
{
- return 1024 * 1024 * (size_t) min_dynamic_shared_memory;
+ return (size_t) CACHELINEALIGN(1024 * 1024 * min_dynamic_shared_memory);
}
/*
diff --git a/src/backend/storage/ipc/pmsignal.c b/src/backend/storage/ipc/pmsignal.c
index 280c2395c9..d25080224a 100644
--- a/src/backend/storage/ipc/pmsignal.c
+++ b/src/backend/storage/ipc/pmsignal.c
@@ -124,7 +124,7 @@ PMSignalShmemSize(void)
size = add_size(size, mul_size(MaxLivePostmasterChildren(),
sizeof(sig_atomic_t)));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 4fc6ffb917..9b804f1152 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -358,6 +358,7 @@ ProcArrayShmemSize(void)
size = offsetof(ProcArrayStruct, pgprocnos);
size = add_size(size, mul_size(sizeof(int), PROCARRAY_MAXPROCS));
+ size = CACHELINEALIGN(size);
/*
* During Hot Standby processing we have a data structure called
@@ -377,11 +378,8 @@ ProcArrayShmemSize(void)
if (EnableHotStandby)
{
- size = add_size(size,
- mul_size(sizeof(TransactionId),
- TOTAL_MAX_CACHED_SUBXIDS));
- size = add_size(size,
- mul_size(sizeof(bool), TOTAL_MAX_CACHED_SUBXIDS));
+ size = add_shmem_aligned_size(size, mul_size(sizeof(TransactionId), TOTAL_MAX_CACHED_SUBXIDS));
+ size = add_shmem_aligned_size(size, mul_size(sizeof(bool), TOTAL_MAX_CACHED_SUBXIDS));
}
return size;
diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c
index c6a8d4611e..2af7f3e343 100644
--- a/src/backend/storage/ipc/procsignal.c
+++ b/src/backend/storage/ipc/procsignal.c
@@ -113,7 +113,7 @@ ProcSignalShmemSize(void)
size = mul_size(NumProcSignalSlots, sizeof(ProcSignalSlot));
size = add_size(size, offsetof(ProcSignalHeader, psh_slot));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c
index 946bd8e3cb..8379bf12e7 100644
--- a/src/backend/storage/ipc/sinvaladt.c
+++ b/src/backend/storage/ipc/sinvaladt.c
@@ -207,7 +207,7 @@ SInvalShmemSize(void)
size = offsetof(SISeg, procState);
size = add_size(size, mul_size(sizeof(ProcState), MaxBackends));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 108b4d9023..f2fc8af5c5 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -54,7 +54,7 @@
int max_locks_per_xact; /* set by guc.c */
#define NLOCKENTS() \
- mul_size(max_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))
+ mul_size_and_shmem_align(max_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))
/*
@@ -3527,17 +3527,27 @@ LockShmemSize(void)
/* lock hash table */
max_table_size = NLOCKENTS();
- size = add_size(size, hash_estimate_size(max_table_size, sizeof(LOCK)));
+ size = add_size(size, hash_estimate_size_ext(max_table_size, sizeof(LOCK),
+ max_table_size / 2,
+ true));
/* proclock hash table */
max_table_size *= 2;
- size = add_size(size, hash_estimate_size(max_table_size, sizeof(PROCLOCK)));
+ size = add_size(size, hash_estimate_size_ext(max_table_size, sizeof(PROCLOCK),
+ max_table_size / 2,
+ true));
/*
* Since NLOCKENTS is only an estimate, add 10% safety margin.
*/
size = add_size(size, size / 10);
+ /*
+ * Note: we don't count fast-path structure, it comes out of the "slop
+ * factor" added by CreateSharedMemoryAndSemaphores. This lets us use this
+ * routine again below to compute the actual allocation size.
+ */
+
return size;
}
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 8cb6a6f042..6a47918616 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -456,7 +456,7 @@ LWLockShmemSize(void)
/* Disallow adding any more named tranches. */
lock_named_request_allowed = false;
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index d493aeef0f..1dcadc00ae 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -1359,13 +1359,17 @@ PredicateLockShmemSize(void)
/* predicate lock target hash table */
max_table_size = NPREDICATELOCKTARGETENTS();
- size = add_size(size, hash_estimate_size(max_table_size,
- sizeof(PREDICATELOCKTARGET)));
+ size = add_size(size, hash_estimate_size_ext(max_table_size,
+ sizeof(PREDICATELOCKTARGET),
+ max_table_size,
+ true));
/* predicate lock hash table */
max_table_size *= 2;
- size = add_size(size, hash_estimate_size(max_table_size,
- sizeof(PREDICATELOCK)));
+ size = add_size(size, hash_estimate_size_ext(max_table_size,
+ sizeof(PREDICATELOCK),
+ max_table_size,
+ true));
/*
* Since NPREDICATELOCKTARGETENTS is only an estimate, add 10% safety
@@ -1377,8 +1381,7 @@ PredicateLockShmemSize(void)
max_table_size = MaxBackends + max_prepared_xacts;
max_table_size *= 10;
size = add_size(size, PredXactListDataSize);
- size = add_size(size, mul_size((Size) max_table_size,
- PredXactListElementDataSize));
+ size = add_shmem_aligned_size(size, mul_size((Size) max_table_size, PredXactListElementDataSize));
/* transaction xid table */
size = add_size(size, hash_estimate_size(max_table_size,
@@ -1387,14 +1390,13 @@ PredicateLockShmemSize(void)
/* rw-conflict pool */
max_table_size *= 5;
size = add_size(size, RWConflictPoolHeaderDataSize);
- size = add_size(size, mul_size((Size) max_table_size,
- RWConflictDataSize));
+ size = add_shmem_aligned_size(size, mul_size((Size) max_table_size, RWConflictDataSize));
/* Head for list of finished serializable transactions. */
- size = add_size(size, sizeof(SHM_QUEUE));
+ size = add_shmem_aligned_size(size, sizeof(SHM_QUEUE));
/* Shared memory structures for SLRU tracking of old committed xids. */
- size = add_size(size, sizeof(SerialControlData));
+ size = add_shmem_aligned_size(size, sizeof(SerialControlData));
size = add_size(size, SimpleLruShmemSize(NUM_SERIAL_BUFFERS, 0));
return size;
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 897045ee27..28031c7d22 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -106,13 +106,13 @@ ProcGlobalShmemSize(void)
add_size(MaxBackends, add_size(NUM_AUXILIARY_PROCS, max_prepared_xacts));
/* ProcGlobal */
- size = add_size(size, sizeof(PROC_HDR));
- size = add_size(size, mul_size(TotalProcs, sizeof(PGPROC)));
- size = add_size(size, sizeof(slock_t));
+ size = add_shmem_aligned_size(size, sizeof(PROC_HDR));
+ size = add_shmem_aligned_size(size, mul_size(TotalProcs, sizeof(PGPROC)));
+ size = add_shmem_aligned_size(size, sizeof(slock_t));
- size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->xids)));
- size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->subxidStates)));
- size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->statusFlags)));
+ size = add_shmem_aligned_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->xids)));
+ size = add_shmem_aligned_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->subxidStates)));
+ size = add_shmem_aligned_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->statusFlags)));
return size;
}
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 6546e3c7c7..030ca3917c 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -769,23 +769,43 @@ init_htab(HTAB *hashp, long nelem)
return true;
}
+/*
+ * Wrapper around hash_estimate_size for non partitioned hash table and all
+ * entries preallocated.
+ */
+Size
+hash_estimate_size(long num_entries, Size entrysize)
+{
+ return hash_estimate_size_ext(num_entries, entrysize, num_entries, false);
+}
+
/*
* Estimate the space needed for a hashtable containing the given number
- * of entries of given size.
+ * of entries of given size, and given it's partitioned or not.
* NOTE: this is used to estimate the footprint of hashtables in shared
* memory; therefore it does not count HTAB which is in local memory.
* NB: assumes that all hash structure parameters have default values!
*/
Size
-hash_estimate_size(long num_entries, Size entrysize)
+hash_estimate_size_ext(long num_entries, Size entrysize, long init_entries,
+ bool partitioned)
{
- Size size;
+ Size size,
+ segmentSize,
+ freelistAllocSize;
long nBuckets,
nSegments,
nDirEntries,
- nElementAllocs,
elementSize,
- elementAllocCnt;
+ nelemFreelist;
+ int nFreelists;
+
+ if (partitioned)
+ nFreelists = NUM_FREELISTS;
+ else
+ nFreelists = 1;
+
+ Assert(init_entries <= num_entries);
/* estimate number of buckets wanted */
nBuckets = next_pow2_long(num_entries);
@@ -797,19 +817,36 @@ hash_estimate_size(long num_entries, Size entrysize)
nDirEntries <<= 1; /* dir_alloc doubles dsize at each call */
/* fixed control info */
- size = MAXALIGN(sizeof(HASHHDR)); /* but not HTAB, per above */
+ size = CACHELINEALIGN(sizeof(HASHHDR)); /* but not HTAB, per above */
/* directory */
- size = add_size(size, mul_size(nDirEntries, sizeof(HASHSEGMENT)));
+ size = add_shmem_aligned_size(size, mul_size(nDirEntries, sizeof(HASHSEGMENT)));
/* segments */
- size = add_size(size, mul_size(nSegments,
- MAXALIGN(DEF_SEGSIZE * sizeof(HASHBUCKET))));
- /* elements --- allocated in groups of choose_nelem_alloc() entries */
- elementAllocCnt = choose_nelem_alloc(entrysize);
- nElementAllocs = (num_entries - 1) / elementAllocCnt + 1;
+ segmentSize = CACHELINEALIGN(DEF_SEGSIZE * sizeof(HASHBUCKET));
+ size = add_size(size, mul_size(nSegments, segmentSize));
+
elementSize = MAXALIGN(sizeof(HASHELEMENT)) + MAXALIGN(entrysize);
- size = add_size(size,
- mul_size(nElementAllocs,
- mul_size(elementAllocCnt, elementSize)));
+
+ /*
+ * elements --- allocated in groups of choose_nelem_alloc() entries, except
+ * for the first init_entries, allocated in num_freelists groups.
+ */
+ nelemFreelist = init_entries / nFreelists;
+ freelistAllocSize = mul_size_and_shmem_align(nelemFreelist, elementSize);
+
+ size = add_size(size, mul_size(nFreelists, freelistAllocSize));
+
+ if (num_entries > init_entries)
+ {
+ Size nelem,
+ nAlloc,
+ allocSize;
+
+ nelem = choose_nelem_alloc(entrysize);
+ nAlloc = (num_entries - init_entries - 1) / nelem + 1;
+ allocSize = mul_size_and_shmem_align(nelem, elementSize);
+
+ size = add_size(size, mul_size(nAlloc, allocSize));
+ }
return size;
}
@@ -852,7 +889,7 @@ hash_get_shared_size(HASHCTL *info, int flags)
{
Assert(flags & HASH_DIRSIZE);
Assert(info->dsize == info->max_dsize);
- return sizeof(HASHHDR) + info->dsize * sizeof(HASHSEGMENT);
+ return (Size) CACHELINEALIGN(sizeof(HASHHDR) + info->dsize * sizeof(HASHSEGMENT));
}
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 95704265b6..b66278e466 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -203,7 +203,7 @@ SnapMgrShmemSize(void)
size = add_size(size, mul_size(sizeof(TransactionId),
OLD_SNAPSHOT_TIME_MAP_ENTRIES));
- return size;
+ return (Size) CACHELINEALIGN(size);
}
/*
diff --git a/src/include/storage/predicate_internals.h b/src/include/storage/predicate_internals.h
index 104f560d38..bbc6ca4cbf 100644
--- a/src/include/storage/predicate_internals.h
+++ b/src/include/storage/predicate_internals.h
@@ -192,7 +192,7 @@ typedef struct PredXactListData
typedef struct PredXactListData *PredXactList;
#define PredXactListDataSize \
- ((Size)MAXALIGN(sizeof(PredXactListData)))
+ ((Size)CACHELINEALIGN(sizeof(PredXactListData)))
/*
@@ -227,7 +227,7 @@ typedef struct RWConflictPoolHeaderData
typedef struct RWConflictPoolHeaderData *RWConflictPoolHeader;
#define RWConflictPoolHeaderDataSize \
- ((Size)MAXALIGN(sizeof(RWConflictPoolHeaderData)))
+ ((Size)CACHELINEALIGN(sizeof(RWConflictPoolHeaderData)))
/*
diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h
index 31024e5a50..897672bc8e 100644
--- a/src/include/storage/shmem.h
+++ b/src/include/storage/shmem.h
@@ -45,6 +45,19 @@ extern void *ShmemInitStruct(const char *name, Size size, bool *foundPtr);
extern Size add_size(Size s1, Size s2);
extern Size mul_size(Size s1, Size s2);
+/*
+ * Macro around add_size and mul_size to account for extra padding as done in
+ * ShmemAlloc().
+ *
+ * add_shmem_aligned_size() will add the padding bytes to the 2nd argument
+ * mul_size_and_shmem_align will return the aligned size
+ */
+#define add_shmem_aligned_size(s1, s2) add_size((s1), \
+ (Size) CACHELINEALIGN(s2))
+
+#define mul_size_and_shmem_align(s1, s2) add_shmem_aligned_size(0, \
+ mul_size((s1), (s2)))
+
/* ipci.c */
extern void RequestAddinShmemSpace(Size size);
diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h
index d7af0239c8..20c0ff3036 100644
--- a/src/include/utils/hsearch.h
+++ b/src/include/utils/hsearch.h
@@ -145,6 +145,8 @@ extern void *hash_seq_search(HASH_SEQ_STATUS *status);
extern void hash_seq_term(HASH_SEQ_STATUS *status);
extern void hash_freeze(HTAB *hashp);
extern Size hash_estimate_size(long num_entries, Size entrysize);
+extern Size hash_estimate_size_ext(long num_entries, Size entrysize,
+ long init_entries, bool num_freelists);
extern long hash_select_dirsize(long num_entries);
extern Size hash_get_shared_size(HASHCTL *info, int flags);
extern void AtEOXact_HashTables(bool isCommit);
--
2.30.1
--qghjt52pj73pl6gt--
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v6
@ 2022-03-08 02:56 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-03-08 02:56 UTC (permalink / raw)
To: pgsql-hackers
Hi,
Attached is v6 of the meson patchset. There are a lots of changes since the
last version posted. These include:
- python2 removal is now committed, so not needed in here anymore
- CI changed to be based on the CI now merged into postgres
- CI also tests suse, rhel, fedora (Nazir Bilal Yavuz). Found several bugs. I
don't think we'd merge all of those, but while working on the meson branch,
it's really useful.
- all dependencies, except for pl/tcl (should be done soon)
- several missing options added (segsize, extra_{lib,include}_dirs, enable-tap-tests
- several portability fixes, builds on net/openbsd without changes now
- improvements to a number of "configure" tests
- lots of ongoing rebasing changes
- ...
Greetings,
Andres Freund
Attachments:
[application/x-patch-gzip] v6-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz (2.9K, ../../[email protected]/2-v6-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz)
download
[application/x-patch-gzip] v6-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz (1.8K, ../../[email protected]/3-v6-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz)
download
[application/x-patch-gzip] v6-0003-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz (841B, ../../[email protected]/4-v6-0003-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz)
download
[application/x-patch-gzip] v6-0004-meson-prereq-add-src-tools-gen_versioning_script..patch.gz (940B, ../../[email protected]/5-v6-0004-meson-prereq-add-src-tools-gen_versioning_script..patch.gz)
download
[application/x-patch-gzip] v6-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz (1.1K, ../../[email protected]/6-v6-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz)
download
[application/x-patch-gzip] v6-0006-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz (648B, ../../[email protected]/7-v6-0006-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz)
download
[application/x-patch-gzip] v6-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz (5.4K, ../../[email protected]/8-v6-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz)
download
[application/x-patch-gzip] v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz (983B, ../../[email protected]/9-v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz)
download
[application/x-patch-gzip] v6-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz (1.6K, ../../[email protected]/10-v6-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz)
download
[application/x-patch-gzip] v6-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz (805B, ../../[email protected]/11-v6-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz)
download
[application/x-patch-gzip] v6-0011-ldap-tests-Add-paths-for-openbsd.patch.gz (550B, ../../[email protected]/12-v6-0011-ldap-tests-Add-paths-for-openbsd.patch.gz)
download
[application/x-patch-gzip] v6-0012-wip-split-TESTDIR-into-two.patch.gz (1.9K, ../../[email protected]/13-v6-0012-wip-split-TESTDIR-into-two.patch.gz)
download
[application/x-patch-gzip] v6-0013-meson-Add-meson-based-buildsystem.patch.gz (61.4K, ../../[email protected]/14-v6-0013-meson-Add-meson-based-buildsystem.patch.gz)
download
[application/x-patch-gzip] v6-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz (4.4K, ../../[email protected]/15-v6-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz)
download
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v6
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
@ 2022-03-09 12:37 ` Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-24 15:16 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
0 siblings, 2 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-03-09 12:37 UTC (permalink / raw)
To: Andres Freund <[email protected]>; pgsql-hackers
On 08.03.22 03:56, Andres Freund wrote:
> Attached is v6 of the meson patchset. There are a lots of changes since the
> last version posted. These include:
> - python2 removal is now committed, so not needed in here anymore
> - CI changed to be based on the CI now merged into postgres
> - CI also tests suse, rhel, fedora (Nazir Bilal Yavuz). Found several bugs. I
> don't think we'd merge all of those, but while working on the meson branch,
> it's really useful.
> - all dependencies, except for pl/tcl (should be done soon)
> - several missing options added (segsize, extra_{lib,include}_dirs, enable-tap-tests
> - several portability fixes, builds on net/openbsd without changes now
> - improvements to a number of "configure" tests
> - lots of ongoing rebasing changes
> - ...
I looked at this today mainly to consider whether some of the prereq
work is ready for adoption now. A lot of the work has to do with
making various scripts write the output to other directories. I
suspect this has something to do with how meson handles separate build
directories and how we have so far handled files created in the
distribution tarball. But the whole picture isn't clear to me.
More generally, I don't see a distprep target in the meson build
files. I wonder what your plan for that is, or whether that would
even work under meson. In [0], I argued for getting rid of the
distprep step. Perhaps it is time to reconsider that now.
[0]:
https://www.postgresql.org/message-id/flat/cf0bec33-d965-664d-e0ec-fb15290f2273%402ndquadrant.com
For the short term, I think the patches 0002, 0008, 0010, and 0011
could be adopted, if they are finished as described.
Patch 0007 seems unrelated, or at least independently significant, and
should be discussed separately.
The rest is really all part of the same
put-things-in-the-right-directory issue.
For the overall patch set, I did a quick test with
meson setup build
cd build
ninja
which failed with
Undefined symbols for architecture x86_64:
"_bbsink_zstd_new", referenced from:
_SendBaseBackup in replication_basebackup.c.o
So maybe your patch set is not up to date with this new zstd build
option.
Details:
v6-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz
This all looks kind of reasonable, but lacks explanation in some
cases, so I can't fully judge it.
v6-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz
Looks like a reasonable direction, would be good to deduplicate with
Install.pm.
v6-0003-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz
Ok. Similar to 0001. (But unlike 0001, nothing in this patch
actually uses the new output dir option. That only comes in 0013.)
v6-0004-meson-prereq-add-src-tools-gen_versioning_script..patch.gz
This isn't used until 0013, and there it is patched again, so I'm not
sure if this is in the right position of this patch series.
v6-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz
Also similar to 0001.
v6-0006-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz
Might as well include this into 0002.
v6-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz
This is a separate discussion. It's not clear to me why this is part
of this patch series.
v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz
Part of this was already done in 0001, so check if these patches are
split correctly.
I think the right way here is actually to go the other way around:
Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
assignment from src/makefiles/ to src/templates/, have configure read
it, and then substitute it into Makefile.global and pg_config.h.
Then we also don't have to patch the Windows build code a bunch of
times to add the DLSUFFIX define everywhere.
There is code in configure already that would benefit from this, which
currently says
# We don't know the platform DLSUFFIX here, so check 'em all.
v6-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz
Another directory issue
v6-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz
Not sure what this is supposed to do, but it looks independent of this
patch series. Does it currently not work on "unsupported" operating
systems?
v6-0011-ldap-tests-Add-paths-for-openbsd.patch.gz
The more the merrier, although I'm a little bit worried about pointing
to a /usr/local/share/examples/ directory.
v6-0012-wip-split-TESTDIR-into-two.patch.gz
v6-0013-meson-Add-meson-based-buildsystem.patch.gz
v6-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz
I suggest in the interim to add a README.meson to show how to invoke
this. Eventually, of course, we'd rewrite the installation
instructions.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v7
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
@ 2022-03-09 16:44 ` Andres Freund <[email protected]>
2022-03-10 16:31 ` Re: [RFC] building postgres with meson -v7 Peter Eisentraut <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
1 sibling, 2 replies; 44+ messages in thread
From: Andres Freund @ 2022-03-09 16:44 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-03-09 13:37:23 +0100, Peter Eisentraut wrote:
> I looked at this today mainly to consider whether some of the prereq
> work is ready for adoption now.
Thanks!
> A lot of the work has to do with
> making various scripts write the output to other directories. I
> suspect this has something to do with how meson handles separate build
> directories and how we have so far handled files created in the
> distribution tarball. But the whole picture isn't clear to me.
A big part of it is that when building with ninja tools are invoked in the
top-level build directory, but right now a bunch of our scripts put their
output in CWD.
> More generally, I don't see a distprep target in the meson build
> files. I wonder what your plan for that is, or whether that would
> even work under meson. In [0], I argued for getting rid of the
> distprep step. Perhaps it is time to reconsider that now.
>
> [0]: https://www.postgresql.org/message-id/flat/cf0bec33-d965-664d-e0ec-fb15290f2273%402ndquadrant.com
I think it should be doable to add something roughly like the current distprep. The
cleanest way would be to use
https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonadd_dist_script
to copy the files into the generated tarball.
Of course not adding it would be even easier ;)
> For the short term, I think the patches 0002, 0008, 0010, and 0011
> could be adopted, if they are finished as described.
Cool.
> Patch 0007 seems unrelated, or at least independently significant, and
> should be discussed separately.
It's related - it saves us from doing a lot of extra complexity on
windows. I've brought it up as a separate thread too:
https://postgr.es/m/20211101020311.av6hphdl6xbjbuif%40alap3.anarazel.de
I'm currently a bit stuck implementing this properly for the configure / make
system, as outlined in:
https://www.postgresql.org/message-id/20220111025328.iq5g6uck53j5qtin%40alap3.anarazel.de
> The rest is really all part of the same put-things-in-the-right-directory
> issue.
>
> For the overall patch set, I did a quick test with
>
> meson setup build
> cd build
> ninja
>
> which failed with
>
> Undefined symbols for architecture x86_64:
> "_bbsink_zstd_new", referenced from:
> _SendBaseBackup in replication_basebackup.c.o
>
> So maybe your patch set is not up to date with this new zstd build
> option.
Yep, I posted it before "7cf085f077d - Add support for zstd base backup
compression." went in, but after 6c417bbcc8f. So the meson build knew about
the zstd dependency, but didn't yet specify it for postgres /
pg_basebackup. So all that's needed was / is adding the dependency to those
two places.
Updated patches attached. This just contains the fix for this issue, doesn't
yet address review comments.
FWIW, I'd already pushed those fixes out to the git tree. There's frequent
enough small changes that reposting everytime seems too noisy.
> v6-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz
>
> This all looks kind of reasonable, but lacks explanation in some
> cases, so I can't fully judge it.
I'll try to clean it up.
> v6-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz
>
> This is a separate discussion. It's not clear to me why this is part
> of this patch series.
See above.
> v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz
>
> Part of this was already done in 0001, so check if these patches are
> split correctly.
>
> I think the right way here is actually to go the other way around:
> Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
> assignment from src/makefiles/ to src/templates/, have configure read
> it, and then substitute it into Makefile.global and pg_config.h.
>
> Then we also don't have to patch the Windows build code a bunch of
> times to add the DLSUFFIX define everywhere.
>
> There is code in configure already that would benefit from this, which
> currently says
>
> # We don't know the platform DLSUFFIX here, so check 'em all.
I'll try it out.
> v6-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz
>
> Another directory issue
I think it's a tad different, in that it's fixing something that's currently
broken in VPATH builds.
> v6-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz
>
> Not sure what this is supposed to do, but it looks independent of this
> patch series. Does it currently not work on "unsupported" operating
> systems?
Right now if you run the ldap tests on windows, openbsd, ... the tests
fail. The only reason it doesn't cause trouble on the buildfarm is that we
currently don't run those tests by default...
> v6-0011-ldap-tests-Add-paths-for-openbsd.patch.gz
>
> The more the merrier, although I'm a little bit worried about pointing
> to a /usr/local/share/examples/ directory.
It's where the files are in the package :/.
> v6-0012-wip-split-TESTDIR-into-two.patch.gz
> v6-0013-meson-Add-meson-based-buildsystem.patch.gz
> v6-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz
>
> I suggest in the interim to add a README.meson to show how to invoke
> this. Eventually, of course, we'd rewrite the installation
> instructions.
Good idea.
Greetings,
Andres Freund
Attachments:
[application/x-patch-gzip] v7-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz (2.9K, ../../[email protected]/2-v7-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz)
download
[application/x-patch-gzip] v7-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz (1.8K, ../../[email protected]/3-v7-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz)
download
[application/x-patch-gzip] v7-0003-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz (841B, ../../[email protected]/4-v7-0003-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz)
download
[application/x-patch-gzip] v7-0004-meson-prereq-add-src-tools-gen_versioning_script..patch.gz (941B, ../../[email protected]/5-v7-0004-meson-prereq-add-src-tools-gen_versioning_script..patch.gz)
download
[application/x-patch-gzip] v7-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz (1.1K, ../../[email protected]/6-v7-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz)
download
[application/x-patch-gzip] v7-0006-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz (649B, ../../[email protected]/7-v7-0006-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz)
download
[application/x-patch-gzip] v7-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz (5.4K, ../../[email protected]/8-v7-0007-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz)
download
[application/x-patch-gzip] v7-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz (984B, ../../[email protected]/9-v7-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz)
download
[application/x-patch-gzip] v7-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz (1.6K, ../../[email protected]/10-v7-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz)
download
[application/x-patch-gzip] v7-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz (801B, ../../[email protected]/11-v7-0010-ldap-tests-Don-t-run-on-unsupported-operating-sys.patch.gz)
download
[application/x-patch-gzip] v7-0011-ldap-tests-Add-paths-for-openbsd.patch.gz (550B, ../../[email protected]/12-v7-0011-ldap-tests-Add-paths-for-openbsd.patch.gz)
download
[application/x-patch-gzip] v7-0012-wip-split-TESTDIR-into-two.patch.gz (1.9K, ../../[email protected]/13-v7-0012-wip-split-TESTDIR-into-two.patch.gz)
download
[application/x-patch-gzip] v7-0013-meson-Add-meson-based-buildsystem.patch.gz (61.5K, ../../[email protected]/14-v7-0013-meson-Add-meson-based-buildsystem.patch.gz)
download
[application/x-patch-gzip] v7-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz (4.4K, ../../[email protected]/15-v7-0014-meson-ci-Build-both-with-meson-and-as-before.patch.gz)
download
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v7
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
@ 2022-03-10 16:31 ` Peter Eisentraut <[email protected]>
1 sibling, 0 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-03-10 16:31 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 09.03.22 17:44, Andres Freund wrote:
>> v6-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz
>>
>> Another directory issue
> I think it's a tad different, in that it's fixing something that's currently
> broken in VPATH builds.
Ok, I took another look at this.
-override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
+override CPPFLAGS := -DFRONTEND
-I$(abs_top_builddir)/src/common/unicode $(CPPFLAGS)
This could just be
-I.
- $(PERL) generate-unicode_norm_table.pl
+ $(PERL) $< $(CURDIR)
I didn't detect a need for the additional directory argument. (So the
changes in generate-unicode_norm_table.pl are also apparently not
necessary.) Maybe this is something that will become useful later, in
which case it should be split out from this patch.
The rest of this patch looks ok.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
@ 2022-03-22 02:22 ` Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
1 sibling, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-03-22 02:22 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
Attached is v8. It's just a rebase to resolve conflicts with recent changes.
- Andres
Attachments:
[application/x-patch-gzip] v8-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz (2.6K, ../../[email protected]/2-v8-0001-meson-prereq-output-and-depencency-tracking-work.patch.gz)
download
[application/x-patch-gzip] v8-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz (1.8K, ../../[email protected]/3-v8-0002-meson-prereq-move-snowball_create.sql-creation-in.patch.gz)
download
[application/x-patch-gzip] v8-0003-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz (648B, ../../[email protected]/4-v8-0003-meson-prereq-remove-unhelpful-chattiness-in-snowb.patch.gz)
download
[application/x-patch-gzip] v8-0004-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz (841B, ../../[email protected]/5-v8-0004-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz)
download
[application/x-patch-gzip] v8-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz (1.1K, ../../[email protected]/6-v8-0005-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz)
download
[application/x-patch-gzip] v8-0006-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz (5.6K, ../../[email protected]/7-v8-0006-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz)
download
[application/x-patch-gzip] v8-0007-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz (1.1K, ../../[email protected]/8-v8-0007-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz)
download
[application/x-patch-gzip] v8-0008-meson-prereq-add-src-tools-gen_versioning_script..patch.gz (940B, ../../[email protected]/9-v8-0008-meson-prereq-add-src-tools-gen_versioning_script..patch.gz)
download
[application/x-patch-gzip] v8-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz (1.6K, ../../[email protected]/10-v8-0009-prereq-make-unicode-targets-work-in-vpath-builds.patch.gz)
download
[application/x-patch-gzip] v8-0010-wip-split-TESTDIR-into-two.patch.gz (1.9K, ../../[email protected]/11-v8-0010-wip-split-TESTDIR-into-two.patch.gz)
download
[application/x-patch-gzip] v8-0011-meson-Add-meson-based-buildsystem.patch.gz (61.8K, ../../[email protected]/12-v8-0011-meson-Add-meson-based-buildsystem.patch.gz)
download
[application/x-patch-gzip] v8-0012-meson-ci-Build-both-with-meson-and-as-before.patch.gz (4.4K, ../../[email protected]/13-v8-0012-meson-ci-Build-both-with-meson-and-as-before.patch.gz)
download
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-03-25 09:01 ` Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-03-25 09:01 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 22.03.22 03:22, Andres Freund wrote:
> Attached is v8. It's just a rebase to resolve conflicts with recent changes.
I have committed the DLSUFFIX refactoring, and also a stripped-down
version of the patch that makes update-unicode work with vpath. This
takes care of patches 0007 and 0009.
Patch 0006 (visibility) has its own CF entry.
The only other thing IMO that might be worth addressing in PG15 is the
snowball scripts refactoring (0002 and 0003), but that doesn't seem
quite ready yet. (At least, it would need to be integrated into the
distprep target, since it adds a dependency on perl.) Maybe it's not
worth it right now.
With that, I suggest moving this patch set to CF 2022-07.
A general comment on the remaining prereq patches: We appear to be
accumulating a mix of conventions for how "generate" scripts specify
their output file. Some have it built-in, some use the last argument,
some use an option, which might be -o or --output. Maybe we can gently
work toward more commonality there.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-03-28 19:59 ` Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-03-28 19:59 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-03-25 10:01:09 +0100, Peter Eisentraut wrote:
> On 22.03.22 03:22, Andres Freund wrote:
> > Attached is v8. It's just a rebase to resolve conflicts with recent changes.
>
> I have committed the DLSUFFIX refactoring, and also a stripped-down version
> of the patch that makes update-unicode work with vpath. This takes care of
> patches 0007 and 0009.
Thanks!
> The only other thing IMO that might be worth addressing in PG15 is the
> snowball scripts refactoring (0002 and 0003), but that doesn't seem quite
> ready yet. (At least, it would need to be integrated into the distprep
> target, since it adds a dependency on perl.) Maybe it's not worth it right
> now.
Not sure myself.
> With that, I suggest moving this patch set to CF 2022-07.
Done.
One thing I'd like to discuss fairly soon is what kind of approach to take for
integrating meson support. Most other projects I looked kept parallel
buildsystems for at least a release, so that there's one round of "broad" user
feedback.
In our context it could make sense to merge meson, after a few months of
shakeup remove the current windows buildsystems, and then in release + 1
remove the make based stuff.
But we can have that discussion that before the next CF, but still after
code-freeze & immediate mopup.
> A general comment on the remaining prereq patches: We appear to be
> accumulating a mix of conventions for how "generate" scripts specify their
> output file. Some have it built-in, some use the last argument, some use an
> option, which might be -o or --output. Maybe we can gently work toward more
> commonality there.
Fair point.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-03-28 22:44 ` Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andrew Dunstan @ 2022-03-28 22:44 UTC (permalink / raw)
To: Andres Freund <[email protected]>; Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
On 3/28/22 15:59, Andres Freund wrote:
>
> One thing I'd like to discuss fairly soon is what kind of approach to take for
> integrating meson support. Most other projects I looked kept parallel
> buildsystems for at least a release, so that there's one round of "broad" user
> feedback.
We did something similar when we moved from CVS to git.
>
> In our context it could make sense to merge meson, after a few months of
> shakeup remove the current windows buildsystems, and then in release + 1
> remove the make based stuff.
>
> But we can have that discussion that before the next CF, but still after
> code-freeze & immediate mopup.
>
I'd like to get a stake in the ground and then start working on
buildfarm support. Up to now I think it's been a bit too much of a
moving target. Essentially that would mean an interim option for
building with meson.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
@ 2022-03-28 22:58 ` Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Tom Lane @ 2022-03-28 22:58 UTC (permalink / raw)
To: Andrew Dunstan <[email protected]>; +Cc: Andres Freund <[email protected]>; Peter Eisentraut <[email protected]>; pgsql-hackers
Andrew Dunstan <[email protected]> writes:
> On 3/28/22 15:59, Andres Freund wrote:
>> In our context it could make sense to merge meson, after a few months of
>> shakeup remove the current windows buildsystems, and then in release + 1
>> remove the make based stuff.
That sounds like a decent plan.
> I'd like to get a stake in the ground and then start working on
> buildfarm support. Up to now I think it's been a bit too much of a
> moving target. Essentially that would mean an interim option for
> building with meson.
If we can commit meson build infrastructure without removing the
existing infrastructure, then the buildfarm can continue to work,
and we can roll out support for the new way slowly. It'd be
fairly impractical to expect all buildfarm animals to update
instantly anyhow.
regards, tom lane
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
@ 2022-03-28 23:11 ` Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-03-28 23:11 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Andrew Dunstan <[email protected]>; Peter Eisentraut <[email protected]>; pgsql-hackers
Hi,
On 2022-03-28 18:58:19 -0400, Tom Lane wrote:
> If we can commit meson build infrastructure without removing the
> existing infrastructure, then the buildfarm can continue to work,
> and we can roll out support for the new way slowly.
I think it's not a huge issue to have both for a while. Of course it's
annoying to have to update two files when adding a source file, but it's not
the end of the world for a limited time. IMO.
> It'd be fairly impractical to expect all buildfarm animals to update
> instantly anyhow.
And development workflows. I expect some unforseen breakages somewhere, given
the variety of systems out there.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-04-13 10:26 ` Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 21:04 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 2 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-04-13 10:26 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
Some feedback and patches for your branch at
3274198960c139328fef3c725cee1468bbfff469:
0001-Install-a-few-more-files.patch
These are just some files that were apparently forgotten to be installed
so far.
0002-Adjust-some-header-file-installation-paths.patch
The installation of server headers is apparently still in progress.
This just adjusts the installation directory of those that are already
being dealt with, so they match the existing installation layout.
0003-Fix-warnings-about-deprecated-features.patch
This fixes some deprecation warnings and raises the requirement to 0.56.
I'm not sure why the current cutoff at 0.54 was chosen. Perhaps that
could be documented. If we choose to stay with 0.54, is there a way to
turn off deprecation warnings, so not everyone needs to see them?
0004-Install-postmaster-symlink.patch
This needs 0.61, so maybe it's a bit too new. Or we could get rid of
the postmaster symlink altogether?
0005-Workaround-for-Perl-detection.patch
This is needed on my system to get the Perl detection to pass. If I
look at the equivalent configure code, some more refinement appears to
be needed in this area.
From 15108c90960235a9c61b8d001eb68c563f9f8aa1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:06:28 +0200
Subject: [PATCH 1/5] Install a few more files
---
contrib/hstore/meson.build | 1 +
src/backend/utils/meson.build | 2 ++
src/bin/psql/meson.build | 2 ++
src/include/meson.build | 2 ++
4 files changed, 7 insertions(+)
diff --git a/contrib/hstore/meson.build b/contrib/hstore/meson.build
index 661e61f969..e1e634b948 100644
--- a/contrib/hstore/meson.build
+++ b/contrib/hstore/meson.build
@@ -17,6 +17,7 @@ hstore = shared_module('hstore',
install_data(
'hstore.control',
'hstore--1.1--1.2.sql',
+ 'hstore--1.2--1.3.sql',
'hstore--1.3--1.4.sql',
'hstore--1.4.sql',
'hstore--1.4--1.5.sql',
diff --git a/src/backend/utils/meson.build b/src/backend/utils/meson.build
index afb1c0346b..a936005886 100644
--- a/src/backend/utils/meson.build
+++ b/src/backend/utils/meson.build
@@ -1,3 +1,5 @@
+install_data('errcodes.txt', install_dir: 'share/')
+
subdir('activity')
subdir('adt')
subdir('cache')
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
index 75905a52c1..f9e3b1a32b 100644
--- a/src/bin/psql/meson.build
+++ b/src/bin/psql/meson.build
@@ -52,6 +52,8 @@ executable('psql',
kwargs: default_bin_args,
)
+install_data('psqlrc.sample', install_dir: 'share/')
+
tap_tests += {
'name': 'psql',
'sd': meson.current_source_dir(),
diff --git a/src/include/meson.build b/src/include/meson.build
index c3af4a2574..86d91f55d6 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -43,6 +43,8 @@ configure_file(
install: false
)
+install_headers('postgres_ext.h')
+
subdir('utils')
subdir('storage')
--
2.35.1
From a5eaca807fb46fb20148cec28392d9fc13174d4d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:07:02 +0200
Subject: [PATCH 2/5] Adjust some header file installation paths
---
src/include/catalog/meson.build | 4 ++--
src/include/parser/meson.build | 2 +-
src/include/storage/meson.build | 2 +-
src/interfaces/libpq/meson.build | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
index f5bc294c81..5ccb84ee34 100644
--- a/src/include/catalog/meson.build
+++ b/src/include/catalog/meson.build
@@ -94,13 +94,13 @@ bki_data = files(
input = []
output_files = ['postgres.bki', 'schemapg.h', 'system_fk_info.h', 'system_constraints.sql']
-output_install = [get_option('datadir'), get_option('includedir'), get_option('includedir'), get_option('datadir')]
+output_install = [get_option('datadir'), get_option('includedir') / 'server/catalog', get_option('includedir') / 'server/catalog', get_option('datadir')]
foreach h : catalog_headers
fname = h.split('.h')[0]+'_d.h'
input += files(h)
output_files += fname
- output_install += get_option('includedir')
+ output_install += get_option('includedir') / 'server/catalog'
endforeach
generated_headers += custom_target('generated_catalog_headers',
diff --git a/src/include/parser/meson.build b/src/include/parser/meson.build
index caf4c09290..a8df3db7fe 100644
--- a/src/include/parser/meson.build
+++ b/src/include/parser/meson.build
@@ -4,7 +4,7 @@ backend_parser_header = custom_target('gram',
command: [bison, bisonflags, '-d', '-o', '@OUTPUT0@', '@INPUT0@'],
install: true,
# Only install gram.h, not gram.c
- install_dir: [false, get_option('includedir')]
+ install_dir: [false, get_option('includedir') / 'server/parser']
)
#generated_backend_headers += backend_parser[1]
diff --git a/src/include/storage/meson.build b/src/include/storage/meson.build
index ef2bbb7c6f..63b110cbef 100644
--- a/src/include/storage/meson.build
+++ b/src/include/storage/meson.build
@@ -8,7 +8,7 @@ lwlocknames = custom_target('lwlocknames',
command : [perl, files('../../backend/storage/lmgr/generate-lwlocknames.pl'), '-o', '@OUTDIR@', '@INPUT@'],
build_by_default: true,
install: true,
- install_dir: [get_option('includedir'), false],
+ install_dir: [get_option('includedir') / 'server/storage', false],
)
lwlocknames_h = lwlocknames[0]
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 0e422c1ae6..ce948e7568 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -103,8 +103,7 @@ libpq = declare_dependency(
)
install_headers('libpq-fe.h', 'libpq-events.h')
-# FIXME: adjust path
-install_headers('libpq-int.h', 'pqexpbuffer.h')
+install_headers('libpq-int.h', 'pqexpbuffer.h', install_dir: get_option('includedir') / 'internal')
install_data('pg_service.conf.sample', install_dir: get_option('datadir'))
--
2.35.1
From 4a5a7439265bd671a14284025b2fac3c6932930b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:18:46 +0200
Subject: [PATCH 3/5] Fix warnings about deprecated features
---
contrib/dblink/meson.build | 2 +-
contrib/postgres_fdw/meson.build | 2 +-
meson.build | 26 +++++++++++++-------------
src/bin/pg_basebackup/meson.build | 8 ++++----
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/contrib/dblink/meson.build b/contrib/dblink/meson.build
index af277b9600..02e6a85a15 100644
--- a/contrib/dblink/meson.build
+++ b/contrib/dblink/meson.build
@@ -24,5 +24,5 @@ regress_tests += {
'sql': [
'dblink',
],
- 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+ 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}
diff --git a/contrib/postgres_fdw/meson.build b/contrib/postgres_fdw/meson.build
index 507d01448b..9e8a95ddc5 100644
--- a/contrib/postgres_fdw/meson.build
+++ b/contrib/postgres_fdw/meson.build
@@ -27,5 +27,5 @@ regress_tests += {
'sql': [
'postgres_fdw'
],
- 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+ 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}
diff --git a/meson.build b/meson.build
index adb6a5666c..9df1c85d51 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('postgresql',
['c'],
version: '15devel',
license: 'PostgreSQL',
- meson_version: '>=0.54',
+ meson_version: '>=0.56',
default_options: [
'warning_level=2',
'b_pie=true',
@@ -358,7 +358,7 @@ if not llvmopt.disabled()
if ccache.found()
llvm_irgen_command = ccache
- llvm_irgen_args = [clang.path()] + llvm_irgen_args
+ llvm_irgen_args = [clang.full_path()] + llvm_irgen_args
else
llvm_irgen_command = clang
endif
@@ -1935,7 +1935,7 @@ endif
###
rc_cdata = configuration_data()
-rc_cdata.set_quoted('ICO', meson.source_root() / 'src' / 'port' / 'win32.ico')
+rc_cdata.set_quoted('ICO', meson.project_source_root() / 'src' / 'port' / 'win32.ico')
rc_lib_cdata = rc_cdata
rc_lib_cdata.set('VFT_TYPE', 'VFT_DLL')
@@ -2074,7 +2074,7 @@ if fs.is_absolute(get_option('prefix'))
endif
# DESTDIR for the installation used to run tests in
-test_install_destdir = meson.build_root() / 'tmp_install/'
+test_install_destdir = meson.project_build_root() / 'tmp_install/'
# DESTDIR + prefix appropriately munged
test_install_location = test_install_destdir / test_prefix
@@ -2086,7 +2086,7 @@ test('tmp_install',
is_parallel: false,
suite: ['setup'])
-test_result_dir = meson.build_root() / 'testrun'
+test_result_dir = meson.project_build_root() / 'testrun'
# XXX: pg_regress doesn't assign unique ports on windows. To avoid the
@@ -2150,9 +2150,9 @@ foreach t : regress_tests
'depends': test_deps + t.get('deps', []),
'env': env,
'args': [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
'pg_regress',
@@ -2207,9 +2207,9 @@ foreach t : isolation_tests
'depends': test_deps + t.get('deps', []),
'env': env,
'args': [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
'isolation',
@@ -2244,8 +2244,8 @@ if get_option('enable-tap-tests')
foreach t : tap_tests
test_command = [
- perl.path(),
- '-I', meson.source_root() / 'src/test/perl',
+ perl.full_path(),
+ '-I', meson.project_source_root() / 'src/test/perl',
'-I', t['sd'],
]
@@ -2272,9 +2272,9 @@ if get_option('enable-tap-tests')
sh,
kwargs: test_kwargs,
args: [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
onetap,
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index 9bd45585a9..b5617b818f 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -42,10 +42,10 @@ tap_tests += {
'name' : 'pg_basebackup',
'sd': meson.current_source_dir(),
'bd': meson.current_build_dir(),
- 'env': {'GZIP_PROGRAM': gzip.path(),
- 'TAR': tar.path(),
- 'LZ4': program_lz4.found() ? program_lz4.path() : '',
- 'ZSTD': program_zstd.found() ? program_zstd.path() : ''},
+ 'env': {'GZIP_PROGRAM': gzip.full_path(),
+ 'TAR': tar.full_path(),
+ 'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
+ 'ZSTD': program_zstd.found() ? program_zstd.full_path() : ''},
'tests': [
't/010_pg_basebackup.pl',
't/020_pg_receivewal.pl',
--
2.35.1
From 5369fde7cce715a1b7a9072b724ebff60796a2de Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:19:47 +0200
Subject: [PATCH 4/5] Install postmaster symlink
---
meson.build | 2 +-
src/backend/meson.build | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 9df1c85d51..1bf53ea24d 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('postgresql',
['c'],
version: '15devel',
license: 'PostgreSQL',
- meson_version: '>=0.56',
+ meson_version: '>=0.61',
default_options: [
'warning_level=2',
'b_pie=true',
diff --git a/src/backend/meson.build b/src/backend/meson.build
index 0098411c6b..6814d5094c 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -118,6 +118,8 @@ else
kwargs: default_bin_args,
)
+ install_symlink('postmaster', pointing_to: 'postgres', install_dir: get_option('bindir'))
+
endif
backend_targets += postgres
--
2.35.1
From 1f80e1ebb8efeb0eba7d57032282520fd6455b0d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:50:52 +0200
Subject: [PATCH 5/5] Workaround for Perl detection
---
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 1bf53ea24d..e33ed11b08 100644
--- a/meson.build
+++ b/meson.build
@@ -545,9 +545,9 @@ else
# file existence.
if perl_may_work
perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
- if host_machine.system() == 'darwin'
- perl_ccflags += ['-iwithsysroot', perl_inc_dir]
- endif
+ #if host_machine.system() == 'darwin'
+ # perl_ccflags += ['-iwithsysroot', perl_inc_dir]
+ #endif
endif
# check required headers are present
--
2.35.1
Attachments:
[text/plain] 0001-Install-a-few-more-files.patch (1.7K, ../../[email protected]/2-0001-Install-a-few-more-files.patch)
download | inline diff:
From 15108c90960235a9c61b8d001eb68c563f9f8aa1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:06:28 +0200
Subject: [PATCH 1/5] Install a few more files
---
contrib/hstore/meson.build | 1 +
src/backend/utils/meson.build | 2 ++
src/bin/psql/meson.build | 2 ++
src/include/meson.build | 2 ++
4 files changed, 7 insertions(+)
diff --git a/contrib/hstore/meson.build b/contrib/hstore/meson.build
index 661e61f969..e1e634b948 100644
--- a/contrib/hstore/meson.build
+++ b/contrib/hstore/meson.build
@@ -17,6 +17,7 @@ hstore = shared_module('hstore',
install_data(
'hstore.control',
'hstore--1.1--1.2.sql',
+ 'hstore--1.2--1.3.sql',
'hstore--1.3--1.4.sql',
'hstore--1.4.sql',
'hstore--1.4--1.5.sql',
diff --git a/src/backend/utils/meson.build b/src/backend/utils/meson.build
index afb1c0346b..a936005886 100644
--- a/src/backend/utils/meson.build
+++ b/src/backend/utils/meson.build
@@ -1,3 +1,5 @@
+install_data('errcodes.txt', install_dir: 'share/')
+
subdir('activity')
subdir('adt')
subdir('cache')
diff --git a/src/bin/psql/meson.build b/src/bin/psql/meson.build
index 75905a52c1..f9e3b1a32b 100644
--- a/src/bin/psql/meson.build
+++ b/src/bin/psql/meson.build
@@ -52,6 +52,8 @@ executable('psql',
kwargs: default_bin_args,
)
+install_data('psqlrc.sample', install_dir: 'share/')
+
tap_tests += {
'name': 'psql',
'sd': meson.current_source_dir(),
diff --git a/src/include/meson.build b/src/include/meson.build
index c3af4a2574..86d91f55d6 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -43,6 +43,8 @@ configure_file(
install: false
)
+install_headers('postgres_ext.h')
+
subdir('utils')
subdir('storage')
--
2.35.1
[text/plain] 0002-Adjust-some-header-file-installation-paths.patch (3.0K, ../../[email protected]/3-0002-Adjust-some-header-file-installation-paths.patch)
download | inline diff:
From a5eaca807fb46fb20148cec28392d9fc13174d4d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:07:02 +0200
Subject: [PATCH 2/5] Adjust some header file installation paths
---
src/include/catalog/meson.build | 4 ++--
src/include/parser/meson.build | 2 +-
src/include/storage/meson.build | 2 +-
src/interfaces/libpq/meson.build | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
index f5bc294c81..5ccb84ee34 100644
--- a/src/include/catalog/meson.build
+++ b/src/include/catalog/meson.build
@@ -94,13 +94,13 @@ bki_data = files(
input = []
output_files = ['postgres.bki', 'schemapg.h', 'system_fk_info.h', 'system_constraints.sql']
-output_install = [get_option('datadir'), get_option('includedir'), get_option('includedir'), get_option('datadir')]
+output_install = [get_option('datadir'), get_option('includedir') / 'server/catalog', get_option('includedir') / 'server/catalog', get_option('datadir')]
foreach h : catalog_headers
fname = h.split('.h')[0]+'_d.h'
input += files(h)
output_files += fname
- output_install += get_option('includedir')
+ output_install += get_option('includedir') / 'server/catalog'
endforeach
generated_headers += custom_target('generated_catalog_headers',
diff --git a/src/include/parser/meson.build b/src/include/parser/meson.build
index caf4c09290..a8df3db7fe 100644
--- a/src/include/parser/meson.build
+++ b/src/include/parser/meson.build
@@ -4,7 +4,7 @@ backend_parser_header = custom_target('gram',
command: [bison, bisonflags, '-d', '-o', '@OUTPUT0@', '@INPUT0@'],
install: true,
# Only install gram.h, not gram.c
- install_dir: [false, get_option('includedir')]
+ install_dir: [false, get_option('includedir') / 'server/parser']
)
#generated_backend_headers += backend_parser[1]
diff --git a/src/include/storage/meson.build b/src/include/storage/meson.build
index ef2bbb7c6f..63b110cbef 100644
--- a/src/include/storage/meson.build
+++ b/src/include/storage/meson.build
@@ -8,7 +8,7 @@ lwlocknames = custom_target('lwlocknames',
command : [perl, files('../../backend/storage/lmgr/generate-lwlocknames.pl'), '-o', '@OUTDIR@', '@INPUT@'],
build_by_default: true,
install: true,
- install_dir: [get_option('includedir'), false],
+ install_dir: [get_option('includedir') / 'server/storage', false],
)
lwlocknames_h = lwlocknames[0]
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 0e422c1ae6..ce948e7568 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -103,8 +103,7 @@ libpq = declare_dependency(
)
install_headers('libpq-fe.h', 'libpq-events.h')
-# FIXME: adjust path
-install_headers('libpq-int.h', 'pqexpbuffer.h')
+install_headers('libpq-int.h', 'pqexpbuffer.h', install_dir: get_option('includedir') / 'internal')
install_data('pg_service.conf.sample', install_dir: get_option('datadir'))
--
2.35.1
[text/plain] 0003-Fix-warnings-about-deprecated-features.patch (4.8K, ../../[email protected]/4-0003-Fix-warnings-about-deprecated-features.patch)
download | inline diff:
From 4a5a7439265bd671a14284025b2fac3c6932930b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:18:46 +0200
Subject: [PATCH 3/5] Fix warnings about deprecated features
---
contrib/dblink/meson.build | 2 +-
contrib/postgres_fdw/meson.build | 2 +-
meson.build | 26 +++++++++++++-------------
src/bin/pg_basebackup/meson.build | 8 ++++----
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/contrib/dblink/meson.build b/contrib/dblink/meson.build
index af277b9600..02e6a85a15 100644
--- a/contrib/dblink/meson.build
+++ b/contrib/dblink/meson.build
@@ -24,5 +24,5 @@ regress_tests += {
'sql': [
'dblink',
],
- 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+ 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}
diff --git a/contrib/postgres_fdw/meson.build b/contrib/postgres_fdw/meson.build
index 507d01448b..9e8a95ddc5 100644
--- a/contrib/postgres_fdw/meson.build
+++ b/contrib/postgres_fdw/meson.build
@@ -27,5 +27,5 @@ regress_tests += {
'sql': [
'postgres_fdw'
],
- 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
+ 'regress_args': ['--dlpath', meson.project_build_root() / 'src/test/regress'],
}
diff --git a/meson.build b/meson.build
index adb6a5666c..9df1c85d51 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('postgresql',
['c'],
version: '15devel',
license: 'PostgreSQL',
- meson_version: '>=0.54',
+ meson_version: '>=0.56',
default_options: [
'warning_level=2',
'b_pie=true',
@@ -358,7 +358,7 @@ if not llvmopt.disabled()
if ccache.found()
llvm_irgen_command = ccache
- llvm_irgen_args = [clang.path()] + llvm_irgen_args
+ llvm_irgen_args = [clang.full_path()] + llvm_irgen_args
else
llvm_irgen_command = clang
endif
@@ -1935,7 +1935,7 @@ endif
###
rc_cdata = configuration_data()
-rc_cdata.set_quoted('ICO', meson.source_root() / 'src' / 'port' / 'win32.ico')
+rc_cdata.set_quoted('ICO', meson.project_source_root() / 'src' / 'port' / 'win32.ico')
rc_lib_cdata = rc_cdata
rc_lib_cdata.set('VFT_TYPE', 'VFT_DLL')
@@ -2074,7 +2074,7 @@ if fs.is_absolute(get_option('prefix'))
endif
# DESTDIR for the installation used to run tests in
-test_install_destdir = meson.build_root() / 'tmp_install/'
+test_install_destdir = meson.project_build_root() / 'tmp_install/'
# DESTDIR + prefix appropriately munged
test_install_location = test_install_destdir / test_prefix
@@ -2086,7 +2086,7 @@ test('tmp_install',
is_parallel: false,
suite: ['setup'])
-test_result_dir = meson.build_root() / 'testrun'
+test_result_dir = meson.project_build_root() / 'testrun'
# XXX: pg_regress doesn't assign unique ports on windows. To avoid the
@@ -2150,9 +2150,9 @@ foreach t : regress_tests
'depends': test_deps + t.get('deps', []),
'env': env,
'args': [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
'pg_regress',
@@ -2207,9 +2207,9 @@ foreach t : isolation_tests
'depends': test_deps + t.get('deps', []),
'env': env,
'args': [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
'isolation',
@@ -2244,8 +2244,8 @@ if get_option('enable-tap-tests')
foreach t : tap_tests
test_command = [
- perl.path(),
- '-I', meson.source_root() / 'src/test/perl',
+ perl.full_path(),
+ '-I', meson.project_source_root() / 'src/test/perl',
'-I', t['sd'],
]
@@ -2272,9 +2272,9 @@ if get_option('enable-tap-tests')
sh,
kwargs: test_kwargs,
args: [
- testwrap.path(),
+ testwrap.full_path(),
t['sd'],
- meson.build_root(),
+ meson.project_build_root(),
t['bd'],
t['name'],
onetap,
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index 9bd45585a9..b5617b818f 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -42,10 +42,10 @@ tap_tests += {
'name' : 'pg_basebackup',
'sd': meson.current_source_dir(),
'bd': meson.current_build_dir(),
- 'env': {'GZIP_PROGRAM': gzip.path(),
- 'TAR': tar.path(),
- 'LZ4': program_lz4.found() ? program_lz4.path() : '',
- 'ZSTD': program_zstd.found() ? program_zstd.path() : ''},
+ 'env': {'GZIP_PROGRAM': gzip.full_path(),
+ 'TAR': tar.full_path(),
+ 'LZ4': program_lz4.found() ? program_lz4.full_path() : '',
+ 'ZSTD': program_zstd.found() ? program_zstd.full_path() : ''},
'tests': [
't/010_pg_basebackup.pl',
't/020_pg_receivewal.pl',
--
2.35.1
[text/plain] 0004-Install-postmaster-symlink.patch (1018B, ../../[email protected]/5-0004-Install-postmaster-symlink.patch)
download | inline diff:
From 5369fde7cce715a1b7a9072b724ebff60796a2de Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:19:47 +0200
Subject: [PATCH 4/5] Install postmaster symlink
---
meson.build | 2 +-
src/backend/meson.build | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 9df1c85d51..1bf53ea24d 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('postgresql',
['c'],
version: '15devel',
license: 'PostgreSQL',
- meson_version: '>=0.56',
+ meson_version: '>=0.61',
default_options: [
'warning_level=2',
'b_pie=true',
diff --git a/src/backend/meson.build b/src/backend/meson.build
index 0098411c6b..6814d5094c 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -118,6 +118,8 @@ else
kwargs: default_bin_args,
)
+ install_symlink('postmaster', pointing_to: 'postgres', install_dir: get_option('bindir'))
+
endif
backend_targets += postgres
--
2.35.1
[text/plain] 0005-Workaround-for-Perl-detection.patch (796B, ../../[email protected]/6-0005-Workaround-for-Perl-detection.patch)
download | inline diff:
From 1f80e1ebb8efeb0eba7d57032282520fd6455b0d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 13 Apr 2022 11:50:52 +0200
Subject: [PATCH 5/5] Workaround for Perl detection
---
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 1bf53ea24d..e33ed11b08 100644
--- a/meson.build
+++ b/meson.build
@@ -545,9 +545,9 @@ else
# file existence.
if perl_may_work
perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
- if host_machine.system() == 'darwin'
- perl_ccflags += ['-iwithsysroot', perl_inc_dir]
- endif
+ #if host_machine.system() == 'darwin'
+ # perl_ccflags += ['-iwithsysroot', perl_inc_dir]
+ #endif
endif
# check required headers are present
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-04-20 13:09 ` Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
1 sibling, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-04-20 13:09 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 13.04.22 12:26, Peter Eisentraut wrote:
> Some feedback and patches for your branch at
> 3274198960c139328fef3c725cee1468bbfff469:
Here is another patch. It adds support for building ecpg.
From 35a23442727cdf82558c7e5eab85bc29df86b5d5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 20 Apr 2022 10:54:29 +0200
Subject: [PATCH 6/6] meson: Add ecpg
---
meson.build | 5 ++
src/interfaces/ecpg/compatlib/meson.build | 8 ++++
src/interfaces/ecpg/ecpglib/meson.build | 17 +++++++
src/interfaces/ecpg/include/meson.build | 46 ++++++++++++++++++
src/interfaces/ecpg/meson.build | 5 ++
src/interfaces/ecpg/pgtypeslib/meson.build | 12 +++++
src/interfaces/ecpg/preproc/Makefile | 2 +-
src/interfaces/ecpg/preproc/meson.build | 55 ++++++++++++++++++++++
src/interfaces/ecpg/preproc/parse.pl | 6 ++-
src/interfaces/meson.build | 1 +
src/meson.build | 2 +
11 files changed, 157 insertions(+), 2 deletions(-)
create mode 100644 src/interfaces/ecpg/compatlib/meson.build
create mode 100644 src/interfaces/ecpg/ecpglib/meson.build
create mode 100644 src/interfaces/ecpg/include/meson.build
create mode 100644 src/interfaces/ecpg/meson.build
create mode 100644 src/interfaces/ecpg/pgtypeslib/meson.build
create mode 100644 src/interfaces/ecpg/preproc/meson.build
create mode 100644 src/interfaces/meson.build
diff --git a/meson.build b/meson.build
index e33ed11b08..bd6f1759e8 100644
--- a/meson.build
+++ b/meson.build
@@ -1637,6 +1637,11 @@ else
cdata.set('STRERROR_R_INT', false)
endif
+# XXX replace with real test
+if host_machine.system() == 'darwin'
+ cdata.set('LOCALE_T_IN_XLOCALE', true)
+endif
+
# MSVC doesn't cope well with defining restrict to __restrict, the
# spelling it understands, because it conflicts with
# __declspec(restrict). Therefore we define pg_restrict to the
diff --git a/src/interfaces/ecpg/compatlib/meson.build b/src/interfaces/ecpg/compatlib/meson.build
new file mode 100644
index 0000000000..68ae270038
--- /dev/null
+++ b/src/interfaces/ecpg/compatlib/meson.build
@@ -0,0 +1,8 @@
+library('ecpg_compat',
+ 'informix.c',
+ include_directories : ['.', '../include', postgres_inc, '../../libpq'],
+ dependencies: [frontend_shlib_code, thread_dep],
+ link_with: [ecpglib, ecpg_pgtypes],
+ soversion: 3,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/ecpglib/meson.build b/src/interfaces/ecpg/ecpglib/meson.build
new file mode 100644
index 0000000000..c32fc13871
--- /dev/null
+++ b/src/interfaces/ecpg/ecpglib/meson.build
@@ -0,0 +1,17 @@
+ecpglib = library('ecpg',
+ 'connect.c',
+ 'data.c',
+ 'descriptor.c',
+ 'error.c',
+ 'execute.c',
+ 'memory.c',
+ 'misc.c',
+ 'prepare.c',
+ 'sqlda.c',
+ 'typename.c',
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code, libpq, thread_dep],
+ link_with: [ecpg_pgtypes],
+ soversion: 6,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/include/meson.build b/src/interfaces/ecpg/include/meson.build
new file mode 100644
index 0000000000..840a23998d
--- /dev/null
+++ b/src/interfaces/ecpg/include/meson.build
@@ -0,0 +1,46 @@
+ecpg_conf_keys = [
+ 'ENABLE_THREAD_SAFETY',
+ 'HAVE_INT64',
+ 'HAVE_LONG_INT_64',
+ 'HAVE_LONG_LONG_INT_64',
+ 'PG_USE_STDBOOL',
+]
+
+ecpg_conf_data = configuration_data()
+
+foreach key : ecpg_conf_keys
+ if cdata.has(key)
+ ecpg_conf_data.set(key, cdata.get(key))
+ endif
+endforeach
+
+configure_file(
+ output: 'ecpg_config.h',
+ configuration: ecpg_conf_data,
+ install_dir: get_option('includedir'),
+)
+
+install_headers(
+ 'ecpg_informix.h',
+ 'ecpgerrno.h',
+ 'ecpglib.h',
+ 'ecpgtype.h',
+ 'pgtypes.h',
+ 'pgtypes_date.h',
+ 'pgtypes_error.h',
+ 'pgtypes_interval.h',
+ 'pgtypes_numeric.h',
+ 'pgtypes_timestamp.h',
+ 'sql3types.h',
+ 'sqlca.h',
+ 'sqlda.h',
+ 'sqlda-compat.h',
+ 'sqlda-native.h',
+)
+
+install_headers(
+ 'datetime.h',
+ 'decimal.h',
+ 'sqltypes.h',
+ subdir: 'informix/esql',
+)
diff --git a/src/interfaces/ecpg/meson.build b/src/interfaces/ecpg/meson.build
new file mode 100644
index 0000000000..ffbe84c0e8
--- /dev/null
+++ b/src/interfaces/ecpg/meson.build
@@ -0,0 +1,5 @@
+subdir('include')
+subdir('pgtypeslib')
+subdir('ecpglib')
+subdir('compatlib')
+subdir('preproc')
diff --git a/src/interfaces/ecpg/pgtypeslib/meson.build b/src/interfaces/ecpg/pgtypeslib/meson.build
new file mode 100644
index 0000000000..9b1d54c019
--- /dev/null
+++ b/src/interfaces/ecpg/pgtypeslib/meson.build
@@ -0,0 +1,12 @@
+ecpg_pgtypes = library('pgtypes',
+ 'common.c',
+ 'datetime.c',
+ 'dt_common.c',
+ 'interval.c',
+ 'numeric.c',
+ 'timestamp.c',
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code],
+ soversion: 3,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index ef6d645dee..747d824de3 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -65,7 +65,7 @@ preproc.h: preproc.c
preproc.c: BISONFLAGS += -d
preproc.y: ../../../backend/parser/gram.y parse.pl ecpg.addons ecpg.header ecpg.tokens ecpg.trailer ecpg.type
- $(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
+ $(PERL) $(srcdir)/parse.pl $(srcdir) $< > $@
$(PERL) $(srcdir)/check_rules.pl $(srcdir) $<
# generate keyword headers
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
new file mode 100644
index 0000000000..4ae56f21d4
--- /dev/null
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -0,0 +1,55 @@
+pgc_c = custom_target('pgc.c',
+ input: ['pgc.l'],
+ output: ['pgc.c'],
+ command: [flex, '-o', '@OUTPUT@', '@INPUT@'])
+
+preproc_y = custom_target('preproc.y',
+ input: ['../../../backend/parser/gram.y',
+ 'parse.pl',
+ 'ecpg.addons',
+ 'ecpg.header',
+ 'ecpg.tokens',
+ 'ecpg.trailer',
+ 'ecpg.type'],
+ output: ['preproc.y'],
+ command: [perl, '@INPUT1@', '@CURRENT_SOURCE_DIR@', '@INPUT0@'],
+ capture: true)
+
+preproc_c = custom_target('preproc.c',
+ input: [preproc_y],
+ output: ['preproc.c', 'preproc.h'],
+ command: [bison, bisonflags, '-d', '-o', '@OUTPUT0@', '@INPUT@'])
+
+c_kwlist_d_h = custom_target('c_kwlist_d.h',
+ input: ['c_kwlist.h'],
+ output: ['c_kwlist_d.h'],
+ command: [perl, '-I', '@SOURCE_ROOT@/src/tools', '@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
+ '--output', '@OUTDIR@',
+ '--varname', 'ScanCKeywords', '--no-case-fold', '@INPUT0@'])
+
+ecpg_kwlist_d_h = custom_target('ecpg_kwlist_d.h',
+ input: ['ecpg_kwlist.h'],
+ output: ['ecpg_kwlist_d.h'],
+ command: [perl, '-I', '@SOURCE_ROOT@/src/tools', '@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
+ '--output', '@OUTDIR@',
+ '--varname', 'ScanECPGKeywords', '@INPUT0@'])
+
+executable('ecpg',
+ 'c_keywords.c',
+ 'descriptor.c',
+ 'ecpg.c',
+ 'ecpg_keywords.c',
+ 'keywords.c',
+ 'output.c',
+ 'parser.c',
+ pgc_c,
+ preproc_c,
+ 'type.c',
+ '../ecpglib/typename.c',
+ 'variable.c',
+ c_kwlist_d_h,
+ ecpg_kwlist_d_h,
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code, libpq],
+ kwargs: default_bin_args,
+ )
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index dee6b8200d..0dd9f30b41 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -19,6 +19,8 @@
my $path = shift @ARGV;
$path = "." unless $path;
+open(our $infile, '<', $ARGV[0]) or die;
+
my $copymode = 0;
my $brace_indent = 0;
my $yaccmode = 0;
@@ -132,9 +134,11 @@
include_file('trailer', 'ecpg.trailer');
dump_buffer('trailer');
+close($infile);
+
sub main
{
- line: while (<>)
+ line: while (<$infile>)
{
if (/ERRCODE_FEATURE_NOT_SUPPORTED/)
{
diff --git a/src/interfaces/meson.build b/src/interfaces/meson.build
new file mode 100644
index 0000000000..fb85e3fd20
--- /dev/null
+++ b/src/interfaces/meson.build
@@ -0,0 +1 @@
+subdir('ecpg')
diff --git a/src/meson.build b/src/meson.build
index 414be1db41..a7fdd5a13e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -8,3 +8,5 @@ subdir('backend')
subdir('bin')
subdir('pl')
+
+subdir('interfaces')
--
2.35.1
Attachments:
[text/plain] 0006-meson-Add-ecpg.patch (9.3K, ../../[email protected]/2-0006-meson-Add-ecpg.patch)
download | inline diff:
From 35a23442727cdf82558c7e5eab85bc29df86b5d5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 20 Apr 2022 10:54:29 +0200
Subject: [PATCH 6/6] meson: Add ecpg
---
meson.build | 5 ++
src/interfaces/ecpg/compatlib/meson.build | 8 ++++
src/interfaces/ecpg/ecpglib/meson.build | 17 +++++++
src/interfaces/ecpg/include/meson.build | 46 ++++++++++++++++++
src/interfaces/ecpg/meson.build | 5 ++
src/interfaces/ecpg/pgtypeslib/meson.build | 12 +++++
src/interfaces/ecpg/preproc/Makefile | 2 +-
src/interfaces/ecpg/preproc/meson.build | 55 ++++++++++++++++++++++
src/interfaces/ecpg/preproc/parse.pl | 6 ++-
src/interfaces/meson.build | 1 +
src/meson.build | 2 +
11 files changed, 157 insertions(+), 2 deletions(-)
create mode 100644 src/interfaces/ecpg/compatlib/meson.build
create mode 100644 src/interfaces/ecpg/ecpglib/meson.build
create mode 100644 src/interfaces/ecpg/include/meson.build
create mode 100644 src/interfaces/ecpg/meson.build
create mode 100644 src/interfaces/ecpg/pgtypeslib/meson.build
create mode 100644 src/interfaces/ecpg/preproc/meson.build
create mode 100644 src/interfaces/meson.build
diff --git a/meson.build b/meson.build
index e33ed11b08..bd6f1759e8 100644
--- a/meson.build
+++ b/meson.build
@@ -1637,6 +1637,11 @@ else
cdata.set('STRERROR_R_INT', false)
endif
+# XXX replace with real test
+if host_machine.system() == 'darwin'
+ cdata.set('LOCALE_T_IN_XLOCALE', true)
+endif
+
# MSVC doesn't cope well with defining restrict to __restrict, the
# spelling it understands, because it conflicts with
# __declspec(restrict). Therefore we define pg_restrict to the
diff --git a/src/interfaces/ecpg/compatlib/meson.build b/src/interfaces/ecpg/compatlib/meson.build
new file mode 100644
index 0000000000..68ae270038
--- /dev/null
+++ b/src/interfaces/ecpg/compatlib/meson.build
@@ -0,0 +1,8 @@
+library('ecpg_compat',
+ 'informix.c',
+ include_directories : ['.', '../include', postgres_inc, '../../libpq'],
+ dependencies: [frontend_shlib_code, thread_dep],
+ link_with: [ecpglib, ecpg_pgtypes],
+ soversion: 3,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/ecpglib/meson.build b/src/interfaces/ecpg/ecpglib/meson.build
new file mode 100644
index 0000000000..c32fc13871
--- /dev/null
+++ b/src/interfaces/ecpg/ecpglib/meson.build
@@ -0,0 +1,17 @@
+ecpglib = library('ecpg',
+ 'connect.c',
+ 'data.c',
+ 'descriptor.c',
+ 'error.c',
+ 'execute.c',
+ 'memory.c',
+ 'misc.c',
+ 'prepare.c',
+ 'sqlda.c',
+ 'typename.c',
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code, libpq, thread_dep],
+ link_with: [ecpg_pgtypes],
+ soversion: 6,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/include/meson.build b/src/interfaces/ecpg/include/meson.build
new file mode 100644
index 0000000000..840a23998d
--- /dev/null
+++ b/src/interfaces/ecpg/include/meson.build
@@ -0,0 +1,46 @@
+ecpg_conf_keys = [
+ 'ENABLE_THREAD_SAFETY',
+ 'HAVE_INT64',
+ 'HAVE_LONG_INT_64',
+ 'HAVE_LONG_LONG_INT_64',
+ 'PG_USE_STDBOOL',
+]
+
+ecpg_conf_data = configuration_data()
+
+foreach key : ecpg_conf_keys
+ if cdata.has(key)
+ ecpg_conf_data.set(key, cdata.get(key))
+ endif
+endforeach
+
+configure_file(
+ output: 'ecpg_config.h',
+ configuration: ecpg_conf_data,
+ install_dir: get_option('includedir'),
+)
+
+install_headers(
+ 'ecpg_informix.h',
+ 'ecpgerrno.h',
+ 'ecpglib.h',
+ 'ecpgtype.h',
+ 'pgtypes.h',
+ 'pgtypes_date.h',
+ 'pgtypes_error.h',
+ 'pgtypes_interval.h',
+ 'pgtypes_numeric.h',
+ 'pgtypes_timestamp.h',
+ 'sql3types.h',
+ 'sqlca.h',
+ 'sqlda.h',
+ 'sqlda-compat.h',
+ 'sqlda-native.h',
+)
+
+install_headers(
+ 'datetime.h',
+ 'decimal.h',
+ 'sqltypes.h',
+ subdir: 'informix/esql',
+)
diff --git a/src/interfaces/ecpg/meson.build b/src/interfaces/ecpg/meson.build
new file mode 100644
index 0000000000..ffbe84c0e8
--- /dev/null
+++ b/src/interfaces/ecpg/meson.build
@@ -0,0 +1,5 @@
+subdir('include')
+subdir('pgtypeslib')
+subdir('ecpglib')
+subdir('compatlib')
+subdir('preproc')
diff --git a/src/interfaces/ecpg/pgtypeslib/meson.build b/src/interfaces/ecpg/pgtypeslib/meson.build
new file mode 100644
index 0000000000..9b1d54c019
--- /dev/null
+++ b/src/interfaces/ecpg/pgtypeslib/meson.build
@@ -0,0 +1,12 @@
+ecpg_pgtypes = library('pgtypes',
+ 'common.c',
+ 'datetime.c',
+ 'dt_common.c',
+ 'interval.c',
+ 'numeric.c',
+ 'timestamp.c',
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code],
+ soversion: 3,
+ install: true,
+ )
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index ef6d645dee..747d824de3 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -65,7 +65,7 @@ preproc.h: preproc.c
preproc.c: BISONFLAGS += -d
preproc.y: ../../../backend/parser/gram.y parse.pl ecpg.addons ecpg.header ecpg.tokens ecpg.trailer ecpg.type
- $(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
+ $(PERL) $(srcdir)/parse.pl $(srcdir) $< > $@
$(PERL) $(srcdir)/check_rules.pl $(srcdir) $<
# generate keyword headers
diff --git a/src/interfaces/ecpg/preproc/meson.build b/src/interfaces/ecpg/preproc/meson.build
new file mode 100644
index 0000000000..4ae56f21d4
--- /dev/null
+++ b/src/interfaces/ecpg/preproc/meson.build
@@ -0,0 +1,55 @@
+pgc_c = custom_target('pgc.c',
+ input: ['pgc.l'],
+ output: ['pgc.c'],
+ command: [flex, '-o', '@OUTPUT@', '@INPUT@'])
+
+preproc_y = custom_target('preproc.y',
+ input: ['../../../backend/parser/gram.y',
+ 'parse.pl',
+ 'ecpg.addons',
+ 'ecpg.header',
+ 'ecpg.tokens',
+ 'ecpg.trailer',
+ 'ecpg.type'],
+ output: ['preproc.y'],
+ command: [perl, '@INPUT1@', '@CURRENT_SOURCE_DIR@', '@INPUT0@'],
+ capture: true)
+
+preproc_c = custom_target('preproc.c',
+ input: [preproc_y],
+ output: ['preproc.c', 'preproc.h'],
+ command: [bison, bisonflags, '-d', '-o', '@OUTPUT0@', '@INPUT@'])
+
+c_kwlist_d_h = custom_target('c_kwlist_d.h',
+ input: ['c_kwlist.h'],
+ output: ['c_kwlist_d.h'],
+ command: [perl, '-I', '@SOURCE_ROOT@/src/tools', '@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
+ '--output', '@OUTDIR@',
+ '--varname', 'ScanCKeywords', '--no-case-fold', '@INPUT0@'])
+
+ecpg_kwlist_d_h = custom_target('ecpg_kwlist_d.h',
+ input: ['ecpg_kwlist.h'],
+ output: ['ecpg_kwlist_d.h'],
+ command: [perl, '-I', '@SOURCE_ROOT@/src/tools', '@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
+ '--output', '@OUTDIR@',
+ '--varname', 'ScanECPGKeywords', '@INPUT0@'])
+
+executable('ecpg',
+ 'c_keywords.c',
+ 'descriptor.c',
+ 'ecpg.c',
+ 'ecpg_keywords.c',
+ 'keywords.c',
+ 'output.c',
+ 'parser.c',
+ pgc_c,
+ preproc_c,
+ 'type.c',
+ '../ecpglib/typename.c',
+ 'variable.c',
+ c_kwlist_d_h,
+ ecpg_kwlist_d_h,
+ include_directories : ['.', '../include', postgres_inc],
+ dependencies: [frontend_shlib_code, libpq],
+ kwargs: default_bin_args,
+ )
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index dee6b8200d..0dd9f30b41 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -19,6 +19,8 @@
my $path = shift @ARGV;
$path = "." unless $path;
+open(our $infile, '<', $ARGV[0]) or die;
+
my $copymode = 0;
my $brace_indent = 0;
my $yaccmode = 0;
@@ -132,9 +134,11 @@
include_file('trailer', 'ecpg.trailer');
dump_buffer('trailer');
+close($infile);
+
sub main
{
- line: while (<>)
+ line: while (<$infile>)
{
if (/ERRCODE_FEATURE_NOT_SUPPORTED/)
{
diff --git a/src/interfaces/meson.build b/src/interfaces/meson.build
new file mode 100644
index 0000000000..fb85e3fd20
--- /dev/null
+++ b/src/interfaces/meson.build
@@ -0,0 +1 @@
+subdir('ecpg')
diff --git a/src/meson.build b/src/meson.build
index 414be1db41..a7fdd5a13e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -8,3 +8,5 @@ subdir('backend')
subdir('bin')
subdir('pl')
+
+subdir('interfaces')
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-04-29 17:46 ` Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-04-29 17:46 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-04-20 15:09:31 +0200, Peter Eisentraut wrote:
> On 13.04.22 12:26, Peter Eisentraut wrote:
> > Some feedback and patches for your branch at
> > 3274198960c139328fef3c725cee1468bbfff469:
>
> Here is another patch. It adds support for building ecpg.
Cool!
I have merged this, with a few changes (split parse.pl change out, changed its
invocation in Solution.pm, indentation, explicitly using shared_library()
rather than library(), indentation).
But there's need for some more - exports.txt handling is needed for windows
(and everywhere else, but not as crucially) - hence CI currently being broken
on windows. I've done that in a VM, and it indeed fixes the issues. But it
needs to be generalized, I just copied and pasted stuff around...
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-02 14:47 ` Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-02 14:47 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 29.04.22 19:46, Andres Freund wrote:
> explicitly using shared_library() rather than library()
Why is that? We do build static libraries right now, so using library()
would seem more suitable for that.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-02 16:36 ` Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-05-02 16:36 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-02 16:47:43 +0200, Peter Eisentraut wrote:
> On 29.04.22 19:46, Andres Freund wrote:
> > explicitly using shared_library() rather than library()
>
> Why is that? We do build static libraries right now, so using library()
> would seem more suitable for that.
When I wrote this I hadn't realized that we build both shared and static
libraries. I've since changed the respective ecpg libraries to use
both_libraries(). Same with libpq (I really hadn't realized we build a static
libpq...).
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-04 11:53 ` Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 2 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-04 11:53 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
More patches:
0001-meson-Assorted-compiler-test-tweaks.patch
I was going through a diff of pg_config.h between old and new build and
found a few omissions and small differences.
Some of the
blah ? 1 : false
is of course annoying and can be removed eventually, but it's useful
when analyzing the diff, and since it's already done in other places it
seems reasonable to apply it consistently.
Of course there is some more work left for some of the more complicated
tests; this isn't meant to be complete.
0002-meson-Add-pg_walinspect.patch
This was added more recently and was not ported yet. Nothing too
interesting here.
0003-meson-Install-all-server-headers.patch
With this, all the server headers installed by a makefile-based build
are installed. I tried to strike a balance between using
install_subdir() with exclude list versus listing things explicitly.
Different variations might be possible, but this looked pretty sensible
to me.
With these patches, the list of files installed with make versus meson
match up, except for known open items (postmaster symlink, some library
naming differences, pkgconfig, pgxs, test modules installed, documentation).
From c3f4f4f8002e473284587d21f89cb66364365a26 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 09:54:36 +0200
Subject: [PATCH 1/3] meson: Assorted compiler test tweaks
---
meson.build | 46 +++++++++++++++++++++++++++++++++++++---------
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 80af8e13da..27bc9dcd48 100644
--- a/meson.build
+++ b/meson.build
@@ -222,7 +222,7 @@ meson_bin = find_program(meson_binpath, native: true)
# Option Handling
###############################################################
-cdata.set('USE_ASSERT_CHECKING', get_option('cassert'))
+cdata.set('USE_ASSERT_CHECKING', get_option('cassert') ? 1 : false)
cdata.set('BLCKSZ', 8192, description: '''
Size of a disk block --- this also limits the size of a tuple. You
@@ -241,7 +241,7 @@ cdata.set('BLCKSZ', 8192, description: '''
cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
-cdata.set_quoted('DEF_PGPORT_STR', '5432')
+cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
@@ -870,8 +870,6 @@ if get_option('ssl') == 'openssl'
ssl_int = [ssl]
endif
- cdata.set_quoted('WITH_SSL', get_option('ssl'))
-
check_funcs = [
['CRYPTO_new_ex_data', {'required': true}],
['SSL_new', {'required': true}],
@@ -1381,7 +1379,7 @@ int main(void)
cdata.set(check['name'],
cc.links(test,
name: check['desc'],
- args: g_c_args + ['-DINT64=@0@'.format(cdata.get('PG_INT64_TYPE'))])
+ args: g_c_args + ['-DINT64=@0@'.format(cdata.get('PG_INT64_TYPE'))]) ? 1 : false
)
endforeach
@@ -1609,7 +1607,8 @@ endif
if cc.has_member('struct sockaddr_storage', 'ss_family',
args: g_c_args, include_directories: g_c_inc,
- prefix: '''#include <sys/types.h>
+ prefix: '''
+#include <sys/types.h>
#include <sys/socket.h>''')
cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY', 1)
endif
@@ -1622,6 +1621,30 @@ if cc.has_member('struct sockaddr_storage', '__ss_family',
cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY', 1)
endif
+if cc.has_member('struct sockaddr_storage', 'ss_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN', 1)
+endif
+
+if cc.has_member('struct sockaddr_storage', '__ss_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN', 1)
+endif
+
+if cc.has_member('struct sockaddr', 'sa_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_SA_LEN', 1)
+endif
+
if cc.has_type('struct sockaddr_un',
args: g_c_args, include_directories: g_c_inc,
prefix: '''
@@ -1701,10 +1724,10 @@ endif
# needs xlocale.h; standard is locale.h, but glibc also has an
# xlocale.h file that we should not use.
if cc.has_type('locale_t', prefix: '#include <locale.h>')
- cdata.set('HAVE_LOCALE_T', true)
+ cdata.set('HAVE_LOCALE_T', 1)
elif cc.has_type('locale_t', prefix: '#include <xlocale.h>')
- cdata.set('HAVE_LOCALE_T', true)
- cdata.set('LOCALE_T_IN_XLOCALE', true)
+ cdata.set('HAVE_LOCALE_T', 1)
+ cdata.set('LOCALE_T_IN_XLOCALE', 1)
endif
# MSVC doesn't cope well with defining restrict to __restrict, the
@@ -1781,6 +1804,7 @@ func_checks = [
['getrusage'],
['gettimeofday'], # XXX: This seems to be in the autoconf case
['inet_aton'],
+ ['inet_pton'],
['kqueue'],
['link'],
['mbstowcs_l'],
@@ -1852,6 +1876,10 @@ foreach c : func_checks
endforeach
+if cc.has_function('syslog', args: g_c_args) and cc.check_header('syslog.h', args: g_c_args)
+ cdata.set('HAVE_SYSLOG', 1)
+endif
+
--
2.35.1
From 258c06186b7a4b9beabde33eb3677dbc89117418 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 12:21:03 +0200
Subject: [PATCH 2/3] meson: Add pg_walinspect
---
contrib/meson.build | 1 +
contrib/pg_walinspect/meson.build | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 contrib/pg_walinspect/meson.build
diff --git a/contrib/meson.build b/contrib/meson.build
index 09c0f8ab03..84752d4bd0 100644
--- a/contrib/meson.build
+++ b/contrib/meson.build
@@ -48,6 +48,7 @@ subdir('pgstattuple')
subdir('pg_surgery')
subdir('pg_trgm')
subdir('pg_visibility')
+subdir('pg_walinspect')
subdir('postgres_fdw')
subdir('seg')
subdir('sepgsql')
diff --git a/contrib/pg_walinspect/meson.build b/contrib/pg_walinspect/meson.build
new file mode 100644
index 0000000000..7977d4b1bb
--- /dev/null
+++ b/contrib/pg_walinspect/meson.build
@@ -0,0 +1,24 @@
+pg_walinspect = shared_module('pg_walinspect',
+ files('pg_walinspect.c'),
+ kwargs: contrib_mod_args + {
+ 'dependencies': contrib_mod_args['dependencies'],
+ },
+)
+
+install_data(
+ 'pg_walinspect.control',
+ 'pg_walinspect--1.0.sql',
+ kwargs: contrib_data_args,
+)
+
+tests += {
+ 'name': 'pg_walinspect',
+ 'sd': meson.current_source_dir(),
+ 'bd': meson.current_build_dir(),
+ 'regress': {
+ 'sql': [
+ 'pg_walinspect',
+ ],
+ 'regress_args': ['--temp-config', files('walinspect.conf')],
+ },
+}
--
2.35.1
From ecb38fbf49cec66ec4eb77cb4fba0fac0df1241f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 12:22:02 +0200
Subject: [PATCH 3/3] meson: Install all server headers
---
contrib/cube/meson.build | 5 +++
contrib/hstore/meson.build | 5 +++
contrib/isn/meson.build | 5 +++
contrib/ltree/meson.build | 5 +++
contrib/seg/meson.build | 5 +++
meson.build | 1 +
src/include/meson.build | 64 +++++++++++++++++++++++++++++++++--
src/include/utils/meson.build | 12 +++++--
src/pl/plperl/meson.build | 7 ++++
src/pl/plpython/meson.build | 17 ++++++++++
10 files changed, 121 insertions(+), 5 deletions(-)
diff --git a/contrib/cube/meson.build b/contrib/cube/meson.build
index cb6ebf481b..e15a56f257 100644
--- a/contrib/cube/meson.build
+++ b/contrib/cube/meson.build
@@ -31,6 +31,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'cubedata.h',
+ install_dir: dir_include_extension / 'cube',
+)
+
tests += {
'name': 'cube',
'sd': meson.current_source_dir(),
diff --git a/contrib/hstore/meson.build b/contrib/hstore/meson.build
index 3026fe95e8..3aed37ce8e 100644
--- a/contrib/hstore/meson.build
+++ b/contrib/hstore/meson.build
@@ -27,6 +27,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'hstore.h',
+ install_dir: dir_include_extension / 'hstore',
+)
+
tests += {
'name': 'hstore',
'sd': meson.current_source_dir(),
diff --git a/contrib/isn/meson.build b/contrib/isn/meson.build
index 8178c1450d..508e2dfa08 100644
--- a/contrib/isn/meson.build
+++ b/contrib/isn/meson.build
@@ -15,6 +15,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'isn.h',
+ install_dir: dir_include_extension / 'isn',
+)
+
tests += {
'name': 'isn',
'sd': meson.current_source_dir(),
diff --git a/contrib/ltree/meson.build b/contrib/ltree/meson.build
index e2ab05ddba..222c64bb35 100644
--- a/contrib/ltree/meson.build
+++ b/contrib/ltree/meson.build
@@ -26,6 +26,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'ltree.h',
+ install_dir: dir_include_extension / 'ltree',
+)
+
tests += {
'name': 'ltree',
'sd': meson.current_source_dir(),
diff --git a/contrib/seg/meson.build b/contrib/seg/meson.build
index 21561f6651..10e9b8562b 100644
--- a/contrib/seg/meson.build
+++ b/contrib/seg/meson.build
@@ -30,6 +30,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'segdata.h',
+ install_dir: dir_include_extension / 'seg',
+)
+
tests += {
'name': 'seg',
'sd': meson.current_source_dir(),
diff --git a/meson.build b/meson.build
index 27bc9dcd48..70951efeb4 100644
--- a/meson.build
+++ b/meson.build
@@ -297,6 +297,7 @@ dir_locale = get_option('localedir')
dir_bitcode = dir_lib / 'bitcode'
dir_include_internal = dir_include_pkg / 'internal'
dir_include_server = dir_include_pkg / 'server'
+dir_include_extension = dir_include_server / 'extension'
dir_data_extension = dir_data / 'extension'
diff --git a/src/include/meson.build b/src/include/meson.build
index 2f27d6f33e..e5ce901e9a 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -68,10 +68,23 @@ install_headers(
install_headers(
'c.h',
- 'port.h',
- 'postgres_fe.h',
+ 'fmgr.h',
+ 'funcapi.h',
+ 'getaddrinfo.h',
+ 'getopt_long.h',
+ 'miscadmin.h',
'pg_config_manual.h',
+ 'pg_getopt.h',
+ 'pg_trace.h',
+ 'pgstat.h',
+ 'pgtar.h',
+ 'pgtime.h',
+ 'port.h',
+ 'postgres.h',
'postgres_ext.h',
+ 'postgres_fe.h',
+ 'rusagestub.h',
+ 'windowapi.h',
pg_config_ext,
pg_config_os,
pg_config,
@@ -83,3 +96,50 @@ subdir('storage')
subdir('catalog')
subdir('parser')
subdir('pch')
+
+foreach d : [
+ 'access', 'bootstrap', 'commands', 'common', 'datatype',
+ 'executor', 'fe_utils', 'foreign', 'jit',
+ 'lib', 'libpq', 'mb', 'nodes', 'optimizer', 'parser', 'partitioning', 'postmaster',
+ 'regex', 'replication', 'rewrite',
+ 'statistics', 'storage', 'tcop', 'snowball', 'tsearch',
+ 'utils', 'port', 'portability',
+]
+ install_subdir(d, install_dir: dir_include_server,
+ exclude_files: ['.gitignore', 'meson.build'])
+endforeach
+
+install_subdir('catalog', install_dir: dir_include_server,
+ exclude_files: [
+ '.gitignore',
+ 'Makefile',
+ 'duplicate_oids',
+ 'meson.build',
+ 'pg_aggregate.dat',
+ 'pg_am.dat',
+ 'pg_amop.dat',
+ 'pg_amproc.dat',
+ 'pg_authid.dat',
+ 'pg_cast.dat',
+ 'pg_class.dat',
+ 'pg_collation.dat',
+ 'pg_conversion.dat',
+ 'pg_database.dat',
+ 'pg_language.dat',
+ 'pg_namespace.dat',
+ 'pg_opclass.dat',
+ 'pg_operator.dat',
+ 'pg_opfamily.dat',
+ 'pg_proc.dat',
+ 'pg_range.dat',
+ 'pg_tablespace.dat',
+ 'pg_ts_config.dat',
+ 'pg_ts_config_map.dat',
+ 'pg_ts_dict.dat',
+ 'pg_ts_parser.dat',
+ 'pg_ts_template.dat',
+ 'pg_type.dat',
+ 'reformat_dat_file.pl',
+ 'renumber_oids.pl',
+ 'unused_oids',
+ ])
diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build
index b9c959b474..6e1437f300 100644
--- a/src/include/utils/meson.build
+++ b/src/include/utils/meson.build
@@ -1,7 +1,9 @@
errcodes = custom_target('errcodes',
input : files('../../backend/utils/errcodes.txt'),
output : ['errcodes.h'],
- command : [perl, files('../../backend/utils/generate-errcodes.pl'), '@INPUT@', '@OUTPUT@']
+ command : [perl, files('../../backend/utils/generate-errcodes.pl'), '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
)
generated_headers += errcodes
@@ -9,13 +11,17 @@ generated_backend_headers += custom_target('probes.d',
input: files('../../backend/utils/probes.d'),
output : 'probes.h',
capture: true,
- command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@']
+ command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
)
fmgrtab_target = custom_target('fmgrtab',
input: '../catalog/pg_proc.dat',
output : ['fmgroids.h', 'fmgrprotos.h', 'fmgrtab.c'],
- command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@']
+ command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@'],
+ install: true,
+ install_dir: [dir_include_server/'utils', dir_include_server/'utils', false],
)
generated_backend_headers += fmgrtab_target[0]
diff --git a/src/pl/plperl/meson.build b/src/pl/plperl/meson.build
index 9f0ad97936..4b14c556c2 100644
--- a/src/pl/plperl/meson.build
+++ b/src/pl/plperl/meson.build
@@ -60,6 +60,13 @@ install_data(
install_dir: dir_data_extension,
)
+install_headers(
+ 'plperl.h',
+ 'plperl_helpers.h',
+ 'ppport.h',
+ install_dir: dir_include_server,
+)
+
tests += {
'name': 'plperl',
'sd': meson.current_source_dir(),
diff --git a/src/pl/plpython/meson.build b/src/pl/plpython/meson.build
index dd5f8838e2..449654914d 100644
--- a/src/pl/plpython/meson.build
+++ b/src/pl/plpython/meson.build
@@ -44,6 +44,23 @@ install_data(
install_dir: dir_data_extension,
)
+install_headers(
+ 'plpy_cursorobject.h',
+ 'plpy_elog.h',
+ 'plpy_exec.h',
+ 'plpy_main.h',
+ 'plpy_planobject.h',
+ 'plpy_plpymodule.h',
+ 'plpy_procedure.h',
+ 'plpy_resultobject.h',
+ 'plpy_spi.h',
+ 'plpy_subxactobject.h',
+ 'plpy_typeio.h',
+ 'plpy_util.h',
+ 'plpython.h',
+ install_dir: dir_include_server,
+)
+
plpython_regress = [
'plpython_schema',
'plpython_populate',
--
2.35.1
Attachments:
[text/plain] 0001-meson-Assorted-compiler-test-tweaks.patch (3.9K, ../../[email protected]/2-0001-meson-Assorted-compiler-test-tweaks.patch)
download | inline diff:
From c3f4f4f8002e473284587d21f89cb66364365a26 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 09:54:36 +0200
Subject: [PATCH 1/3] meson: Assorted compiler test tweaks
---
meson.build | 46 +++++++++++++++++++++++++++++++++++++---------
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 80af8e13da..27bc9dcd48 100644
--- a/meson.build
+++ b/meson.build
@@ -222,7 +222,7 @@ meson_bin = find_program(meson_binpath, native: true)
# Option Handling
###############################################################
-cdata.set('USE_ASSERT_CHECKING', get_option('cassert'))
+cdata.set('USE_ASSERT_CHECKING', get_option('cassert') ? 1 : false)
cdata.set('BLCKSZ', 8192, description: '''
Size of a disk block --- this also limits the size of a tuple. You
@@ -241,7 +241,7 @@ cdata.set('BLCKSZ', 8192, description: '''
cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
-cdata.set_quoted('DEF_PGPORT_STR', '5432')
+cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
@@ -870,8 +870,6 @@ if get_option('ssl') == 'openssl'
ssl_int = [ssl]
endif
- cdata.set_quoted('WITH_SSL', get_option('ssl'))
-
check_funcs = [
['CRYPTO_new_ex_data', {'required': true}],
['SSL_new', {'required': true}],
@@ -1381,7 +1379,7 @@ int main(void)
cdata.set(check['name'],
cc.links(test,
name: check['desc'],
- args: g_c_args + ['-DINT64=@0@'.format(cdata.get('PG_INT64_TYPE'))])
+ args: g_c_args + ['-DINT64=@0@'.format(cdata.get('PG_INT64_TYPE'))]) ? 1 : false
)
endforeach
@@ -1609,7 +1607,8 @@ endif
if cc.has_member('struct sockaddr_storage', 'ss_family',
args: g_c_args, include_directories: g_c_inc,
- prefix: '''#include <sys/types.h>
+ prefix: '''
+#include <sys/types.h>
#include <sys/socket.h>''')
cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY', 1)
endif
@@ -1622,6 +1621,30 @@ if cc.has_member('struct sockaddr_storage', '__ss_family',
cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY', 1)
endif
+if cc.has_member('struct sockaddr_storage', 'ss_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN', 1)
+endif
+
+if cc.has_member('struct sockaddr_storage', '__ss_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN', 1)
+endif
+
+if cc.has_member('struct sockaddr', 'sa_len',
+ args: g_c_args, include_directories: g_c_inc,
+ prefix: '''
+#include <sys/types.h>
+#include <sys/socket.h>''')
+ cdata.set('HAVE_STRUCT_SOCKADDR_SA_LEN', 1)
+endif
+
if cc.has_type('struct sockaddr_un',
args: g_c_args, include_directories: g_c_inc,
prefix: '''
@@ -1701,10 +1724,10 @@ endif
# needs xlocale.h; standard is locale.h, but glibc also has an
# xlocale.h file that we should not use.
if cc.has_type('locale_t', prefix: '#include <locale.h>')
- cdata.set('HAVE_LOCALE_T', true)
+ cdata.set('HAVE_LOCALE_T', 1)
elif cc.has_type('locale_t', prefix: '#include <xlocale.h>')
- cdata.set('HAVE_LOCALE_T', true)
- cdata.set('LOCALE_T_IN_XLOCALE', true)
+ cdata.set('HAVE_LOCALE_T', 1)
+ cdata.set('LOCALE_T_IN_XLOCALE', 1)
endif
# MSVC doesn't cope well with defining restrict to __restrict, the
@@ -1781,6 +1804,7 @@ func_checks = [
['getrusage'],
['gettimeofday'], # XXX: This seems to be in the autoconf case
['inet_aton'],
+ ['inet_pton'],
['kqueue'],
['link'],
['mbstowcs_l'],
@@ -1852,6 +1876,10 @@ foreach c : func_checks
endforeach
+if cc.has_function('syslog', args: g_c_args) and cc.check_header('syslog.h', args: g_c_args)
+ cdata.set('HAVE_SYSLOG', 1)
+endif
+
--
2.35.1
[text/plain] 0002-meson-Add-pg_walinspect.patch (1.4K, ../../[email protected]/3-0002-meson-Add-pg_walinspect.patch)
download | inline diff:
From 258c06186b7a4b9beabde33eb3677dbc89117418 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 12:21:03 +0200
Subject: [PATCH 2/3] meson: Add pg_walinspect
---
contrib/meson.build | 1 +
contrib/pg_walinspect/meson.build | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 contrib/pg_walinspect/meson.build
diff --git a/contrib/meson.build b/contrib/meson.build
index 09c0f8ab03..84752d4bd0 100644
--- a/contrib/meson.build
+++ b/contrib/meson.build
@@ -48,6 +48,7 @@ subdir('pgstattuple')
subdir('pg_surgery')
subdir('pg_trgm')
subdir('pg_visibility')
+subdir('pg_walinspect')
subdir('postgres_fdw')
subdir('seg')
subdir('sepgsql')
diff --git a/contrib/pg_walinspect/meson.build b/contrib/pg_walinspect/meson.build
new file mode 100644
index 0000000000..7977d4b1bb
--- /dev/null
+++ b/contrib/pg_walinspect/meson.build
@@ -0,0 +1,24 @@
+pg_walinspect = shared_module('pg_walinspect',
+ files('pg_walinspect.c'),
+ kwargs: contrib_mod_args + {
+ 'dependencies': contrib_mod_args['dependencies'],
+ },
+)
+
+install_data(
+ 'pg_walinspect.control',
+ 'pg_walinspect--1.0.sql',
+ kwargs: contrib_data_args,
+)
+
+tests += {
+ 'name': 'pg_walinspect',
+ 'sd': meson.current_source_dir(),
+ 'bd': meson.current_build_dir(),
+ 'regress': {
+ 'sql': [
+ 'pg_walinspect',
+ ],
+ 'regress_args': ['--temp-config', files('walinspect.conf')],
+ },
+}
--
2.35.1
[text/plain] 0003-meson-Install-all-server-headers.patch (8.0K, ../../[email protected]/4-0003-meson-Install-all-server-headers.patch)
download | inline diff:
From ecb38fbf49cec66ec4eb77cb4fba0fac0df1241f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 12:22:02 +0200
Subject: [PATCH 3/3] meson: Install all server headers
---
contrib/cube/meson.build | 5 +++
contrib/hstore/meson.build | 5 +++
contrib/isn/meson.build | 5 +++
contrib/ltree/meson.build | 5 +++
contrib/seg/meson.build | 5 +++
meson.build | 1 +
src/include/meson.build | 64 +++++++++++++++++++++++++++++++++--
src/include/utils/meson.build | 12 +++++--
src/pl/plperl/meson.build | 7 ++++
src/pl/plpython/meson.build | 17 ++++++++++
10 files changed, 121 insertions(+), 5 deletions(-)
diff --git a/contrib/cube/meson.build b/contrib/cube/meson.build
index cb6ebf481b..e15a56f257 100644
--- a/contrib/cube/meson.build
+++ b/contrib/cube/meson.build
@@ -31,6 +31,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'cubedata.h',
+ install_dir: dir_include_extension / 'cube',
+)
+
tests += {
'name': 'cube',
'sd': meson.current_source_dir(),
diff --git a/contrib/hstore/meson.build b/contrib/hstore/meson.build
index 3026fe95e8..3aed37ce8e 100644
--- a/contrib/hstore/meson.build
+++ b/contrib/hstore/meson.build
@@ -27,6 +27,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'hstore.h',
+ install_dir: dir_include_extension / 'hstore',
+)
+
tests += {
'name': 'hstore',
'sd': meson.current_source_dir(),
diff --git a/contrib/isn/meson.build b/contrib/isn/meson.build
index 8178c1450d..508e2dfa08 100644
--- a/contrib/isn/meson.build
+++ b/contrib/isn/meson.build
@@ -15,6 +15,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'isn.h',
+ install_dir: dir_include_extension / 'isn',
+)
+
tests += {
'name': 'isn',
'sd': meson.current_source_dir(),
diff --git a/contrib/ltree/meson.build b/contrib/ltree/meson.build
index e2ab05ddba..222c64bb35 100644
--- a/contrib/ltree/meson.build
+++ b/contrib/ltree/meson.build
@@ -26,6 +26,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'ltree.h',
+ install_dir: dir_include_extension / 'ltree',
+)
+
tests += {
'name': 'ltree',
'sd': meson.current_source_dir(),
diff --git a/contrib/seg/meson.build b/contrib/seg/meson.build
index 21561f6651..10e9b8562b 100644
--- a/contrib/seg/meson.build
+++ b/contrib/seg/meson.build
@@ -30,6 +30,11 @@ install_data(
kwargs: contrib_data_args,
)
+install_headers(
+ 'segdata.h',
+ install_dir: dir_include_extension / 'seg',
+)
+
tests += {
'name': 'seg',
'sd': meson.current_source_dir(),
diff --git a/meson.build b/meson.build
index 27bc9dcd48..70951efeb4 100644
--- a/meson.build
+++ b/meson.build
@@ -297,6 +297,7 @@ dir_locale = get_option('localedir')
dir_bitcode = dir_lib / 'bitcode'
dir_include_internal = dir_include_pkg / 'internal'
dir_include_server = dir_include_pkg / 'server'
+dir_include_extension = dir_include_server / 'extension'
dir_data_extension = dir_data / 'extension'
diff --git a/src/include/meson.build b/src/include/meson.build
index 2f27d6f33e..e5ce901e9a 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -68,10 +68,23 @@ install_headers(
install_headers(
'c.h',
- 'port.h',
- 'postgres_fe.h',
+ 'fmgr.h',
+ 'funcapi.h',
+ 'getaddrinfo.h',
+ 'getopt_long.h',
+ 'miscadmin.h',
'pg_config_manual.h',
+ 'pg_getopt.h',
+ 'pg_trace.h',
+ 'pgstat.h',
+ 'pgtar.h',
+ 'pgtime.h',
+ 'port.h',
+ 'postgres.h',
'postgres_ext.h',
+ 'postgres_fe.h',
+ 'rusagestub.h',
+ 'windowapi.h',
pg_config_ext,
pg_config_os,
pg_config,
@@ -83,3 +96,50 @@ subdir('storage')
subdir('catalog')
subdir('parser')
subdir('pch')
+
+foreach d : [
+ 'access', 'bootstrap', 'commands', 'common', 'datatype',
+ 'executor', 'fe_utils', 'foreign', 'jit',
+ 'lib', 'libpq', 'mb', 'nodes', 'optimizer', 'parser', 'partitioning', 'postmaster',
+ 'regex', 'replication', 'rewrite',
+ 'statistics', 'storage', 'tcop', 'snowball', 'tsearch',
+ 'utils', 'port', 'portability',
+]
+ install_subdir(d, install_dir: dir_include_server,
+ exclude_files: ['.gitignore', 'meson.build'])
+endforeach
+
+install_subdir('catalog', install_dir: dir_include_server,
+ exclude_files: [
+ '.gitignore',
+ 'Makefile',
+ 'duplicate_oids',
+ 'meson.build',
+ 'pg_aggregate.dat',
+ 'pg_am.dat',
+ 'pg_amop.dat',
+ 'pg_amproc.dat',
+ 'pg_authid.dat',
+ 'pg_cast.dat',
+ 'pg_class.dat',
+ 'pg_collation.dat',
+ 'pg_conversion.dat',
+ 'pg_database.dat',
+ 'pg_language.dat',
+ 'pg_namespace.dat',
+ 'pg_opclass.dat',
+ 'pg_operator.dat',
+ 'pg_opfamily.dat',
+ 'pg_proc.dat',
+ 'pg_range.dat',
+ 'pg_tablespace.dat',
+ 'pg_ts_config.dat',
+ 'pg_ts_config_map.dat',
+ 'pg_ts_dict.dat',
+ 'pg_ts_parser.dat',
+ 'pg_ts_template.dat',
+ 'pg_type.dat',
+ 'reformat_dat_file.pl',
+ 'renumber_oids.pl',
+ 'unused_oids',
+ ])
diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build
index b9c959b474..6e1437f300 100644
--- a/src/include/utils/meson.build
+++ b/src/include/utils/meson.build
@@ -1,7 +1,9 @@
errcodes = custom_target('errcodes',
input : files('../../backend/utils/errcodes.txt'),
output : ['errcodes.h'],
- command : [perl, files('../../backend/utils/generate-errcodes.pl'), '@INPUT@', '@OUTPUT@']
+ command : [perl, files('../../backend/utils/generate-errcodes.pl'), '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
)
generated_headers += errcodes
@@ -9,13 +11,17 @@ generated_backend_headers += custom_target('probes.d',
input: files('../../backend/utils/probes.d'),
output : 'probes.h',
capture: true,
- command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@']
+ command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
)
fmgrtab_target = custom_target('fmgrtab',
input: '../catalog/pg_proc.dat',
output : ['fmgroids.h', 'fmgrprotos.h', 'fmgrtab.c'],
- command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@']
+ command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@'],
+ install: true,
+ install_dir: [dir_include_server/'utils', dir_include_server/'utils', false],
)
generated_backend_headers += fmgrtab_target[0]
diff --git a/src/pl/plperl/meson.build b/src/pl/plperl/meson.build
index 9f0ad97936..4b14c556c2 100644
--- a/src/pl/plperl/meson.build
+++ b/src/pl/plperl/meson.build
@@ -60,6 +60,13 @@ install_data(
install_dir: dir_data_extension,
)
+install_headers(
+ 'plperl.h',
+ 'plperl_helpers.h',
+ 'ppport.h',
+ install_dir: dir_include_server,
+)
+
tests += {
'name': 'plperl',
'sd': meson.current_source_dir(),
diff --git a/src/pl/plpython/meson.build b/src/pl/plpython/meson.build
index dd5f8838e2..449654914d 100644
--- a/src/pl/plpython/meson.build
+++ b/src/pl/plpython/meson.build
@@ -44,6 +44,23 @@ install_data(
install_dir: dir_data_extension,
)
+install_headers(
+ 'plpy_cursorobject.h',
+ 'plpy_elog.h',
+ 'plpy_exec.h',
+ 'plpy_main.h',
+ 'plpy_planobject.h',
+ 'plpy_plpymodule.h',
+ 'plpy_procedure.h',
+ 'plpy_resultobject.h',
+ 'plpy_spi.h',
+ 'plpy_subxactobject.h',
+ 'plpy_typeio.h',
+ 'plpy_util.h',
+ 'plpython.h',
+ install_dir: dir_include_server,
+)
+
plpython_regress = [
'plpython_schema',
'plpython_populate',
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-06 21:27 ` Andres Freund <[email protected]>
2022-05-06 22:08 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-11 10:11 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-01 04:55 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
1 sibling, 3 replies; 44+ messages in thread
From: Andres Freund @ 2022-05-06 21:27 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-04 13:53:54 +0200, Peter Eisentraut wrote:
> 0001-meson-Assorted-compiler-test-tweaks.patch
>
> I was going through a diff of pg_config.h between old and new build and
> found a few omissions and small differences.
Thanks, merged that.
> is of course annoying and can be removed eventually, but it's useful when
> analyzing the diff, and since it's already done in other places it seems
> reasonable to apply it consistently.
Yea, I'd tried to minimize the difference at some point, but haven't done so
in a while...
> 0002-meson-Add-pg_walinspect.patch
>
> This was added more recently and was not ported yet. Nothing too
> interesting here.
Merged that.
> 0003-meson-Install-all-server-headers.patch
>
> With this, all the server headers installed by a makefile-based build are
> installed. I tried to strike a balance between using install_subdir() with
> exclude list versus listing things explicitly. Different variations might be
> possible, but this looked pretty sensible to me.
I locally had something similar, but I'm worried that this approach will be
too fragile. Leads to e.g. editor temp files getting installed. I've merged it
for now, but I think we need a different approach.
> With these patches, the list of files installed with make versus meson match
> up, except for known open items (postmaster symlink, some library naming
> differences, pkgconfig, pgxs, test modules installed, documentation).
I added pkgconfig since then. They're not exactly the same, but pretty close,
except for one thing: Looks like some of the ecpg libraries really should link
to some other ecpg libs? I think we're missing something there... That then
leads to missing requirements in the .pc files.
Re symlink: Do you have an opion about dropping the symlink vs implementing it
(likely via a small helper script?)?
Re library naming: It'd obviously be easy to adjust the library names, but I
wonder if it'd not be worth keeping the _static.a suffix, right now unsuffixed
library name imo is quite confusing.
Re test modules: Not sure what the best fix for that is yet. Except that we
don't have a search path for server libs, I'd just install them to a dedicated
path or add the build dir to the search path. But we don't, so ...
Re docs: I think the best approach here would be to have a new
meson_options.txt option defining whether the docs should be built. But not
quite sure.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-06 22:08 ` Andres Freund <[email protected]>
2 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-05-06 22:08 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-06 14:27:24 -0700, Andres Freund wrote:
> > 0003-meson-Install-all-server-headers.patch
> >
> > With this, all the server headers installed by a makefile-based build are
> > installed. I tried to strike a balance between using install_subdir() with
> > exclude list versus listing things explicitly. Different variations might be
> > possible, but this looked pretty sensible to me.
>
> I locally had something similar, but I'm worried that this approach will be
> too fragile. Leads to e.g. editor temp files getting installed. I've merged it
> for now, but I think we need a different approach.
Meant to add potential alternatives here: The easiest likely would be to just
add an install script that globs *.h. Alternatively we could build a file list
at configure time, and then install that with install_header(). The advantage
would be that it be available for things like cpluspluscheck, the disadvantage
that something needs to trigger reconfiguration to update the file list.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-11 10:11 ` Peter Eisentraut <[email protected]>
2 siblings, 0 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-11 10:11 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 06.05.22 23:27, Andres Freund wrote:
> Re symlink: Do you have an opion about dropping the symlink vs implementing it
> (likely via a small helper script?)?
I think the postmaster symlink could be dropped. The postmaster man
page has been saying that it's deprecated since 2006.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-06-01 04:55 ` Peter Eisentraut <[email protected]>
2022-06-01 20:53 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-06-01 04:55 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 06.05.22 23:27, Andres Freund wrote:
> I added pkgconfig since then. They're not exactly the same, but pretty close,
> except for one thing: Looks like some of the ecpg libraries really should link
> to some other ecpg libs? I think we're missing something there... That then
> leads to missing requirements in the .pc files.
I took a closer look at the generated pkgconfig files. I think they are
ok. There are a couple of insignificant textual differences that we
could reduce by patching Makefile.shlib. But technically they are ok.
There is one significant difference: the ecpg libraries now get a
Requires.private for openssl, which I think is technically correct since
both libpgcommon and libpgport require openssl.
Attached is a tiny patch to make the description in one file backward
consistent.
From 8320c520e01b52933f6688e210ffa9cdfdefffe9 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 31 May 2022 20:46:20 +0200
Subject: [PATCH] fixup! meson: Add meson based buildsystem.
Fix description in pkg-config file for backward consistency.
---
src/interfaces/ecpg/compatlib/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/interfaces/ecpg/compatlib/meson.build b/src/interfaces/ecpg/compatlib/meson.build
index 3cd61217e3..84cd42ccee 100644
--- a/src/interfaces/ecpg/compatlib/meson.build
+++ b/src/interfaces/ecpg/compatlib/meson.build
@@ -11,6 +11,6 @@ ecpg_compat = both_libraries('ecpg_compat',
pkgconfig.generate(
ecpg_compat.get_shared_lib(),
name: 'libecpg_compat',
- description: 'PostgreSQL ecpg_compat library',
+ description: 'PostgreSQL libecpg_compat library',
url: pg_url,
)
--
2.36.1
Attachments:
[text/plain] 0001-fixup-meson-Add-meson-based-buildsystem.patch (887B, ../../[email protected]/2-0001-fixup-meson-Add-meson-based-buildsystem.patch)
download | inline diff:
From 8320c520e01b52933f6688e210ffa9cdfdefffe9 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 31 May 2022 20:46:20 +0200
Subject: [PATCH] fixup! meson: Add meson based buildsystem.
Fix description in pkg-config file for backward consistency.
---
src/interfaces/ecpg/compatlib/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/interfaces/ecpg/compatlib/meson.build b/src/interfaces/ecpg/compatlib/meson.build
index 3cd61217e3..84cd42ccee 100644
--- a/src/interfaces/ecpg/compatlib/meson.build
+++ b/src/interfaces/ecpg/compatlib/meson.build
@@ -11,6 +11,6 @@ ecpg_compat = both_libraries('ecpg_compat',
pkgconfig.generate(
ecpg_compat.get_shared_lib(),
name: 'libecpg_compat',
- description: 'PostgreSQL ecpg_compat library',
+ description: 'PostgreSQL libecpg_compat library',
url: pg_url,
)
--
2.36.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-06-01 04:55 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-01 20:53 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-06-01 20:53 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-06-01 06:55:06 +0200, Peter Eisentraut wrote:
>
> On 06.05.22 23:27, Andres Freund wrote:
> > I added pkgconfig since then. They're not exactly the same, but pretty close,
> > except for one thing: Looks like some of the ecpg libraries really should link
> > to some other ecpg libs? I think we're missing something there... That then
> > leads to missing requirements in the .pc files.
>
> I took a closer look at the generated pkgconfig files. I think they are ok.
> There are a couple of insignificant textual differences that we could reduce
> by patching Makefile.shlib. But technically they are ok.
Thanks for checking!
> There is one significant difference: the ecpg libraries now get a
> Requires.private for openssl, which I think is technically correct since
> both libpgcommon and libpgport require openssl.
Yea, I noticed those too. It's not great, somehow. But I don't really see a
better alternative for now.
> Attached is a tiny patch to make the description in one file backward
> consistent.
Applied.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-11 10:18 ` Peter Eisentraut <[email protected]>
2022-05-12 19:30 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-13 23:17 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2023-04-14 15:58 ` Re: [RFC] building postgres with meson -v8 Greg Stark <[email protected]>
1 sibling, 4 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-11 10:18 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
More patches:
I fixed the Perl detection issue in my macOS environment that I had
reported a while ago.
Then I added in support for all configure options that had not been
ported over yet. Some of these are rather trivial.
After that, these configure options don't have an equivalent yet:
--disable-rpath
--enable-profiling
--disable-thread-safety
--with-libedit-preferred
The first three overlap with meson built-in functionality, so we would
need to check whether the desired functionality is available somehow.
The last one we probably want to keep somehow; it would need a bit of
fiddly work.
From fd05ad3f1582884aef2db162c2c7ba4897299078 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 11:08:07 +0200
Subject: [PATCH 1/9] meson: Fix Perl include dir detection
Only use -iwithsysroot if required. This aligns with the logic in
configure.ac.
---
meson.build | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 5f8165df9c..7958e8eb19 100644
--- a/meson.build
+++ b/meson.build
@@ -591,8 +591,6 @@ else
perl_inc_dir = '@0@/CORE'.format(archlibexp)
- perl_ccflags = []
-
if useshrplib != 'true'
perl_may_work = false
perl_msg = 'need a shared perl'
@@ -606,9 +604,13 @@ else
# et al seeing them. So we can't use include_directories(), as that checks
# file existence.
if perl_may_work
- perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
- if host_machine.system() == 'darwin'
- perl_ccflags += ['-iwithsysroot', perl_inc_dir]
+ # On most platforms, archlibexp is also where the Perl include files live ...
+ perl_ccflags = ['-I@0@'.format(perl_inc_dir)]
+ # ... but on newer macOS versions, we must use -iwithsysroot to look
+ # under sysroot
+ if not fs.is_file('@0@/perl.h'.format(perl_inc_dir)) and \
+ fs.is_file('@0@@1@/perl.h'.format(sysroot, perl_inc_dir))
+ perl_ccflags = ['-iwithsysroot', perl_inc_dir]
endif
endif
--
2.35.1
From 1429482c5d3e83a89915cc332be3b0d932c939cb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 07:31:30 +0200
Subject: [PATCH 2/9] meson: Add pam option
---
meson.build | 26 +++++++++++++++++++++++++-
meson_options.txt | 3 +++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 7958e8eb19..a07e25c732 100644
--- a/meson.build
+++ b/meson.build
@@ -525,6 +525,29 @@ endif
+###############################################################
+# Library: pam
+###############################################################
+
+pamopt = get_option('pam')
+if not pamopt.disabled()
+ pam = cc.find_library('pam', dirs: g_c_lib, required: pamopt)
+ if pam.found()
+ if cc.has_header('security/pam_appl.h', args: g_c_args, include_directories: g_c_inc)
+ cdata.set('HAVE_SECURITY_PAM_APPL_H', 1)
+ elif cc.has_header('pam/pam_appl.h', args: g_c_args, include_directories: g_c_inc)
+ cdata.set('HAVE_PAM_PAM_APPL_H', 1)
+ else
+ error('pam header not found')
+ endif
+ endif
+else
+ pam = dependency('', required: false)
+endif
+cdata.set('USE_PAM', pam.found() ? 1 : false)
+
+
+
###############################################################
# Library: Tcl (for pltcl)
# tclConfig.sh
@@ -2143,7 +2166,7 @@ backend_code = declare_dependency(
include_directories: [postgres_inc],
link_with: [],
sources: generated_headers + generated_backend_headers,
- dependencies: [os_deps, libintl, ssl, lz4, zlib, icu, icu_i18n, ldap, gssapi, libxml, zstd, systemd],
+ dependencies: [os_deps, libintl, ssl, lz4, zlib, icu, icu_i18n, ldap, pam, gssapi, libxml, zstd, systemd],
)
# Note there's intentionally no dependency on pgport/common here - we want the
@@ -2485,6 +2508,7 @@ if meson.version().version_compare('>=0.57')
'llvm': llvm,
'lz4': lz4,
'nls' : libintl,
+ 'pam' : pam,
'perl': perl_dep,
'python3': python3_dep,
'readline': readline,
diff --git a/meson_options.txt b/meson_options.txt
index e3e36678d1..f57410fa50 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -74,6 +74,9 @@ option('lz4', type : 'feature', value: 'auto',
option('nls', type: 'feature', value: 'auto',
description: 'national language support')
+option('pam', type : 'feature', value: 'auto',
+ description: 'PAM support')
+
option('plperl', type : 'feature', value: 'auto',
description: 'build Perl modules (PL/Perl)')
--
2.35.1
From 049b34b6a8dd949f0eb7987cad65f6682a6ec786 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:06:13 +0200
Subject: [PATCH 3/9] meson: prereq: Refactor dtrace postprocessing make rules
Move the dtrace postprocessing sed commands into a separate file so
that it can be shared by meson. Also split the rule into two for
proper dependency declaration.
---
src/backend/utils/Makefile | 21 +++++++--------------
src/backend/utils/postprocess_dtrace.sed | 15 +++++++++++++++
2 files changed, 22 insertions(+), 14 deletions(-)
create mode 100644 src/backend/utils/postprocess_dtrace.sed
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index b1820cd959..7bc58693f9 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -54,22 +54,15 @@ fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/ca
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
$(PERL) $(srcdir)/generate-errcodes.pl $< $@
-ifneq ($(enable_dtrace), yes)
-probes.h: Gen_dummy_probes.sed
-endif
-
-# We editorialize on dtrace's output to the extent of changing the macro
-# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
-# "char *" arguments to "const char *".
-probes.h: probes.d
ifeq ($(enable_dtrace), yes)
- $(DTRACE) -C -h -s $< -o [email protected]
- sed -e 's/POSTGRESQL_/TRACE_POSTGRESQL_/g' \
- -e 's/( *char \*/(const char */g' \
- -e 's/, *char \*/, const char */g' [email protected] >$@
- rm [email protected]
+probes.h: postprocess_dtrace.sed probes.h.tmp
+ sed -f $^ >$@
+
+probes.h.tmp: probes.d
+ $(DTRACE) -C -h -s $< -o $@
else
- sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
+probes.h: Gen_dummy_probes.sed probes.d
+ sed -f $^ >$@
endif
# These generated headers must be symlinked into builddir/src/include/,
diff --git a/src/backend/utils/postprocess_dtrace.sed b/src/backend/utils/postprocess_dtrace.sed
new file mode 100644
index 0000000000..a68c30c75e
--- /dev/null
+++ b/src/backend/utils/postprocess_dtrace.sed
@@ -0,0 +1,15 @@
+#-------------------------------------------------------------------------
+# sed script to postprocess dtrace output
+#
+# Copyright (c) 2008-2022, PostgreSQL Global Development Group
+#
+# src/backend/utils/postprocess_dtrace.sed
+#-------------------------------------------------------------------------
+
+# We editorialize on dtrace's output to the extent of changing the macro
+# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
+# "char *" arguments to "const char *".
+
+s/POSTGRESQL_/TRACE_POSTGRESQL_/g
+s/( *char \*/(const char */g
+s/, *char \*/, const char */g
--
2.35.1
From bf583cd5fdb7fecef8055dfa31ef2334cdd66fa6 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:06:39 +0200
Subject: [PATCH 4/9] meson: Add dtrace option
This currently only works on macOS. The dtrace -G calls needed on
other platforms are not implemented yet. Therefore, the option is not
auto by default.
---
meson.build | 1 +
meson_options.txt | 6 ++++++
src/include/utils/meson.build | 34 ++++++++++++++++++++++++++--------
3 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index a07e25c732..7cb2083936 100644
--- a/meson.build
+++ b/meson.build
@@ -162,6 +162,7 @@ program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
touch = find_program('touch', native: true)
sh = find_program('sh', native: true) # FIXME, should get rid of this
program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
+dtrace = find_program(get_option('DTRACE'), required: get_option('dtrace'))
# Internal programs
testwrap = find_program('src/tools/testwrap', native: true)
diff --git a/meson_options.txt b/meson_options.txt
index f57410fa50..56440f81d0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('extra_lib_dirs', type : 'array', value: [],
# External dependencies
+option('dtrace', type : 'feature', value: 'disabled',
+ description: 'DTrace support')
+
option('gssapi', type : 'feature', value: 'auto',
description: 'GSSAPI support')
@@ -116,6 +119,9 @@ option('zstd', type : 'feature', value: 'auto',
option('BISON', type : 'string', value: 'bison',
description: 'path to bison binary')
+option('DTRACE', type : 'string', value: 'dtrace',
+ description: 'path to dtrace binary')
+
option('FLEX', type : 'string', value: 'flex',
description: 'path to flex binary')
diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build
index 6e1437f300..152a235b5c 100644
--- a/src/include/utils/meson.build
+++ b/src/include/utils/meson.build
@@ -7,14 +7,32 @@ errcodes = custom_target('errcodes',
)
generated_headers += errcodes
-generated_backend_headers += custom_target('probes.d',
- input: files('../../backend/utils/probes.d'),
- output : 'probes.h',
- capture: true,
- command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
- install: true,
- install_dir: dir_include_server/'utils',
-)
+if dtrace.found()
+ probes_tmp = custom_target('probes.h.tmp',
+ input: files('../../backend/utils/probes.d'),
+ output : 'probes.h.tmp',
+ command : [dtrace, '-C', '-h', '-s', '@INPUT@', '-o', '@OUTPUT@'],
+ )
+ probes = custom_target('probes.h',
+ input: probes_tmp[0],
+ output : 'probes.h',
+ capture: true,
+ command : [sed, '-f', files('../../backend/utils/postprocess_dtrace.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
+ )
+else
+ probes = custom_target('probes.h',
+ input: files('../../backend/utils/probes.d'),
+ output : 'probes.h',
+ capture: true,
+ command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
+ )
+endif
+
+generated_backend_headers += probes
fmgrtab_target = custom_target('fmgrtab',
input: '../catalog/pg_proc.dat',
--
2.35.1
From c2599ec7f66c75c9c898fcf902dd3fc0209e42cb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:29:23 +0200
Subject: [PATCH 5/9] meson: Add bonjour option
---
meson.build | 13 +++++++++++++
meson_options.txt | 3 +++
2 files changed, 16 insertions(+)
diff --git a/meson.build b/meson.build
index 7cb2083936..e724fcc345 100644
--- a/meson.build
+++ b/meson.build
@@ -305,6 +305,19 @@ dir_data_extension = dir_data / 'extension'
+###############################################################
+# Library: bonjour
+###############################################################
+
+bonjouropt = get_option('bonjour')
+if not bonjouropt.disabled()
+ if cc.has_header('dns_sd.h', args: g_c_args, include_directories: g_c_inc, required: bonjouropt.enabled())
+ cdata.set('USE_BONJOUR', 1)
+ endif
+endif
+
+
+
###############################################################
# Library: GSSAPI
###############################################################
diff --git a/meson_options.txt b/meson_options.txt
index 56440f81d0..cbef629ca0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('extra_lib_dirs', type : 'array', value: [],
# External dependencies
+option('bonjour', type : 'feature', value: 'auto',
+ description: 'Bonjour support')
+
option('dtrace', type : 'feature', value: 'disabled',
description: 'DTrace support')
--
2.35.1
From 2845c3f08a7e8eba5a41f2e474ffbeb5d5eadea2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:37:28 +0200
Subject: [PATCH 6/9] meson: Add bsd-auth option
---
meson.build | 13 +++++++++++++
meson_options.txt | 3 +++
2 files changed, 16 insertions(+)
diff --git a/meson.build b/meson.build
index e724fcc345..7c9c6e7f23 100644
--- a/meson.build
+++ b/meson.build
@@ -318,6 +318,19 @@ endif
+###############################################################
+# Library: bsd-auth
+###############################################################
+
+bsdauthopt = get_option('bsd-auth')
+if not bsdauthopt.disabled()
+ if cc.has_header('bsd_auth.h', args: g_c_args, include_directories: g_c_inc, required: bsdauthopt.enabled())
+ cdata.set('USE_BSD_AUTH', 1)
+ endif
+endif
+
+
+
###############################################################
# Library: GSSAPI
###############################################################
diff --git a/meson_options.txt b/meson_options.txt
index cbef629ca0..892ef117ee 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,6 +53,9 @@ option('extra_lib_dirs', type : 'array', value: [],
option('bonjour', type : 'feature', value: 'auto',
description: 'Bonjour support')
+option('bsd-auth', type : 'feature', value: 'auto',
+ description: 'BSD Authentication support')
+
option('dtrace', type : 'feature', value: 'disabled',
description: 'DTrace support')
--
2.35.1
From fad02f1fb71ec8c64e47e5031726ffbee4a1dd84 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:53:01 +0200
Subject: [PATCH 7/9] meson: Add system-tzdata option
---
meson.build | 3 +++
meson_options.txt | 3 +++
2 files changed, 6 insertions(+)
diff --git a/meson.build b/meson.build
index 7c9c6e7f23..b33a51a35d 100644
--- a/meson.build
+++ b/meson.build
@@ -246,6 +246,9 @@ cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
+if get_option('system-tzdata') != ''
+ cdata.set_quoted('SYSTEMTZDIR', get_option('system-tzdata'))
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 892ef117ee..250d758ded 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -20,6 +20,9 @@ option('pgport', type : 'string', value : '5432',
description : '''Default port number for server and clients.
The default is 5432. The port can always be changed later on, but if you specify it here then both server and clients will have the same default compiled in, which can be very convenient. Usually the only good reason to select a non-default value is if you intend to run multiple PostgreSQL servers on the same machine.''')
+option('system-tzdata', type: 'string', value: '',
+ description: 'use system time zone data in specified directory')
+
# Developer options
--
2.35.1
From 7c5c35a5ceff42dcd64e7a78f63ce2cdfc46d856 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:57:18 +0200
Subject: [PATCH 8/9] meson: Add krb-srvnam option
---
meson.build | 2 +-
meson_options.txt | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index b33a51a35d..8a372282ff 100644
--- a/meson.build
+++ b/meson.build
@@ -245,7 +245,7 @@ cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
-cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
+cdata.set_quoted('PG_KRB_SRVNAM', get_option('krb-srvnam'))
if get_option('system-tzdata') != ''
cdata.set_quoted('SYSTEMTZDIR', get_option('system-tzdata'))
endif
diff --git a/meson_options.txt b/meson_options.txt
index 250d758ded..d4a7500306 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,6 +16,9 @@ Large tables are divided into multiple operating-system files, each of size equa
# Defaults
+option('krb-srvnam', type: 'string', value: 'postgres',
+ description: 'default service principal name in Kerberos (GSSAPI)')
+
option('pgport', type : 'string', value : '5432',
description : '''Default port number for server and clients.
The default is 5432. The port can always be changed later on, but if you specify it here then both server and clients will have the same default compiled in, which can be very convenient. Usually the only good reason to select a non-default value is if you intend to run multiple PostgreSQL servers on the same machine.''')
--
2.35.1
From 55e92f039526d9c6d01f0be1a4ad34e64d7e01b9 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 10:04:50 +0200
Subject: [PATCH 9/9] meson: Add extra-version option
---
meson.build | 1 +
meson_options.txt | 3 +++
2 files changed, 4 insertions(+)
diff --git a/meson.build b/meson.build
index 8a372282ff..a2680f5a1a 100644
--- a/meson.build
+++ b/meson.build
@@ -79,6 +79,7 @@ cdata.set_quoted('PACKAGE_NAME', 'PostgreSQL')
cdata.set_quoted('PACKAGE_BUGREPORT', '[email protected]')
cdata.set_quoted('PACKAGE_URL', pg_url)
+pg_version += get_option('extra-version')
cdata.set_quoted('PG_VERSION', pg_version)
cdata.set_quoted('PG_VERSION_STR', 'PostgreSQL @0@ on @1@, compiled by @2@-@3@'.format(
pg_version, target_machine.cpu_family(), cc.get_id(), cc.version()))
diff --git a/meson_options.txt b/meson_options.txt
index d4a7500306..3cc211b39d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,6 +16,9 @@ Large tables are divided into multiple operating-system files, each of size equa
# Defaults
+option('extra-version', type: 'string', value: '',
+ description: 'Append string to version.')
+
option('krb-srvnam', type: 'string', value: 'postgres',
description: 'default service principal name in Kerberos (GSSAPI)')
--
2.35.1
Attachments:
[text/plain] 0001-meson-Fix-Perl-include-dir-detection.patch (1.4K, ../../[email protected]/2-0001-meson-Fix-Perl-include-dir-detection.patch)
download | inline diff:
From fd05ad3f1582884aef2db162c2c7ba4897299078 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 11:08:07 +0200
Subject: [PATCH 1/9] meson: Fix Perl include dir detection
Only use -iwithsysroot if required. This aligns with the logic in
configure.ac.
---
meson.build | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 5f8165df9c..7958e8eb19 100644
--- a/meson.build
+++ b/meson.build
@@ -591,8 +591,6 @@ else
perl_inc_dir = '@0@/CORE'.format(archlibexp)
- perl_ccflags = []
-
if useshrplib != 'true'
perl_may_work = false
perl_msg = 'need a shared perl'
@@ -606,9 +604,13 @@ else
# et al seeing them. So we can't use include_directories(), as that checks
# file existence.
if perl_may_work
- perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
- if host_machine.system() == 'darwin'
- perl_ccflags += ['-iwithsysroot', perl_inc_dir]
+ # On most platforms, archlibexp is also where the Perl include files live ...
+ perl_ccflags = ['-I@0@'.format(perl_inc_dir)]
+ # ... but on newer macOS versions, we must use -iwithsysroot to look
+ # under sysroot
+ if not fs.is_file('@0@/perl.h'.format(perl_inc_dir)) and \
+ fs.is_file('@0@@1@/perl.h'.format(sysroot, perl_inc_dir))
+ perl_ccflags = ['-iwithsysroot', perl_inc_dir]
endif
endif
--
2.35.1
[text/plain] 0002-meson-Add-pam-option.patch (2.5K, ../../[email protected]/3-0002-meson-Add-pam-option.patch)
download | inline diff:
From 1429482c5d3e83a89915cc332be3b0d932c939cb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 07:31:30 +0200
Subject: [PATCH 2/9] meson: Add pam option
---
meson.build | 26 +++++++++++++++++++++++++-
meson_options.txt | 3 +++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 7958e8eb19..a07e25c732 100644
--- a/meson.build
+++ b/meson.build
@@ -525,6 +525,29 @@ endif
+###############################################################
+# Library: pam
+###############################################################
+
+pamopt = get_option('pam')
+if not pamopt.disabled()
+ pam = cc.find_library('pam', dirs: g_c_lib, required: pamopt)
+ if pam.found()
+ if cc.has_header('security/pam_appl.h', args: g_c_args, include_directories: g_c_inc)
+ cdata.set('HAVE_SECURITY_PAM_APPL_H', 1)
+ elif cc.has_header('pam/pam_appl.h', args: g_c_args, include_directories: g_c_inc)
+ cdata.set('HAVE_PAM_PAM_APPL_H', 1)
+ else
+ error('pam header not found')
+ endif
+ endif
+else
+ pam = dependency('', required: false)
+endif
+cdata.set('USE_PAM', pam.found() ? 1 : false)
+
+
+
###############################################################
# Library: Tcl (for pltcl)
# tclConfig.sh
@@ -2143,7 +2166,7 @@ backend_code = declare_dependency(
include_directories: [postgres_inc],
link_with: [],
sources: generated_headers + generated_backend_headers,
- dependencies: [os_deps, libintl, ssl, lz4, zlib, icu, icu_i18n, ldap, gssapi, libxml, zstd, systemd],
+ dependencies: [os_deps, libintl, ssl, lz4, zlib, icu, icu_i18n, ldap, pam, gssapi, libxml, zstd, systemd],
)
# Note there's intentionally no dependency on pgport/common here - we want the
@@ -2485,6 +2508,7 @@ if meson.version().version_compare('>=0.57')
'llvm': llvm,
'lz4': lz4,
'nls' : libintl,
+ 'pam' : pam,
'perl': perl_dep,
'python3': python3_dep,
'readline': readline,
diff --git a/meson_options.txt b/meson_options.txt
index e3e36678d1..f57410fa50 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -74,6 +74,9 @@ option('lz4', type : 'feature', value: 'auto',
option('nls', type: 'feature', value: 'auto',
description: 'national language support')
+option('pam', type : 'feature', value: 'auto',
+ description: 'PAM support')
+
option('plperl', type : 'feature', value: 'auto',
description: 'build Perl modules (PL/Perl)')
--
2.35.1
[text/plain] 0003-meson-prereq-Refactor-dtrace-postprocessing-make-rul.patch (2.6K, ../../[email protected]/4-0003-meson-prereq-Refactor-dtrace-postprocessing-make-rul.patch)
download | inline diff:
From 049b34b6a8dd949f0eb7987cad65f6682a6ec786 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:06:13 +0200
Subject: [PATCH 3/9] meson: prereq: Refactor dtrace postprocessing make rules
Move the dtrace postprocessing sed commands into a separate file so
that it can be shared by meson. Also split the rule into two for
proper dependency declaration.
---
src/backend/utils/Makefile | 21 +++++++--------------
src/backend/utils/postprocess_dtrace.sed | 15 +++++++++++++++
2 files changed, 22 insertions(+), 14 deletions(-)
create mode 100644 src/backend/utils/postprocess_dtrace.sed
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index b1820cd959..7bc58693f9 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -54,22 +54,15 @@ fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/ca
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
$(PERL) $(srcdir)/generate-errcodes.pl $< $@
-ifneq ($(enable_dtrace), yes)
-probes.h: Gen_dummy_probes.sed
-endif
-
-# We editorialize on dtrace's output to the extent of changing the macro
-# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
-# "char *" arguments to "const char *".
-probes.h: probes.d
ifeq ($(enable_dtrace), yes)
- $(DTRACE) -C -h -s $< -o [email protected]
- sed -e 's/POSTGRESQL_/TRACE_POSTGRESQL_/g' \
- -e 's/( *char \*/(const char */g' \
- -e 's/, *char \*/, const char */g' [email protected] >$@
- rm [email protected]
+probes.h: postprocess_dtrace.sed probes.h.tmp
+ sed -f $^ >$@
+
+probes.h.tmp: probes.d
+ $(DTRACE) -C -h -s $< -o $@
else
- sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
+probes.h: Gen_dummy_probes.sed probes.d
+ sed -f $^ >$@
endif
# These generated headers must be symlinked into builddir/src/include/,
diff --git a/src/backend/utils/postprocess_dtrace.sed b/src/backend/utils/postprocess_dtrace.sed
new file mode 100644
index 0000000000..a68c30c75e
--- /dev/null
+++ b/src/backend/utils/postprocess_dtrace.sed
@@ -0,0 +1,15 @@
+#-------------------------------------------------------------------------
+# sed script to postprocess dtrace output
+#
+# Copyright (c) 2008-2022, PostgreSQL Global Development Group
+#
+# src/backend/utils/postprocess_dtrace.sed
+#-------------------------------------------------------------------------
+
+# We editorialize on dtrace's output to the extent of changing the macro
+# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
+# "char *" arguments to "const char *".
+
+s/POSTGRESQL_/TRACE_POSTGRESQL_/g
+s/( *char \*/(const char */g
+s/, *char \*/, const char */g
--
2.35.1
[text/plain] 0004-meson-Add-dtrace-option.patch (3.3K, ../../[email protected]/5-0004-meson-Add-dtrace-option.patch)
download | inline diff:
From bf583cd5fdb7fecef8055dfa31ef2334cdd66fa6 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:06:39 +0200
Subject: [PATCH 4/9] meson: Add dtrace option
This currently only works on macOS. The dtrace -G calls needed on
other platforms are not implemented yet. Therefore, the option is not
auto by default.
---
meson.build | 1 +
meson_options.txt | 6 ++++++
src/include/utils/meson.build | 34 ++++++++++++++++++++++++++--------
3 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index a07e25c732..7cb2083936 100644
--- a/meson.build
+++ b/meson.build
@@ -162,6 +162,7 @@ program_lz4 = find_program(get_option('LZ4'), native: true, required: false)
touch = find_program('touch', native: true)
sh = find_program('sh', native: true) # FIXME, should get rid of this
program_zstd = find_program(get_option('ZSTD'), native: true, required: false)
+dtrace = find_program(get_option('DTRACE'), required: get_option('dtrace'))
# Internal programs
testwrap = find_program('src/tools/testwrap', native: true)
diff --git a/meson_options.txt b/meson_options.txt
index f57410fa50..56440f81d0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('extra_lib_dirs', type : 'array', value: [],
# External dependencies
+option('dtrace', type : 'feature', value: 'disabled',
+ description: 'DTrace support')
+
option('gssapi', type : 'feature', value: 'auto',
description: 'GSSAPI support')
@@ -116,6 +119,9 @@ option('zstd', type : 'feature', value: 'auto',
option('BISON', type : 'string', value: 'bison',
description: 'path to bison binary')
+option('DTRACE', type : 'string', value: 'dtrace',
+ description: 'path to dtrace binary')
+
option('FLEX', type : 'string', value: 'flex',
description: 'path to flex binary')
diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build
index 6e1437f300..152a235b5c 100644
--- a/src/include/utils/meson.build
+++ b/src/include/utils/meson.build
@@ -7,14 +7,32 @@ errcodes = custom_target('errcodes',
)
generated_headers += errcodes
-generated_backend_headers += custom_target('probes.d',
- input: files('../../backend/utils/probes.d'),
- output : 'probes.h',
- capture: true,
- command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
- install: true,
- install_dir: dir_include_server/'utils',
-)
+if dtrace.found()
+ probes_tmp = custom_target('probes.h.tmp',
+ input: files('../../backend/utils/probes.d'),
+ output : 'probes.h.tmp',
+ command : [dtrace, '-C', '-h', '-s', '@INPUT@', '-o', '@OUTPUT@'],
+ )
+ probes = custom_target('probes.h',
+ input: probes_tmp[0],
+ output : 'probes.h',
+ capture: true,
+ command : [sed, '-f', files('../../backend/utils/postprocess_dtrace.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
+ )
+else
+ probes = custom_target('probes.h',
+ input: files('../../backend/utils/probes.d'),
+ output : 'probes.h',
+ capture: true,
+ command : [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server/'utils',
+ )
+endif
+
+generated_backend_headers += probes
fmgrtab_target = custom_target('fmgrtab',
input: '../catalog/pg_proc.dat',
--
2.35.1
[text/plain] 0005-meson-Add-bonjour-option.patch (1.4K, ../../[email protected]/6-0005-meson-Add-bonjour-option.patch)
download | inline diff:
From c2599ec7f66c75c9c898fcf902dd3fc0209e42cb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:29:23 +0200
Subject: [PATCH 5/9] meson: Add bonjour option
---
meson.build | 13 +++++++++++++
meson_options.txt | 3 +++
2 files changed, 16 insertions(+)
diff --git a/meson.build b/meson.build
index 7cb2083936..e724fcc345 100644
--- a/meson.build
+++ b/meson.build
@@ -305,6 +305,19 @@ dir_data_extension = dir_data / 'extension'
+###############################################################
+# Library: bonjour
+###############################################################
+
+bonjouropt = get_option('bonjour')
+if not bonjouropt.disabled()
+ if cc.has_header('dns_sd.h', args: g_c_args, include_directories: g_c_inc, required: bonjouropt.enabled())
+ cdata.set('USE_BONJOUR', 1)
+ endif
+endif
+
+
+
###############################################################
# Library: GSSAPI
###############################################################
diff --git a/meson_options.txt b/meson_options.txt
index 56440f81d0..cbef629ca0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('extra_lib_dirs', type : 'array', value: [],
# External dependencies
+option('bonjour', type : 'feature', value: 'auto',
+ description: 'Bonjour support')
+
option('dtrace', type : 'feature', value: 'disabled',
description: 'DTrace support')
--
2.35.1
[text/plain] 0006-meson-Add-bsd-auth-option.patch (1.5K, ../../[email protected]/7-0006-meson-Add-bsd-auth-option.patch)
download | inline diff:
From 2845c3f08a7e8eba5a41f2e474ffbeb5d5eadea2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:37:28 +0200
Subject: [PATCH 6/9] meson: Add bsd-auth option
---
meson.build | 13 +++++++++++++
meson_options.txt | 3 +++
2 files changed, 16 insertions(+)
diff --git a/meson.build b/meson.build
index e724fcc345..7c9c6e7f23 100644
--- a/meson.build
+++ b/meson.build
@@ -318,6 +318,19 @@ endif
+###############################################################
+# Library: bsd-auth
+###############################################################
+
+bsdauthopt = get_option('bsd-auth')
+if not bsdauthopt.disabled()
+ if cc.has_header('bsd_auth.h', args: g_c_args, include_directories: g_c_inc, required: bsdauthopt.enabled())
+ cdata.set('USE_BSD_AUTH', 1)
+ endif
+endif
+
+
+
###############################################################
# Library: GSSAPI
###############################################################
diff --git a/meson_options.txt b/meson_options.txt
index cbef629ca0..892ef117ee 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,6 +53,9 @@ option('extra_lib_dirs', type : 'array', value: [],
option('bonjour', type : 'feature', value: 'auto',
description: 'Bonjour support')
+option('bsd-auth', type : 'feature', value: 'auto',
+ description: 'BSD Authentication support')
+
option('dtrace', type : 'feature', value: 'disabled',
description: 'DTrace support')
--
2.35.1
[text/plain] 0007-meson-Add-system-tzdata-option.patch (1.5K, ../../[email protected]/8-0007-meson-Add-system-tzdata-option.patch)
download | inline diff:
From fad02f1fb71ec8c64e47e5031726ffbee4a1dd84 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:53:01 +0200
Subject: [PATCH 7/9] meson: Add system-tzdata option
---
meson.build | 3 +++
meson_options.txt | 3 +++
2 files changed, 6 insertions(+)
diff --git a/meson.build b/meson.build
index 7c9c6e7f23..b33a51a35d 100644
--- a/meson.build
+++ b/meson.build
@@ -246,6 +246,9 @@ cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
+if get_option('system-tzdata') != ''
+ cdata.set_quoted('SYSTEMTZDIR', get_option('system-tzdata'))
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 892ef117ee..250d758ded 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -20,6 +20,9 @@ option('pgport', type : 'string', value : '5432',
description : '''Default port number for server and clients.
The default is 5432. The port can always be changed later on, but if you specify it here then both server and clients will have the same default compiled in, which can be very convenient. Usually the only good reason to select a non-default value is if you intend to run multiple PostgreSQL servers on the same machine.''')
+option('system-tzdata', type: 'string', value: '',
+ description: 'use system time zone data in specified directory')
+
# Developer options
--
2.35.1
[text/plain] 0008-meson-Add-krb-srvnam-option.patch (1.7K, ../../[email protected]/9-0008-meson-Add-krb-srvnam-option.patch)
download | inline diff:
From 7c5c35a5ceff42dcd64e7a78f63ce2cdfc46d856 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 09:57:18 +0200
Subject: [PATCH 8/9] meson: Add krb-srvnam option
---
meson.build | 2 +-
meson_options.txt | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index b33a51a35d..8a372282ff 100644
--- a/meson.build
+++ b/meson.build
@@ -245,7 +245,7 @@ cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
cdata.set('DEF_PGPORT', get_option('pgport'))
cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
-cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
+cdata.set_quoted('PG_KRB_SRVNAM', get_option('krb-srvnam'))
if get_option('system-tzdata') != ''
cdata.set_quoted('SYSTEMTZDIR', get_option('system-tzdata'))
endif
diff --git a/meson_options.txt b/meson_options.txt
index 250d758ded..d4a7500306 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,6 +16,9 @@ Large tables are divided into multiple operating-system files, each of size equa
# Defaults
+option('krb-srvnam', type: 'string', value: 'postgres',
+ description: 'default service principal name in Kerberos (GSSAPI)')
+
option('pgport', type : 'string', value : '5432',
description : '''Default port number for server and clients.
The default is 5432. The port can always be changed later on, but if you specify it here then both server and clients will have the same default compiled in, which can be very convenient. Usually the only good reason to select a non-default value is if you intend to run multiple PostgreSQL servers on the same machine.''')
--
2.35.1
[text/plain] 0009-meson-Add-extra-version-option.patch (1.3K, ../../[email protected]/10-0009-meson-Add-extra-version-option.patch)
download | inline diff:
From 55e92f039526d9c6d01f0be1a4ad34e64d7e01b9 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 11 May 2022 10:04:50 +0200
Subject: [PATCH 9/9] meson: Add extra-version option
---
meson.build | 1 +
meson_options.txt | 3 +++
2 files changed, 4 insertions(+)
diff --git a/meson.build b/meson.build
index 8a372282ff..a2680f5a1a 100644
--- a/meson.build
+++ b/meson.build
@@ -79,6 +79,7 @@ cdata.set_quoted('PACKAGE_NAME', 'PostgreSQL')
cdata.set_quoted('PACKAGE_BUGREPORT', '[email protected]')
cdata.set_quoted('PACKAGE_URL', pg_url)
+pg_version += get_option('extra-version')
cdata.set_quoted('PG_VERSION', pg_version)
cdata.set_quoted('PG_VERSION_STR', 'PostgreSQL @0@ on @1@, compiled by @2@-@3@'.format(
pg_version, target_machine.cpu_family(), cc.get_id(), cc.version()))
diff --git a/meson_options.txt b/meson_options.txt
index d4a7500306..3cc211b39d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,6 +16,9 @@ Large tables are divided into multiple operating-system files, each of size equa
# Defaults
+option('extra-version', type: 'string', value: '',
+ description: 'Append string to version.')
+
option('krb-srvnam', type: 'string', value: 'postgres',
description: 'default service principal name in Kerberos (GSSAPI)')
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-12 19:30 ` Andres Freund <[email protected]>
2022-05-16 15:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
3 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-05-12 19:30 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
> I fixed the Perl detection issue in my macOS environment that I had reported
> a while ago.
Hm. I wonder if it's right to check with is_file() - perhaps there are
platforms that have split off the include directory?
> Then I added in support for all configure options that had not been ported
> over yet. Some of these are rather trivial.
Thanks!
Some of these (extra version, krb srvname, ...) I just merged from a
colleague.
Will look at merging the others.
> After that, these configure options don't have an equivalent yet:
>
> --disable-rpath
> --enable-profiling
> --disable-thread-safety
> --with-libedit-preferred
>
> The first three overlap with meson built-in functionality, so we would need
> to check whether the desired functionality is available somehow.
Which builtin functionality does --enable-profiling overlap with? There's a
coverage option, perhaps you were thinking of that?
I don't think we should add --disable-thread-safety, platforms without it also
aren't going to support ninja / meson... IIRC Thomas was planning to submit a
patch getting rid of it independently...
> The last one we probably want to keep somehow; it would need a bit of fiddly
> work.
A colleague just finished that bit. Probably can be improved further, but it
works now...
> From 049b34b6a8dd949f0eb7987cad65f6682a6ec786 Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <[email protected]>
> Date: Wed, 11 May 2022 09:06:13 +0200
> Subject: [PATCH 3/9] meson: prereq: Refactor dtrace postprocessing make rules
>
> Move the dtrace postprocessing sed commands into a separate file so
> that it can be shared by meson. Also split the rule into two for
> proper dependency declaration.
Hm. Using sed may be problematic on windows...
> From fad02f1fb71ec8c64e47e5031726ffbee4a1dd84 Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <[email protected]>
> Date: Wed, 11 May 2022 09:53:01 +0200
> Subject: [PATCH 7/9] meson: Add system-tzdata option
>
> ---
> meson.build | 3 +++
> meson_options.txt | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/meson.build b/meson.build
> index 7c9c6e7f23..b33a51a35d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -246,6 +246,9 @@ cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
> cdata.set('DEF_PGPORT', get_option('pgport'))
> cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport'))
> cdata.set_quoted('PG_KRB_SRVNAM', 'postgres')
> +if get_option('system-tzdata') != ''
> + cdata.set_quoted('SYSTEMTZDIR', get_option('system-tzdata'))
> +endif
This doesn't quite seem sufficient - we also need to prevent building &
installing our own timezone data...
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-12 19:30 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-16 15:47 ` Peter Eisentraut <[email protected]>
2022-05-16 16:15 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-16 15:47 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 12.05.22 21:30, Andres Freund wrote:
> On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
>> I fixed the Perl detection issue in my macOS environment that I had reported
>> a while ago.
>
> Hm. I wonder if it's right to check with is_file() - perhaps there are
> platforms that have split off the include directory?
The existing code uses "test -f", so using is_file() would keep it
working the same way.
>> After that, these configure options don't have an equivalent yet:
>>
>> --disable-rpath
>> --enable-profiling
>> --disable-thread-safety
>> --with-libedit-preferred
>>
>> The first three overlap with meson built-in functionality, so we would need
>> to check whether the desired functionality is available somehow.
>
> Which builtin functionality does --enable-profiling overlap with? There's a
> coverage option, perhaps you were thinking of that?
I saw an option about "profile guided optimization" (b_pgo), which seems
possibly related.
> I don't think we should add --disable-thread-safety, platforms without it also
> aren't going to support ninja / meson... IIRC Thomas was planning to submit a
> patch getting rid of it independently...
sure
>> From 049b34b6a8dd949f0eb7987cad65f6682a6ec786 Mon Sep 17 00:00:00 2001
>> From: Peter Eisentraut <[email protected]>
>> Date: Wed, 11 May 2022 09:06:13 +0200
>> Subject: [PATCH 3/9] meson: prereq: Refactor dtrace postprocessing make rules
>>
>> Move the dtrace postprocessing sed commands into a separate file so
>> that it can be shared by meson. Also split the rule into two for
>> proper dependency declaration.
>
> Hm. Using sed may be problematic on windows...
This code is only used when dtrace is enabled, which probably doesn't
apply on Windows.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-12 19:30 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-16 15:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-16 16:15 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-05-16 16:15 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-16 17:47:24 +0200, Peter Eisentraut wrote:
> On 12.05.22 21:30, Andres Freund wrote:
> > On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
> > > I fixed the Perl detection issue in my macOS environment that I had reported
> > > a while ago.
> >
> > Hm. I wonder if it's right to check with is_file() - perhaps there are
> > platforms that have split off the include directory?
>
> The existing code uses "test -f", so using is_file() would keep it working
> the same way.
I merged it that way. Merged.
> > > From 049b34b6a8dd949f0eb7987cad65f6682a6ec786 Mon Sep 17 00:00:00 2001
> > > From: Peter Eisentraut <[email protected]>
> > > Date: Wed, 11 May 2022 09:06:13 +0200
> > > Subject: [PATCH 3/9] meson: prereq: Refactor dtrace postprocessing make rules
> > >
> > > Move the dtrace postprocessing sed commands into a separate file so
> > > that it can be shared by meson. Also split the rule into two for
> > > proper dependency declaration.
> >
> > Hm. Using sed may be problematic on windows...
>
> This code is only used when dtrace is enabled, which probably doesn't apply
> on Windows.
Fair point. Merged.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-13 23:17 ` Andres Freund <[email protected]>
2022-05-16 15:48 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
3 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-05-13 23:17 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
> This currently only works on macOS. The dtrace -G calls needed on
> other platforms are not implemented yet.
I looked into that part. The make rule passes all the backend object files as
an option, but it's not clear to me where / why that's needed. On linux it
certainly works to not pass in the object files...
Maybe CI will show problems on freebsd or such...
> Therefore, the option is not auto by default.
It probably shouldn't be auto either way, there's some overhead associated
with the probes...
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-13 23:17 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-16 15:48 ` Peter Eisentraut <[email protected]>
2022-05-16 16:13 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-16 15:48 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 14.05.22 01:17, Andres Freund wrote:
> On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
>> This currently only works on macOS. The dtrace -G calls needed on
>> other platforms are not implemented yet.
>
> I looked into that part. The make rule passes all the backend object files as
> an option, but it's not clear to me where / why that's needed. On linux it
> certainly works to not pass in the object files...
>
> Maybe CI will show problems on freebsd or such...
Yes, it failed for me on freebsd.
>> Therefore, the option is not auto by default.
>
> It probably shouldn't be auto either way, there's some overhead associated
> with the probes...
ok
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-13 23:17 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-16 15:48 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-16 16:13 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-05-16 16:13 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
On 2022-05-16 17:48:08 +0200, Peter Eisentraut wrote:
> On 14.05.22 01:17, Andres Freund wrote:
> > On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote:
> > > This currently only works on macOS. The dtrace -G calls needed on
> > > other platforms are not implemented yet.
> >
> > I looked into that part. The make rule passes all the backend object files as
> > an option, but it's not clear to me where / why that's needed. On linux it
> > certainly works to not pass in the object files...
> >
> > Maybe CI will show problems on freebsd or such...
>
> Yes, it failed for me on freebsd.
Yep, I saw those shortly after... I've implemented that bit now, although it
needs a bit more cleanup.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-18 08:30 ` Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
3 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-18 08:30 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
Here are some more patches that clean up various minor issues.
From bc06fda7198d182dce73f39cfff8e4724e00b12d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 14:38:02 +0200
Subject: [PATCH 1/7] meson: Put genbki header files back into original order
The order affects the output order in postgres.bki and other files.
This makes it match the order in the makefiles.
---
src/include/catalog/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
index b2acc3ce30..813a963493 100644
--- a/src/include/catalog/meson.build
+++ b/src/include/catalog/meson.build
@@ -30,7 +30,6 @@ catalog_headers = [
'pg_conversion.h',
'pg_depend.h',
'pg_database.h',
- 'pg_parameter_acl.h',
'pg_db_role_setting.h',
'pg_tablespace.h',
'pg_authid.h',
@@ -54,6 +53,7 @@ catalog_headers = [
'pg_seclabel.h',
'pg_shseclabel.h',
'pg_collation.h',
+ 'pg_parameter_acl.h',
'pg_partitioned_table.h',
'pg_range.h',
'pg_transform.h',
--
2.35.1
From b4ffaa02f1eb132b011871415c94b84e84fd5245 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:22:22 +0200
Subject: [PATCH 2/7] meson: Some capitalization adjustments in setup output
This makes the style more uniform with what meson produces by itself.
---
meson.build | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 7b1c8d47c4..3acae5c3e4 100644
--- a/meson.build
+++ b/meson.build
@@ -2583,10 +2583,10 @@ alias_target('backend', backend_targets)
if meson.version().version_compare('>=0.57')
summary({
- 'Data Block Size' : cdata.get('BLCKSZ'),
- 'WAL Block Size' : cdata.get('XLOG_BLCKSZ'),
- 'Segment Size' : cdata.get('RELSEG_SIZE')
- }, section: 'Data Layout'
+ 'data block size' : cdata.get('BLCKSZ'),
+ 'WAL block size' : cdata.get('XLOG_BLCKSZ'),
+ 'segment size' : cdata.get('RELSEG_SIZE')
+ }, section: 'Data layout'
)
summary(
@@ -2644,7 +2644,7 @@ if meson.version().version_compare('>=0.57')
'zlib': zlib,
'zstd': zstd,
},
- section: 'External Libraries'
+ section: 'External libraries'
)
endif
--
2.35.1
From 23a7e7ffb4db7554b2029ba3026d93f8e32b801f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:47:47 +0200
Subject: [PATCH 3/7] meson: Formatting tweaks for pg_config.h to match
autoheader better
---
meson.build | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/meson.build b/meson.build
index 3acae5c3e4..20dea263a2 100644
--- a/meson.build
+++ b/meson.build
@@ -227,19 +227,14 @@ meson_bin = find_program(meson_binpath, native: true)
cdata.set('USE_ASSERT_CHECKING', get_option('cassert') ? 1 : false)
-cdata.set('BLCKSZ', 8192, description: '''
- Size of a disk block --- this also limits the size of a tuple. You
- can set it bigger if you need bigger tuples (although TOAST should
- reduce the need to have large tuples, since fields can be spread
- across multiple tuples).
-
- BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ
- is currently 2^15 (32768). This is determined by the 15-bit widths
- of the lp_off and lp_len fields in ItemIdData (see
- include/storage/itemid.h).
-
- Changing BLCKSZ requires an initdb.
-''')
+cdata.set('BLCKSZ', 8192, description:
+'''Size of a disk block --- this also limits the size of a tuple. You can set
+ it bigger if you need bigger tuples (although TOAST should reduce the need
+ to have large tuples, since fields can be spread across multiple tuples).
+ BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ is
+ currently 2^15 (32768). This is determined by the 15-bit widths of the
+ lp_off and lp_len fields in ItemIdData (see include/storage/itemid.h).
+ Changing BLCKSZ requires an initdb.''')
cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
@@ -1000,7 +995,8 @@ if get_option('ssl') == 'openssl'
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', 0x10001000,
- description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
+ description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings
+ from newer OpenSSL versions.''')
else
ssl = dependency('', required : false)
endif
@@ -1639,7 +1635,7 @@ foreach c : decl_checks
kwargs: args)
cdata.set10(varname, found, description:
'''Define to 1 if you have the declaration of `@0@', and to 0 if you
- don't.'''.format(func))
+ don't.'''.format(func))
endforeach
--
2.35.1
From 1d2f4c3d7eb32a01e3ea75816f9ec09add6500db Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:48:43 +0200
Subject: [PATCH 4/7] meson: Remove checks for random and srandom
Removed by 3804539e48e794781c6145c7f988f5d507418fa8.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index 20dea263a2..e6dfb63981 100644
--- a/meson.build
+++ b/meson.build
@@ -1906,7 +1906,6 @@ func_checks = [
['pstat'],
['pthread_is_threaded_np', {'dependencies': [thread_dep]}],
['pwrite'],
- ['random'],
['readlink'],
['readv'],
['setenv'], # FIXME: windows handling
@@ -1915,7 +1914,6 @@ func_checks = [
['setsid'],
['shm_open', {'dependencies': [rt_dep]}],
['shm_unlink', {'dependencies': [rt_dep]}],
- ['srandom'],
['strchrnul'],
['strerror_r', {'dependencies': [thread_dep]}],
['strlcat'],
--
2.35.1
From b831c6caef6b240bb9074018d6e4788f34b82edf Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:49:23 +0200
Subject: [PATCH 5/7] meson: Fix symbol for __builtin_frame_address check
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e6dfb63981..6954fffc5c 100644
--- a/meson.build
+++ b/meson.build
@@ -1270,7 +1270,7 @@ if cc.has_function('__builtin_constant_p', args: g_c_args)
endif
if cc.has_function('__builtin_frame_address', args: g_c_args)
- cdata.set('HAVE__FRAME_ADDRESS', 1)
+ cdata.set('HAVE__BUILTIN_FRAME_ADDRESS', 1)
endif
--
2.35.1
From b2b65de167610bfb12e7366acf36a7fcf1da7ed0 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:49:38 +0200
Subject: [PATCH 6/7] meson: Remove check for strsignal declaration
This appears to be unnecessary and not in configure.
---
meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/meson.build b/meson.build
index 6954fffc5c..e7fd8aa64f 100644
--- a/meson.build
+++ b/meson.build
@@ -1612,7 +1612,6 @@ decl_checks = [
['strlcat', 'string.h'],
['strlcpy', 'string.h'],
['strnlen', 'string.h'],
- ['strsignal', 'string.h'],
['strtoll', 'stdlib.h'], ['strtoull', 'stdlib.h'], # strto[u]ll may exist but not be declared
]
--
2.35.1
From aff3d38c793914c0098a3c25b0e583d96dd3b21f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 10:09:31 +0200
Subject: [PATCH 7/7] meson: Fix extra_version option
With the previous coding, the extra version did not appear in
PG_VERSION_STR.
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e7fd8aa64f..b772afef32 100644
--- a/meson.build
+++ b/meson.build
@@ -79,7 +79,8 @@ cdata.set_quoted('PACKAGE_NAME', 'PostgreSQL')
cdata.set_quoted('PACKAGE_BUGREPORT', '[email protected]')
cdata.set_quoted('PACKAGE_URL', pg_url)
-cdata.set_quoted('PG_VERSION', pg_version + get_option('extra_version'))
+pg_version += get_option('extra_version')
+cdata.set_quoted('PG_VERSION', pg_version)
cdata.set_quoted('PG_VERSION_STR', 'PostgreSQL @0@ on @1@, compiled by @2@-@3@'.format(
pg_version, target_machine.cpu_family(), cc.get_id(), cc.version()))
cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
--
2.35.1
Attachments:
[text/plain] 0001-meson-Put-genbki-header-files-back-into-original-ord.patch (1.0K, ../../[email protected]/2-0001-meson-Put-genbki-header-files-back-into-original-ord.patch)
download | inline diff:
From bc06fda7198d182dce73f39cfff8e4724e00b12d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 May 2022 14:38:02 +0200
Subject: [PATCH 1/7] meson: Put genbki header files back into original order
The order affects the output order in postgres.bki and other files.
This makes it match the order in the makefiles.
---
src/include/catalog/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
index b2acc3ce30..813a963493 100644
--- a/src/include/catalog/meson.build
+++ b/src/include/catalog/meson.build
@@ -30,7 +30,6 @@ catalog_headers = [
'pg_conversion.h',
'pg_depend.h',
'pg_database.h',
- 'pg_parameter_acl.h',
'pg_db_role_setting.h',
'pg_tablespace.h',
'pg_authid.h',
@@ -54,6 +53,7 @@ catalog_headers = [
'pg_seclabel.h',
'pg_shseclabel.h',
'pg_collation.h',
+ 'pg_parameter_acl.h',
'pg_partitioned_table.h',
'pg_range.h',
'pg_transform.h',
--
2.35.1
[text/plain] 0002-meson-Some-capitalization-adjustments-in-setup-outpu.patch (1.2K, ../../[email protected]/3-0002-meson-Some-capitalization-adjustments-in-setup-outpu.patch)
download | inline diff:
From b4ffaa02f1eb132b011871415c94b84e84fd5245 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:22:22 +0200
Subject: [PATCH 2/7] meson: Some capitalization adjustments in setup output
This makes the style more uniform with what meson produces by itself.
---
meson.build | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 7b1c8d47c4..3acae5c3e4 100644
--- a/meson.build
+++ b/meson.build
@@ -2583,10 +2583,10 @@ alias_target('backend', backend_targets)
if meson.version().version_compare('>=0.57')
summary({
- 'Data Block Size' : cdata.get('BLCKSZ'),
- 'WAL Block Size' : cdata.get('XLOG_BLCKSZ'),
- 'Segment Size' : cdata.get('RELSEG_SIZE')
- }, section: 'Data Layout'
+ 'data block size' : cdata.get('BLCKSZ'),
+ 'WAL block size' : cdata.get('XLOG_BLCKSZ'),
+ 'segment size' : cdata.get('RELSEG_SIZE')
+ }, section: 'Data layout'
)
summary(
@@ -2644,7 +2644,7 @@ if meson.version().version_compare('>=0.57')
'zlib': zlib,
'zstd': zstd,
},
- section: 'External Libraries'
+ section: 'External libraries'
)
endif
--
2.35.1
[text/plain] 0003-meson-Formatting-tweaks-for-pg_config.h-to-match-aut.patch (2.5K, ../../[email protected]/4-0003-meson-Formatting-tweaks-for-pg_config.h-to-match-aut.patch)
download | inline diff:
From 23a7e7ffb4db7554b2029ba3026d93f8e32b801f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:47:47 +0200
Subject: [PATCH 3/7] meson: Formatting tweaks for pg_config.h to match
autoheader better
---
meson.build | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/meson.build b/meson.build
index 3acae5c3e4..20dea263a2 100644
--- a/meson.build
+++ b/meson.build
@@ -227,19 +227,14 @@ meson_bin = find_program(meson_binpath, native: true)
cdata.set('USE_ASSERT_CHECKING', get_option('cassert') ? 1 : false)
-cdata.set('BLCKSZ', 8192, description: '''
- Size of a disk block --- this also limits the size of a tuple. You
- can set it bigger if you need bigger tuples (although TOAST should
- reduce the need to have large tuples, since fields can be spread
- across multiple tuples).
-
- BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ
- is currently 2^15 (32768). This is determined by the 15-bit widths
- of the lp_off and lp_len fields in ItemIdData (see
- include/storage/itemid.h).
-
- Changing BLCKSZ requires an initdb.
-''')
+cdata.set('BLCKSZ', 8192, description:
+'''Size of a disk block --- this also limits the size of a tuple. You can set
+ it bigger if you need bigger tuples (although TOAST should reduce the need
+ to have large tuples, since fields can be spread across multiple tuples).
+ BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ is
+ currently 2^15 (32768). This is determined by the 15-bit widths of the
+ lp_off and lp_len fields in ItemIdData (see include/storage/itemid.h).
+ Changing BLCKSZ requires an initdb.''')
cdata.set('XLOG_BLCKSZ', get_option('wal-blocksize') * 1024)
cdata.set('RELSEG_SIZE', get_option('segsize') * 131072)
@@ -1000,7 +995,8 @@ if get_option('ssl') == 'openssl'
description: 'Define to 1 to build with OpenSSL support. (-Dssl=openssl)')
cdata.set('OPENSSL_API_COMPAT', 0x10001000,
- description: 'Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.')
+ description: '''Define to the OpenSSL API version in use. This avoids deprecation warnings
+ from newer OpenSSL versions.''')
else
ssl = dependency('', required : false)
endif
@@ -1639,7 +1635,7 @@ foreach c : decl_checks
kwargs: args)
cdata.set10(varname, found, description:
'''Define to 1 if you have the declaration of `@0@', and to 0 if you
- don't.'''.format(func))
+ don't.'''.format(func))
endforeach
--
2.35.1
[text/plain] 0004-meson-Remove-checks-for-random-and-srandom.patch (917B, ../../[email protected]/5-0004-meson-Remove-checks-for-random-and-srandom.patch)
download | inline diff:
From 1d2f4c3d7eb32a01e3ea75816f9ec09add6500db Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:48:43 +0200
Subject: [PATCH 4/7] meson: Remove checks for random and srandom
Removed by 3804539e48e794781c6145c7f988f5d507418fa8.
---
meson.build | 2 --
1 file changed, 2 deletions(-)
diff --git a/meson.build b/meson.build
index 20dea263a2..e6dfb63981 100644
--- a/meson.build
+++ b/meson.build
@@ -1906,7 +1906,6 @@ func_checks = [
['pstat'],
['pthread_is_threaded_np', {'dependencies': [thread_dep]}],
['pwrite'],
- ['random'],
['readlink'],
['readv'],
['setenv'], # FIXME: windows handling
@@ -1915,7 +1914,6 @@ func_checks = [
['setsid'],
['shm_open', {'dependencies': [rt_dep]}],
['shm_unlink', {'dependencies': [rt_dep]}],
- ['srandom'],
['strchrnul'],
['strerror_r', {'dependencies': [thread_dep]}],
['strlcat'],
--
2.35.1
[text/plain] 0005-meson-Fix-symbol-for-__builtin_frame_address-check.patch (674B, ../../[email protected]/6-0005-meson-Fix-symbol-for-__builtin_frame_address-check.patch)
download | inline diff:
From b831c6caef6b240bb9074018d6e4788f34b82edf Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:49:23 +0200
Subject: [PATCH 5/7] meson: Fix symbol for __builtin_frame_address check
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e6dfb63981..6954fffc5c 100644
--- a/meson.build
+++ b/meson.build
@@ -1270,7 +1270,7 @@ if cc.has_function('__builtin_constant_p', args: g_c_args)
endif
if cc.has_function('__builtin_frame_address', args: g_c_args)
- cdata.set('HAVE__FRAME_ADDRESS', 1)
+ cdata.set('HAVE__BUILTIN_FRAME_ADDRESS', 1)
endif
--
2.35.1
[text/plain] 0006-meson-Remove-check-for-strsignal-declaration.patch (708B, ../../[email protected]/7-0006-meson-Remove-check-for-strsignal-declaration.patch)
download | inline diff:
From b2b65de167610bfb12e7366acf36a7fcf1da7ed0 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 09:49:38 +0200
Subject: [PATCH 6/7] meson: Remove check for strsignal declaration
This appears to be unnecessary and not in configure.
---
meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/meson.build b/meson.build
index 6954fffc5c..e7fd8aa64f 100644
--- a/meson.build
+++ b/meson.build
@@ -1612,7 +1612,6 @@ decl_checks = [
['strlcat', 'string.h'],
['strlcpy', 'string.h'],
['strnlen', 'string.h'],
- ['strsignal', 'string.h'],
['strtoll', 'stdlib.h'], ['strtoull', 'stdlib.h'], # strto[u]ll may exist but not be declared
]
--
2.35.1
[text/plain] 0007-meson-Fix-extra_version-option.patch (1.0K, ../../[email protected]/8-0007-meson-Fix-extra_version-option.patch)
download | inline diff:
From aff3d38c793914c0098a3c25b0e583d96dd3b21f Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 18 May 2022 10:09:31 +0200
Subject: [PATCH 7/7] meson: Fix extra_version option
With the previous coding, the extra version did not appear in
PG_VERSION_STR.
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e7fd8aa64f..b772afef32 100644
--- a/meson.build
+++ b/meson.build
@@ -79,7 +79,8 @@ cdata.set_quoted('PACKAGE_NAME', 'PostgreSQL')
cdata.set_quoted('PACKAGE_BUGREPORT', '[email protected]')
cdata.set_quoted('PACKAGE_URL', pg_url)
-cdata.set_quoted('PG_VERSION', pg_version + get_option('extra_version'))
+pg_version += get_option('extra_version')
+cdata.set_quoted('PG_VERSION', pg_version)
cdata.set_quoted('PG_VERSION_STR', 'PostgreSQL @0@ on @1@, compiled by @2@-@3@'.format(
pg_version, target_machine.cpu_family(), cc.get_id(), cc.version()))
cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-05-18 19:48 ` Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-05-18 19:48 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-05-18 10:30:12 +0200, Peter Eisentraut wrote:
> Here are some more patches that clean up various minor issues.
I rebased the meson tree, squashed a lot of the existing commits, merged your
changes, and fixed a few more differences between autoconf and meson.
For me the difference in defines now boils down to:
- CONFIGURE_ARGS - empty in meson, not clear what to fill it with
- GETTIMEOFDAY_1ARG - test doesn't exist - I suspect it might not be necessary
- PACKAGE_STRING, PACKAGE_TARNAME - unclear if they should be implemented?
- AC_APPLE_UNIVERSAL_BUILD logic - which I don't think we need?
- pg_restrict is defined in a simplistic way
- "missing" a bunch of defines that don't appear to be referenced:
HAVE_FSEEKO
HAVE_GSSAPI_GSSAPI_H
HAVE_INTTYPES_H
HAVE_LDAP_H
HAVE_LIBCRYPTO
HAVE_LIBLDAP
HAVE_LIBM
HAVE_LIBPAM
HAVE_LIBSSL
HAVE_LIBXML2
HAVE_LIBXSLT
HAVE_MEMORY_H
HAVE_PTHREAD
HAVE_PTHREAD_PRIO_INHERIT
HAVE_STDINT_H
HAVE_STDLIB_H
HAVE_STRING_H
HAVE_SYS_STAT_H
HAVE_SYS_TYPES_H
HAVE_UNISTD_H
SIZEOF_BOOL
SIZEOF_OFF_T
STDC_HEADERS
- meson additional defines, seems harmless:
HAVE_GETTIMEOFDAY - only defined on windows rn
HAVE_SHM_UNLINK
HAVE_SSL_NEW
HAVE_STRTOQ
HAVE_STRTOUQ
HAVE_CRYPTO_NEW_EX_DATA
- a bunch of additional #undef's
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-05-24 18:08 ` Peter Eisentraut <[email protected]>
2022-06-06 07:54 ` Re: [RFC] building postgres with meson -v8 Michael Paquier <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 2 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-05-24 18:08 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 18.05.22 21:48, Andres Freund wrote:
> - CONFIGURE_ARGS - empty in meson, not clear what to fill it with
Ok to leave empty for now.
> - GETTIMEOFDAY_1ARG - test doesn't exist - I suspect it might not be necessary
Might be obsolete, consider removing.
> - PACKAGE_STRING, PACKAGE_TARNAME - unclear if they should be implemented?
leave out for now
> - AC_APPLE_UNIVERSAL_BUILD logic - which I don't think we need?
no
> - "missing" a bunch of defines that don't appear to be referenced:
Yeah, looks like these are implicitly defined by some autoconf check but
then the result is only used within configure.ac itself, so isn't needed
afterwards.
> - meson additional defines, seems harmless:
> HAVE_GETTIMEOFDAY - only defined on windows rn
> HAVE_SHM_UNLINK
> HAVE_SSL_NEW
> HAVE_STRTOQ
> HAVE_STRTOUQ
> HAVE_CRYPTO_NEW_EX_DATA
Yeah, that's the opposite of the previous.
I don't see any other issues in pg_config.h either. Obviously, some
niche platforms might uncover some issues, but it looks good for now.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-06 07:54 ` Michael Paquier <[email protected]>
1 sibling, 0 replies; 44+ messages in thread
From: Michael Paquier @ 2022-06-06 07:54 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Andres Freund <[email protected]>; pgsql-hackers
On Tue, May 24, 2022 at 08:08:26PM +0200, Peter Eisentraut wrote:
> On 18.05.22 21:48, Andres Freund wrote:
>> - GETTIMEOFDAY_1ARG - test doesn't exist - I suspect it might not be necessary
>
> Might be obsolete, consider removing.
I just came across this one independently of what you are doing for
meson, and based on a lookup of the buildfarm, I think that it can be
removed. One reference about GETTIMEOFDAY_1ARG on the -hackers list
comes from here, from 20 years ago:
https://www.postgresql.org/message-id/[email protected]
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
download
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-08 06:27 ` Peter Eisentraut <[email protected]>
2022-06-08 12:33 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-14 18:23 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
1 sibling, 2 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-06-08 06:27 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
I looked at some of the "prereq" patches again to see what state they
are in:
commit 351a12f48e395b31cce4aca239b934174b36ea9d
Author: Andres Freund <[email protected]>
Date: Wed Apr 20 22:46:54 2022
prereq: deal with \ paths in basebackup_to_shell tests.
This is a new component in PG15, so a fix might be in scope for PG15
too. But I don't know if this change is really necessary. There are
other tests that use the GZIP and TAR environment variables (e.g.,
pg_verifybackup). If this is a problem there too, we should think of a
general solution. If not, it could use some explanation.
commit c00642483a53f4ee6e351085c7628363c293ee61
Author: Andres Freund <[email protected]>
Date: Fri Mar 25 21:44:48 2022
meson: prereq: unicode: allow to specify output directory.
OK with attached fixup (but see below).
commit 31313056e153e099f236a29b752f7610c4f7764f
Author: Andres Freund <[email protected]>
Date: Thu Jan 20 08:36:50 2022
meson: prereq: generate-errcodes.pl: accept output file
This is ok, but seems unnecessary, since meson can capture the output of
a single file. (See also similar script generate-errcodes-table.pl in
doc/, which uses capture.)
commit e4e77c0e20f3532be4ed270a7cf8b965b7cafa49
Author: Andres Freund <[email protected]>
Date: Thu Jan 20 08:36:50 2022
meson: prereq: add output path arg in generate-lwlocknames.pl
We should make the command-line interface here the same as the unicode
script: Either make the output directory a positional argument or an
option. I don't have a strong feeling about it either way, but perhaps
the solution with the option is more elegant and would also not require
changing the makefiles. Also, we should decide on short or long option:
The code declares a long option, but the build uses a short option.
It's confusing that that even works.
commit 7866620afa65223f6e657da972f501615fd32d3b
Author: Andres Freund <[email protected]>
Date: Wed Apr 20 21:01:31 2022
meson: prereq: output and depencency tracking work.
This could be split into multiple parts with more detailed explanations.
I see where you're going but not everything is fully clear to me
(especially the guc-file.c.h stuff).
From 51c6d3544ae9e652c7aac26102a8bf5a116fb182 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 7 Jun 2022 22:54:26 +0200
Subject: [PATCH] fixup! meson: prereq: unicode: allow to specify output
directory.
---
src/common/unicode/generate-unicode_norm_table.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/unicode/generate-unicode_norm_table.pl b/src/common/unicode/generate-unicode_norm_table.pl
index 3d0c3f0ebc..ed4181fce6 100644
--- a/src/common/unicode/generate-unicode_norm_table.pl
+++ b/src/common/unicode/generate-unicode_norm_table.pl
@@ -40,7 +40,7 @@
my @characters = ();
my %character_hash = ();
open($FH, '<', "$directory/UnicodeData.txt")
- or die "Could not open UnicodeData.txt: $!.";
+ or die "Could not open $directory/UnicodeData.txt: $!.";
while (my $line = <$FH>)
{
--
2.36.1
Attachments:
[text/plain] 0001-fixup-meson-prereq-unicode-allow-to-specify-output-d.patch (880B, ../../[email protected]/2-0001-fixup-meson-prereq-unicode-allow-to-specify-output-d.patch)
download | inline diff:
From 51c6d3544ae9e652c7aac26102a8bf5a116fb182 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 7 Jun 2022 22:54:26 +0200
Subject: [PATCH] fixup! meson: prereq: unicode: allow to specify output
directory.
---
src/common/unicode/generate-unicode_norm_table.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/unicode/generate-unicode_norm_table.pl b/src/common/unicode/generate-unicode_norm_table.pl
index 3d0c3f0ebc..ed4181fce6 100644
--- a/src/common/unicode/generate-unicode_norm_table.pl
+++ b/src/common/unicode/generate-unicode_norm_table.pl
@@ -40,7 +40,7 @@
my @characters = ();
my %character_hash = ();
open($FH, '<', "$directory/UnicodeData.txt")
- or die "Could not open UnicodeData.txt: $!.";
+ or die "Could not open $directory/UnicodeData.txt: $!.";
while (my $line = <$FH>)
{
--
2.36.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-08 12:33 ` Peter Eisentraut <[email protected]>
2022-06-14 18:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
1 sibling, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-06-08 12:33 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
Attached is a patch the finishes up the work to move the snowball SQL
script generation into a separate script.
From 02ca51dfb918666dfde8e48499a4c73afae4e89e Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 8 Jun 2022 11:05:31 +0200
Subject: [PATCH] fixup! meson: prereq: move snowball_create.sql creation into
perl file.
- Remove LANGUAGES list from Makefile, keep in Perl script.
- Add list of stopword files to install.
- Make depfile generation optional.
- Call new Perl script from Install.pm.
---
src/backend/snowball/Makefile | 81 ++++++++-----------------
src/backend/snowball/meson.build | 3 +-
src/backend/snowball/snowball_create.pl | 73 +++++++++++++++++-----
src/tools/msvc/Install.pm | 36 +----------
4 files changed, 86 insertions(+), 107 deletions(-)
diff --git a/src/backend/snowball/Makefile b/src/backend/snowball/Makefile
index 259104f8eb..c12a77055d 100644
--- a/src/backend/snowball/Makefile
+++ b/src/backend/snowball/Makefile
@@ -72,40 +72,22 @@ OBJS += \
stem_UTF_8_turkish.o \
stem_UTF_8_yiddish.o
-# first column is language name and also name of dictionary for not-all-ASCII
-# words, second is name of dictionary for all-ASCII words
-# Note order dependency: use of some other language as ASCII dictionary
-# must come after creation of that language
-LANGUAGES= \
- arabic arabic \
- armenian armenian \
- basque basque \
- catalan catalan \
- danish danish \
- dutch dutch \
- english english \
- finnish finnish \
- french french \
- german german \
- greek greek \
- hindi english \
- hungarian hungarian \
- indonesian indonesian \
- irish irish \
- italian italian \
- lithuanian lithuanian \
- nepali nepali \
- norwegian norwegian \
- portuguese portuguese \
- romanian romanian \
- russian english \
- serbian serbian \
- spanish spanish \
- swedish swedish \
- tamil tamil \
- turkish turkish \
- yiddish yiddish
-
+stop_files = \
+ danish.stop \
+ dutch.stop \
+ english.stop \
+ finnish.stop \
+ french.stop \
+ german.stop \
+ hungarian.stop \
+ italian.stop \
+ nepali.stop \
+ norwegian.stop \
+ portuguese.stop \
+ russian.stop \
+ spanish.stop \
+ swedish.stop \
+ turkish.stop
SQLSCRIPT= snowball_create.sql
DICTDIR=tsearch_data
@@ -119,35 +101,22 @@ all: all-shared-lib $(SQLSCRIPT)
include $(top_srcdir)/src/Makefile.shlib
-$(SQLSCRIPT): snowball_create.pl Makefile snowball_func.sql.in snowball.sql.in
+$(SQLSCRIPT): snowball_create.pl snowball_func.sql.in snowball.sql.in
$(PERL) $< --input ${srcdir} --output .
install: all installdirs install-lib
$(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
- @set -e; \
- set $(LANGUAGES) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- lang=$$1; shift; shift; \
- if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
- $(INSTALL_DATA) $(srcdir)/stopwords/$${lang}.stop '$(DESTDIR)$(datadir)/$(DICTDIR)' ; \
- fi \
- done
+ $(INSTALL_DATA) $(addprefix $(srcdir)/stopwords/,$(stop_files)) '$(DESTDIR)$(datadir)/$(DICTDIR)'
installdirs: installdirs-lib
$(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
uninstall: uninstall-lib
rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
- @set -e; \
- set $(LANGUAGES) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- lang=$$1; shift; shift; \
- if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
- rm -f '$(DESTDIR)$(datadir)/$(DICTDIR)/'$${lang}.stop ; \
- fi \
- done
-
-clean distclean maintainer-clean: clean-lib
- rm -f $(OBJS) $(SQLSCRIPT) snowball_create.dep
+ rm -f $(addprefix '$(DESTDIR)$(datadir)/$(DICTDIR)/',$(stop_files))
+
+clean distclean: clean-lib
+ rm -f $(OBJS)
+
+maintainer-clean: distclean
+ rm -f $(SQLSCRIPT)
diff --git a/src/backend/snowball/meson.build b/src/backend/snowball/meson.build
index 30aed714dc..c6326380e1 100644
--- a/src/backend/snowball/meson.build
+++ b/src/backend/snowball/meson.build
@@ -70,12 +70,11 @@ snowball_create = custom_target('snowball_create',
input: ['snowball_create.pl'],
output: ['snowball_create.sql'],
depfile: 'snowball_create.dep',
- command: [perl, '@INPUT0@', '--input', '@CURRENT_SOURCE_DIR@', '--output', '@OUTDIR@'],
+ command: [perl, '@INPUT0@', '--depfile', '--input', '@CURRENT_SOURCE_DIR@', '--output', '@OUTDIR@'],
install: true,
install_dir: dir_data,
)
-# FIXME: check whether the logic to select languages currently in Makefile is needed
install_subdir('stopwords',
install_dir: dir_data / 'tsearch_data',
strip_directory: true,
diff --git a/src/backend/snowball/snowball_create.pl b/src/backend/snowball/snowball_create.pl
index 285cf4f5d9..97e6c4d86d 100644
--- a/src/backend/snowball/snowball_create.pl
+++ b/src/backend/snowball/snowball_create.pl
@@ -7,8 +7,52 @@
my $output_path = '';
my $makefile_path = '';
my $input_path = '';
+my $depfile;
+
+our @languages = qw(
+ arabic
+ armenian
+ basque
+ catalan
+ danish
+ dutch
+ english
+ finnish
+ french
+ german
+ greek
+ hindi
+ hungarian
+ indonesian
+ irish
+ italian
+ lithuanian
+ nepali
+ norwegian
+ portuguese
+ romanian
+ russian
+ serbian
+ spanish
+ swedish
+ tamil
+ turkish
+ yiddish
+);
+
+# Names of alternative dictionaries for all-ASCII words. If not
+# listed, the language itself is used. Note order dependency: Use of
+# some other language as ASCII dictionary must come after creation of
+# that language, so the "backup" language must be listed earlier in
+# @languages.
+
+our %ascii_languages = (
+ 'hindi' => 'english',
+ 'russian' => 'english',
+);
GetOptions(
+ 'depfile' => \$depfile,
'output:s' => \$output_path,
'input:s' => \$input_path) || usage();
@@ -29,7 +73,8 @@
sub usage
{
die <<EOM;
-Usage: snowball_create.pl --input/-i <path> --input <path>
+Usage: snowball_create.pl --input/-i <path> --output/-o <path>
+ --depfile Write dependency file
--output Output directory (default '.')
--input Input directory
@@ -45,19 +90,16 @@ sub GenerateTsearchFiles
my $F;
my $D;
my $tmpl = read_file("$input_path/snowball.sql.in");
- my $mf = read_file("$input_path/Makefile");
- open($D, '>', "$output_path/snowball_create.dep")
- || die "Could not write snowball_create.dep";
+ if ($depfile)
+ {
+ open($D, '>', "$output_path/snowball_create.dep")
+ || die "Could not write snowball_create.dep";
+ }
- print $D "$output_file: $input_path/Makefile\n";
- print $D "$output_file: $input_path/snowball.sql.in\n";
- print $D "$output_file: $input_path/snowball_func.sql.in\n";
+ print $D "$output_file: $input_path/snowball.sql.in\n" if $depfile;
+ print $D "$output_file: $input_path/snowball_func.sql.in\n" if $depfile;
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^LANGUAGES\s*=\s*(.*)$/m
- || die "Could not find LANGUAGES line in snowball Makefile\n";
- my @pieces = split /\s+/, $1;
open($F, '>', $output_file)
|| die "Could not write snowball_create.sql";
@@ -65,10 +107,9 @@ sub GenerateTsearchFiles
print $F read_file("$input_path/snowball_func.sql.in");
- while ($#pieces > 0)
+ foreach my $lang (@languages)
{
- my $lang = shift @pieces || last;
- my $asclang = shift @pieces || last;
+ my $asclang = $ascii_languages{$lang} || $lang;
my $txt = $tmpl;
my $stop = '';
my $stopword_path = "$input_path/stopwords/$lang.stop";
@@ -77,7 +118,7 @@ sub GenerateTsearchFiles
{
$stop = ", StopWords=$lang";
- print $D "$output_file: $stopword_path\n";
+ print $D "$output_file: $stopword_path\n" if $depfile;
}
$txt =~ s#_LANGNAME_#${lang}#gs;
@@ -89,7 +130,7 @@ sub GenerateTsearchFiles
print $F $txt;
}
close($F);
- close($D);
+ close($D) if $depfile;
return;
}
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 8de79c618c..db61b992ff 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -389,39 +389,9 @@ sub GenerateTsearchFiles
my $target = shift;
print "Generating tsearch script...";
- my $F;
- my $tmpl = read_file('src/backend/snowball/snowball.sql.in');
- my $mf = read_file('src/backend/snowball/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^LANGUAGES\s*=\s*(.*)$/m
- || die "Could not find LANGUAGES line in snowball Makefile\n";
- my @pieces = split /\s+/, $1;
- open($F, '>', "$target/share/snowball_create.sql")
- || die "Could not write snowball_create.sql";
- print $F read_file('src/backend/snowball/snowball_func.sql.in');
-
- while ($#pieces > 0)
- {
- my $lang = shift @pieces || last;
- my $asclang = shift @pieces || last;
- my $txt = $tmpl;
- my $stop = '';
-
- if (-s "src/backend/snowball/stopwords/$lang.stop")
- {
- $stop = ", StopWords=$lang";
- }
-
- $txt =~ s#_LANGNAME_#${lang}#gs;
- $txt =~ s#_DICTNAME_#${lang}_stem#gs;
- $txt =~ s#_CFGNAME_#${lang}#gs;
- $txt =~ s#_ASCDICTNAME_#${asclang}_stem#gs;
- $txt =~ s#_NONASCDICTNAME_#${lang}_stem#gs;
- $txt =~ s#_STOPWORDS_#$stop#gs;
- print $F $txt;
- print ".";
- }
- close($F);
+ system('perl', 'src/backend/snowball/snowball_create.pl',
+ '--input', 'src/backend/snowball/',
+ '--output', "$target/share/");
print "\n";
return;
}
--
2.36.1
Attachments:
[text/plain] 0001-fixup-meson-prereq-move-snowball_create.sql-creation.patch (8.8K, ../../[email protected]/2-0001-fixup-meson-prereq-move-snowball_create.sql-creation.patch)
download | inline diff:
From 02ca51dfb918666dfde8e48499a4c73afae4e89e Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 8 Jun 2022 11:05:31 +0200
Subject: [PATCH] fixup! meson: prereq: move snowball_create.sql creation into
perl file.
- Remove LANGUAGES list from Makefile, keep in Perl script.
- Add list of stopword files to install.
- Make depfile generation optional.
- Call new Perl script from Install.pm.
---
src/backend/snowball/Makefile | 81 ++++++++-----------------
src/backend/snowball/meson.build | 3 +-
src/backend/snowball/snowball_create.pl | 73 +++++++++++++++++-----
src/tools/msvc/Install.pm | 36 +----------
4 files changed, 86 insertions(+), 107 deletions(-)
diff --git a/src/backend/snowball/Makefile b/src/backend/snowball/Makefile
index 259104f8eb..c12a77055d 100644
--- a/src/backend/snowball/Makefile
+++ b/src/backend/snowball/Makefile
@@ -72,40 +72,22 @@ OBJS += \
stem_UTF_8_turkish.o \
stem_UTF_8_yiddish.o
-# first column is language name and also name of dictionary for not-all-ASCII
-# words, second is name of dictionary for all-ASCII words
-# Note order dependency: use of some other language as ASCII dictionary
-# must come after creation of that language
-LANGUAGES= \
- arabic arabic \
- armenian armenian \
- basque basque \
- catalan catalan \
- danish danish \
- dutch dutch \
- english english \
- finnish finnish \
- french french \
- german german \
- greek greek \
- hindi english \
- hungarian hungarian \
- indonesian indonesian \
- irish irish \
- italian italian \
- lithuanian lithuanian \
- nepali nepali \
- norwegian norwegian \
- portuguese portuguese \
- romanian romanian \
- russian english \
- serbian serbian \
- spanish spanish \
- swedish swedish \
- tamil tamil \
- turkish turkish \
- yiddish yiddish
-
+stop_files = \
+ danish.stop \
+ dutch.stop \
+ english.stop \
+ finnish.stop \
+ french.stop \
+ german.stop \
+ hungarian.stop \
+ italian.stop \
+ nepali.stop \
+ norwegian.stop \
+ portuguese.stop \
+ russian.stop \
+ spanish.stop \
+ swedish.stop \
+ turkish.stop
SQLSCRIPT= snowball_create.sql
DICTDIR=tsearch_data
@@ -119,35 +101,22 @@ all: all-shared-lib $(SQLSCRIPT)
include $(top_srcdir)/src/Makefile.shlib
-$(SQLSCRIPT): snowball_create.pl Makefile snowball_func.sql.in snowball.sql.in
+$(SQLSCRIPT): snowball_create.pl snowball_func.sql.in snowball.sql.in
$(PERL) $< --input ${srcdir} --output .
install: all installdirs install-lib
$(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
- @set -e; \
- set $(LANGUAGES) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- lang=$$1; shift; shift; \
- if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
- $(INSTALL_DATA) $(srcdir)/stopwords/$${lang}.stop '$(DESTDIR)$(datadir)/$(DICTDIR)' ; \
- fi \
- done
+ $(INSTALL_DATA) $(addprefix $(srcdir)/stopwords/,$(stop_files)) '$(DESTDIR)$(datadir)/$(DICTDIR)'
installdirs: installdirs-lib
$(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(datadir)/$(DICTDIR)'
uninstall: uninstall-lib
rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
- @set -e; \
- set $(LANGUAGES) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- lang=$$1; shift; shift; \
- if [ -s $(srcdir)/stopwords/$${lang}.stop ] ; then \
- rm -f '$(DESTDIR)$(datadir)/$(DICTDIR)/'$${lang}.stop ; \
- fi \
- done
-
-clean distclean maintainer-clean: clean-lib
- rm -f $(OBJS) $(SQLSCRIPT) snowball_create.dep
+ rm -f $(addprefix '$(DESTDIR)$(datadir)/$(DICTDIR)/',$(stop_files))
+
+clean distclean: clean-lib
+ rm -f $(OBJS)
+
+maintainer-clean: distclean
+ rm -f $(SQLSCRIPT)
diff --git a/src/backend/snowball/meson.build b/src/backend/snowball/meson.build
index 30aed714dc..c6326380e1 100644
--- a/src/backend/snowball/meson.build
+++ b/src/backend/snowball/meson.build
@@ -70,12 +70,11 @@ snowball_create = custom_target('snowball_create',
input: ['snowball_create.pl'],
output: ['snowball_create.sql'],
depfile: 'snowball_create.dep',
- command: [perl, '@INPUT0@', '--input', '@CURRENT_SOURCE_DIR@', '--output', '@OUTDIR@'],
+ command: [perl, '@INPUT0@', '--depfile', '--input', '@CURRENT_SOURCE_DIR@', '--output', '@OUTDIR@'],
install: true,
install_dir: dir_data,
)
-# FIXME: check whether the logic to select languages currently in Makefile is needed
install_subdir('stopwords',
install_dir: dir_data / 'tsearch_data',
strip_directory: true,
diff --git a/src/backend/snowball/snowball_create.pl b/src/backend/snowball/snowball_create.pl
index 285cf4f5d9..97e6c4d86d 100644
--- a/src/backend/snowball/snowball_create.pl
+++ b/src/backend/snowball/snowball_create.pl
@@ -7,8 +7,52 @@
my $output_path = '';
my $makefile_path = '';
my $input_path = '';
+my $depfile;
+
+our @languages = qw(
+ arabic
+ armenian
+ basque
+ catalan
+ danish
+ dutch
+ english
+ finnish
+ french
+ german
+ greek
+ hindi
+ hungarian
+ indonesian
+ irish
+ italian
+ lithuanian
+ nepali
+ norwegian
+ portuguese
+ romanian
+ russian
+ serbian
+ spanish
+ swedish
+ tamil
+ turkish
+ yiddish
+);
+
+# Names of alternative dictionaries for all-ASCII words. If not
+# listed, the language itself is used. Note order dependency: Use of
+# some other language as ASCII dictionary must come after creation of
+# that language, so the "backup" language must be listed earlier in
+# @languages.
+
+our %ascii_languages = (
+ 'hindi' => 'english',
+ 'russian' => 'english',
+);
GetOptions(
+ 'depfile' => \$depfile,
'output:s' => \$output_path,
'input:s' => \$input_path) || usage();
@@ -29,7 +73,8 @@
sub usage
{
die <<EOM;
-Usage: snowball_create.pl --input/-i <path> --input <path>
+Usage: snowball_create.pl --input/-i <path> --output/-o <path>
+ --depfile Write dependency file
--output Output directory (default '.')
--input Input directory
@@ -45,19 +90,16 @@ sub GenerateTsearchFiles
my $F;
my $D;
my $tmpl = read_file("$input_path/snowball.sql.in");
- my $mf = read_file("$input_path/Makefile");
- open($D, '>', "$output_path/snowball_create.dep")
- || die "Could not write snowball_create.dep";
+ if ($depfile)
+ {
+ open($D, '>', "$output_path/snowball_create.dep")
+ || die "Could not write snowball_create.dep";
+ }
- print $D "$output_file: $input_path/Makefile\n";
- print $D "$output_file: $input_path/snowball.sql.in\n";
- print $D "$output_file: $input_path/snowball_func.sql.in\n";
+ print $D "$output_file: $input_path/snowball.sql.in\n" if $depfile;
+ print $D "$output_file: $input_path/snowball_func.sql.in\n" if $depfile;
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^LANGUAGES\s*=\s*(.*)$/m
- || die "Could not find LANGUAGES line in snowball Makefile\n";
- my @pieces = split /\s+/, $1;
open($F, '>', $output_file)
|| die "Could not write snowball_create.sql";
@@ -65,10 +107,9 @@ sub GenerateTsearchFiles
print $F read_file("$input_path/snowball_func.sql.in");
- while ($#pieces > 0)
+ foreach my $lang (@languages)
{
- my $lang = shift @pieces || last;
- my $asclang = shift @pieces || last;
+ my $asclang = $ascii_languages{$lang} || $lang;
my $txt = $tmpl;
my $stop = '';
my $stopword_path = "$input_path/stopwords/$lang.stop";
@@ -77,7 +118,7 @@ sub GenerateTsearchFiles
{
$stop = ", StopWords=$lang";
- print $D "$output_file: $stopword_path\n";
+ print $D "$output_file: $stopword_path\n" if $depfile;
}
$txt =~ s#_LANGNAME_#${lang}#gs;
@@ -89,7 +130,7 @@ sub GenerateTsearchFiles
print $F $txt;
}
close($F);
- close($D);
+ close($D) if $depfile;
return;
}
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 8de79c618c..db61b992ff 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -389,39 +389,9 @@ sub GenerateTsearchFiles
my $target = shift;
print "Generating tsearch script...";
- my $F;
- my $tmpl = read_file('src/backend/snowball/snowball.sql.in');
- my $mf = read_file('src/backend/snowball/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^LANGUAGES\s*=\s*(.*)$/m
- || die "Could not find LANGUAGES line in snowball Makefile\n";
- my @pieces = split /\s+/, $1;
- open($F, '>', "$target/share/snowball_create.sql")
- || die "Could not write snowball_create.sql";
- print $F read_file('src/backend/snowball/snowball_func.sql.in');
-
- while ($#pieces > 0)
- {
- my $lang = shift @pieces || last;
- my $asclang = shift @pieces || last;
- my $txt = $tmpl;
- my $stop = '';
-
- if (-s "src/backend/snowball/stopwords/$lang.stop")
- {
- $stop = ", StopWords=$lang";
- }
-
- $txt =~ s#_LANGNAME_#${lang}#gs;
- $txt =~ s#_DICTNAME_#${lang}_stem#gs;
- $txt =~ s#_CFGNAME_#${lang}#gs;
- $txt =~ s#_ASCDICTNAME_#${asclang}_stem#gs;
- $txt =~ s#_NONASCDICTNAME_#${lang}_stem#gs;
- $txt =~ s#_STOPWORDS_#$stop#gs;
- print $F $txt;
- print ".";
- }
- close($F);
+ system('perl', 'src/backend/snowball/snowball_create.pl',
+ '--input', 'src/backend/snowball/',
+ '--output', "$target/share/");
print "\n";
return;
}
--
2.36.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 12:33 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-14 18:27 ` Andres Freund <[email protected]>
2022-06-14 18:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-06-14 18:27 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-06-08 14:33:16 +0200, Peter Eisentraut wrote:
> Attached is a patch the finishes up the work to move the snowball SQL script
> generation into a separate script.
That looks good, merged. I did split the commit, because there's not yet a
meson.build "at the time" of the prereq: commits.
One thing I'm not quite sure about: Why does the makefile need awareness of
the stop files, but Install.pm doesn't? I suspect currently the patch leads to
stopwords not being installed on windows anymore?
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 12:33 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-14 18:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-06-14 18:47 ` Peter Eisentraut <[email protected]>
2022-06-14 18:51 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
0 siblings, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-06-14 18:47 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 14.06.22 20:27, Andres Freund wrote:
> One thing I'm not quite sure about: Why does the makefile need awareness of
> the stop files, but Install.pm doesn't? I suspect currently the patch leads to
> stopwords not being installed on windows anymore?
Install.pm contains this elsewhere:
GenerateTsearchFiles($target);
CopySetOfFiles(
'Stopword files',
[ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
$target . '/share/tsearch_data/');
It's a bit confusing that the "generate" function that we are patching
also installs some of the files right away, while the rest is installed
by the calling function.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 12:33 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-14 18:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-06-14 18:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-14 18:51 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-06-14 18:51 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
On 2022-06-14 20:47:59 +0200, Peter Eisentraut wrote:
> On 14.06.22 20:27, Andres Freund wrote:
> > One thing I'm not quite sure about: Why does the makefile need awareness of
> > the stop files, but Install.pm doesn't? I suspect currently the patch leads to
> > stopwords not being installed on windows anymore?
>
> Install.pm contains this elsewhere:
>
> GenerateTsearchFiles($target);
> CopySetOfFiles(
> 'Stopword files',
> [ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
> $target . '/share/tsearch_data/');
>
> It's a bit confusing that the "generate" function that we are patching also
> installs some of the files right away, while the rest is installed by the
> calling function.
Ugh, that's confusing indeed. Thanks for the explanation.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-06-14 18:23 ` Andres Freund <[email protected]>
1 sibling, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-06-14 18:23 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-06-08 08:27:06 +0200, Peter Eisentraut wrote:
> I looked at some of the "prereq" patches again to see what state they are
> in:
>
> commit 351a12f48e395b31cce4aca239b934174b36ea9d
> Author: Andres Freund <[email protected]>
> Date: Wed Apr 20 22:46:54 2022
>
> prereq: deal with \ paths in basebackup_to_shell tests.
>
> This is a new component in PG15, so a fix might be in scope for PG15 too.
Yea, I should probably post that to the relevant thread. I think at that point
I was just trying to get a rebase not to fail anymore...
> But I don't know if this change is really necessary. There are other tests
> that use the GZIP and TAR environment variables (e.g., pg_verifybackup). If
> this is a problem there too, we should think of a general solution. If not,
> it could use some explanation.
I got failures on windows without it - which we just don't see on windows
because currently nothing runs these tests :(. The pg_verifybackup case likely
is unproblematic because it uses the array form of building subcommands,
instead of string interpolation.
> commit c00642483a53f4ee6e351085c7628363c293ee61
> Author: Andres Freund <[email protected]>
> Date: Fri Mar 25 21:44:48 2022
>
> meson: prereq: unicode: allow to specify output directory.
>
> OK with attached fixup (but see below).
Merged.
> commit 31313056e153e099f236a29b752f7610c4f7764f
> Author: Andres Freund <[email protected]>
> Date: Thu Jan 20 08:36:50 2022
>
> meson: prereq: generate-errcodes.pl: accept output file
>
> This is ok, but seems unnecessary, since meson can capture the output of a
> single file. (See also similar script generate-errcodes-table.pl in doc/,
> which uses capture.)
Not sure why I didn't do that. It might be because the meson capture stuff has
a noticable overhead, particularly on windows, because it starts up a python
interpreter. Since nearly the whole build depends on generate-errcodes.pl to
have run...
> commit e4e77c0e20f3532be4ed270a7cf8b965b7cafa49
> Author: Andres Freund <[email protected]>
> Date: Thu Jan 20 08:36:50 2022
>
> meson: prereq: add output path arg in generate-lwlocknames.pl
>
> We should make the command-line interface here the same as the unicode
> script: Either make the output directory a positional argument or an option.
> I don't have a strong feeling about it either way, but perhaps the solution
> with the option is more elegant and would also not require changing the
> makefiles.
I don't really have an opinion what's better here, so I'll go with your
preference / the option.
> Also, we should decide on short or long option: The code
> declares a long option, but the build uses a short option. It's confusing
> that that even works.
Getopt::Long auto-generates short options afaict...
> commit 7866620afa65223f6e657da972f501615fd32d3b
> Author: Andres Freund <[email protected]>
> Date: Wed Apr 20 21:01:31 2022
>
> meson: prereq: output and depencency tracking work.
>
> This could be split into multiple parts with more detailed explanations. I
> see where you're going but not everything is fully clear to me (especially
> the guc-file.c.h stuff).
Will take a stab at doing so.
> From 51c6d3544ae9e652c7aac26102a8bf5a116fb182 Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <[email protected]>
> Date: Tue, 7 Jun 2022 22:54:26 +0200
> Subject: [PATCH] fixup! meson: prereq: unicode: allow to specify output
> directory.
Merged.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2023-04-14 15:58 ` Greg Stark <[email protected]>
3 siblings, 0 replies; 44+ messages in thread
From: Greg Stark @ 2023-04-14 15:58 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: Andres Freund <[email protected]>; pgsql-hackers
On Wed, 11 May 2022 at 06:19, Peter Eisentraut
<[email protected]> wrote:
>
> After that, these configure options don't have an equivalent yet:
>
> --enable-profiling
Afaics this still doesn't exist? Is there a common idiom to enable
this? Like, if I add in something to cflags is that enough? I seem to
recall we had some hack to actually get each backend's gmon.out to not
step on each other's which needed an explicit flag to enable?
--
greg
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
@ 2022-04-20 21:04 ` Andres Freund <[email protected]>
2022-04-21 20:36 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
1 sibling, 1 reply; 44+ messages in thread
From: Andres Freund @ 2022-04-20 21:04 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-04-13 12:26:05 +0200, Peter Eisentraut wrote:
> Some feedback and patches for your branch at
> 3274198960c139328fef3c725cee1468bbfff469:
Thanks! I just rebased the branch, will merge your changes once the fallout
from that is fixed...
> 0001-Install-a-few-more-files.patch
>
> These are just some files that were apparently forgotten to be installed so
> far.
> 0002-Adjust-some-header-file-installation-paths.patch
>
> The installation of server headers is apparently still in progress. This
> just adjusts the installation directory of those that are already being
> dealt with, so they match the existing installation layout.
Yea. I've not at all paid attention to that so far, besides getting tests to
pass.
> 0003-Fix-warnings-about-deprecated-features.patch
>
> This fixes some deprecation warnings and raises the requirement to 0.56.
I don't see any deprecation warnings - I see some notices about *future*
deprecated features being used:
NOTICE: Future-deprecated features used:
* 0.55.0: {'ExternalProgram.path'}
* 0.56.0: {'meson.source_root', 'meson.build_root'}
(i.e. once the minimum version is increased to > 0.54, those will trigger
deprecation warnings)
What are you seeing with what version?
> I'm not sure why the current cutoff at 0.54 was chosen. Perhaps that could
> be documented.
Not quite sure why I ended up with 0.54. We definitely should require at most
0.56, as that's the last version supporting python 3.5.
> 0004-Install-postmaster-symlink.patch
>
> This needs 0.61, so maybe it's a bit too new.
Yea, that's too new. I think we can just create the symlink using ln or such
if we need it.
> Or we could get rid of the postmaster symlink altogether?
But that seems like a better approach.
> 0005-Workaround-for-Perl-detection.patch
>
> This is needed on my system to get the Perl detection to pass. If I look at
> the equivalent configure code, some more refinement appears to be needed in
> this area.
> From 1f80e1ebb8efeb0eba7d57032282520fd6455b0d Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <[email protected]>
> Date: Wed, 13 Apr 2022 11:50:52 +0200
> Subject: [PATCH 5/5] Workaround for Perl detection
>
> ---
> meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 1bf53ea24d..e33ed11b08 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -545,9 +545,9 @@ else
> # file existence.
> if perl_may_work
> perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
> - if host_machine.system() == 'darwin'
> - perl_ccflags += ['-iwithsysroot', perl_inc_dir]
> - endif
> + #if host_machine.system() == 'darwin'
> + # perl_ccflags += ['-iwithsysroot', perl_inc_dir]
> + #endif
> endif
What problem do you see without this? It did build on CI and on my m1 mini box
as is...
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v8
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 21:04 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
@ 2022-04-21 20:36 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Peter Eisentraut @ 2022-04-21 20:36 UTC (permalink / raw)
To: Andres Freund <[email protected]>; +Cc: pgsql-hackers
On 20.04.22 23:04, Andres Freund wrote:
>> 0003-Fix-warnings-about-deprecated-features.patch
>>
>> This fixes some deprecation warnings and raises the requirement to 0.56.
>
> I don't see any deprecation warnings - I see some notices about *future*
> deprecated features being used:
>
> NOTICE: Future-deprecated features used:
> * 0.55.0: {'ExternalProgram.path'}
> * 0.56.0: {'meson.source_root', 'meson.build_root'}
>
> (i.e. once the minimum version is increased to > 0.54, those will trigger
> deprecation warnings)
>
> What are you seeing with what version?
I see the same thing. Effectively, "deprecation warning" and
"future-deprecation notice" are just different spellings of "yelling at
me unconditionally for using code that I can't do anything about".
>> I'm not sure why the current cutoff at 0.54 was chosen. Perhaps that could
>> be documented.
>
> Not quite sure why I ended up with 0.54. We definitely should require at most
> 0.56, as that's the last version supporting python 3.5.
Why is Python 3.5 relevant?
>> From 1f80e1ebb8efeb0eba7d57032282520fd6455b0d Mon Sep 17 00:00:00 2001
>> From: Peter Eisentraut <[email protected]>
>> Date: Wed, 13 Apr 2022 11:50:52 +0200
>> Subject: [PATCH 5/5] Workaround for Perl detection
>>
>> ---
>> meson.build | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index 1bf53ea24d..e33ed11b08 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -545,9 +545,9 @@ else
>> # file existence.
>> if perl_may_work
>> perl_ccflags += ['-I@0@'.format(perl_inc_dir)]
>> - if host_machine.system() == 'darwin'
>> - perl_ccflags += ['-iwithsysroot', perl_inc_dir]
>> - endif
>> + #if host_machine.system() == 'darwin'
>> + # perl_ccflags += ['-iwithsysroot', perl_inc_dir]
>> + #endif
>> endif
>
> What problem do you see without this? It did build on CI and on my m1 mini box
> as is...
I'm using homebrew-installed gcc and homebrew-installed perl. gcc
doesn't understand the option -iwithsysroot, and apparently whatever it
points to is not needed.
Note that in configure.ac the logic is like this:
if test \! -f "$perl_archlibexp/CORE/perl.h" ; then
if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then
perl_includespec="-iwithsysroot $perl_archlibexp/CORE"
fi
fi
So it checks first if it can find the needed file without the sysroot
business.
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v6
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
@ 2022-03-24 15:16 ` Peter Eisentraut <[email protected]>
2022-03-24 15:40 ` Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
1 sibling, 1 reply; 44+ messages in thread
From: Peter Eisentraut @ 2022-03-24 15:16 UTC (permalink / raw)
To: Andres Freund <[email protected]>; pgsql-hackers
On 09.03.22 13:37, Peter Eisentraut wrote:
> v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz
>
> I think the right way here is actually to go the other way around:
> Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
> assignment from src/makefiles/ to src/templates/, have configure read
> it, and then substitute it into Makefile.global and pg_config.h.
>
> Then we also don't have to patch the Windows build code a bunch of
> times to add the DLSUFFIX define everywhere.
This patch should do it.
From 763943176a1e0a0c954414ba9da07742ad791656 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 24 Mar 2022 16:00:54 +0100
Subject: [PATCH] Refactor DLSUFFIX handling
Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
assignment from src/makefiles/ to src/templates/, have configure read
it, and then substitute it into Makefile.global and pg_config.h. This
avoids the need of all users to locally set CPPFLAGS.
---
config/python.m4 | 4 +++-
configure | 13 ++++++++++++-
configure.ac | 5 +++++
src/Makefile.global.in | 2 ++
src/backend/jit/Makefile | 2 --
src/backend/utils/fmgr/Makefile | 2 --
src/backend/utils/fmgr/dfmgr.c | 5 -----
src/bin/pg_upgrade/Makefile | 2 +-
src/include/pg_config.h.in | 3 +++
src/include/port/win32_port.h | 3 ---
src/interfaces/ecpg/test/Makefile | 1 -
src/makefiles/Makefile.aix | 1 -
src/makefiles/Makefile.cygwin | 1 -
src/makefiles/Makefile.darwin | 2 --
src/makefiles/Makefile.freebsd | 2 --
src/makefiles/Makefile.hpux | 6 ------
src/makefiles/Makefile.linux | 2 --
src/makefiles/Makefile.netbsd | 2 --
src/makefiles/Makefile.openbsd | 2 --
src/makefiles/Makefile.solaris | 2 --
src/makefiles/Makefile.win32 | 1 -
src/template/cygwin | 2 ++
src/template/hpux | 7 +++++++
src/template/win32 | 2 ++
src/test/regress/GNUmakefile | 3 +--
src/tools/msvc/Solution.pm | 1 +
26 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/config/python.m4 b/config/python.m4
index 52f34070dd..e500873ff3 100644
--- a/config/python.m4
+++ b/config/python.m4
@@ -120,7 +120,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure b/configure
index e066cbe2c8..519cef76a9 100755
--- a/configure
+++ b/configure
@@ -743,6 +743,7 @@ BITCODE_CFLAGS
CFLAGS_VECTORIZE
CFLAGS_UNROLL_LOOPS
PERMIT_DECLARATION_AFTER_STATEMENT
+DLSUFFIX
LLVM_BINPATH
LLVM_CXXFLAGS
LLVM_CFLAGS
@@ -5219,11 +5220,19 @@ fi # fi
unset CFLAGS
unset CXXFLAGS
+DLSUFFIX=".so"
+
#
# Read the template
#
. "$srcdir/src/template/$template" || exit
+
+
+cat >>confdefs.h <<_ACEOF
+#define DLSUFFIX "$DLSUFFIX"
+_ACEOF
+
# C[XX]FLAGS are selected so:
# If the user specifies something in the environment, that is used.
# else: If the template file set something, that is used.
@@ -10560,7 +10569,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure.ac b/configure.ac
index 078381e568..79ae882133 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,11 +397,16 @@ AS_IF([test "$with_llvm" = yes], [
unset CFLAGS
unset CXXFLAGS
+DLSUFFIX=".so"
+
#
# Read the template
#
. "$srcdir/src/template/$template" || exit
+AC_SUBST(DLSUFFIX)
+AC_DEFINE_UNQUOTED([DLSUFFIX], ["$DLSUFFIX"], [Define to the file name extension of dynamically-loadable modules.])dnl
+
# C[XX]FLAGS are selected so:
# If the user specifies something in the environment, that is used.
# else: If the template file set something, that is used.
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index bbdc1c4bda..0726b2020f 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -545,6 +545,8 @@ WIN32_STACK_RLIMIT=4194304
# Set if we have a working win32 crashdump header
have_win32_dbghelp = @have_win32_dbghelp@
+DLSUFFIX = @DLSUFFIX@
+
# Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port
diff --git a/src/backend/jit/Makefile b/src/backend/jit/Makefile
index a895ebac5f..a9a603e639 100644
--- a/src/backend/jit/Makefile
+++ b/src/backend/jit/Makefile
@@ -15,8 +15,6 @@ subdir = src/backend/jit
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
OBJS = \
jit.o
diff --git a/src/backend/utils/fmgr/Makefile b/src/backend/utils/fmgr/Makefile
index f552b95ca9..ceffb807fb 100644
--- a/src/backend/utils/fmgr/Makefile
+++ b/src/backend/utils/fmgr/Makefile
@@ -17,6 +17,4 @@ OBJS = \
fmgr.o \
funcapi.o
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 050da78080..3774f33e0e 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -483,11 +483,6 @@ file_exists(const char *name)
}
-/* Example format: ".so" */
-#ifndef DLSUFFIX
-#error "DLSUFFIX must be defined to compile this file."
-#endif
-
/*
* If name contains a slash, check if the file exists, if so return
* the name. Else (no slash) try to expand using search path (see
diff --git a/src/bin/pg_upgrade/Makefile b/src/bin/pg_upgrade/Makefile
index 49b94f0ac7..7a3225b27c 100644
--- a/src/bin/pg_upgrade/Makefile
+++ b/src/bin/pg_upgrade/Makefile
@@ -25,7 +25,7 @@ OBJS = \
util.o \
version.o
-override CPPFLAGS := -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
all: pg_upgrade
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 635fbb2181..9e2ca83993 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -42,6 +42,9 @@
/* Define to the default TCP port number as a string constant. */
#undef DEF_PGPORT_STR
+/* Define to the file name extension of dynamically-loadable modules. */
+#undef DLSUFFIX
+
/* Define to build with GSSAPI support. (--with-gssapi) */
#undef ENABLE_GSS
diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index d3cb765976..4bb6fc5e1e 100644
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -529,9 +529,6 @@ typedef unsigned short mode_t;
#define W_OK 2
#define R_OK 4
-/* Pulled from Makefile.port in MinGW */
-#define DLSUFFIX ".dll"
-
#endif /* _MSC_VER */
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || \
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index be53b7b94d..10f53c708c 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -12,7 +12,6 @@ override CPPFLAGS := \
'-I$(top_srcdir)/src/test/regress' \
'-DHOST_TUPLE="$(host_tuple)"' \
'-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"' \
$(CPPFLAGS)
# default encoding for regression tests
diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
index ba3695dd57..84f26b49b8 100644
--- a/src/makefiles/Makefile.aix
+++ b/src/makefiles/Makefile.aix
@@ -14,7 +14,6 @@ else
rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
endif
-DLSUFFIX = .so
ifeq ($(host_os), aix3.2.5)
ifneq ($(GCC), yes)
LDFLAGS_SL += -e _nostart -H512 -bM:SRE
diff --git a/src/makefiles/Makefile.cygwin b/src/makefiles/Makefile.cygwin
index 81089d6257..6afa9a06a1 100644
--- a/src/makefiles/Makefile.cygwin
+++ b/src/makefiles/Makefile.cygwin
@@ -11,7 +11,6 @@ endif
LIBS:=$(filter-out -lm -lc, $(LIBS))
AROPT = crs
-DLSUFFIX = .dll
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
index b17598f058..4fc81c1584 100644
--- a/src/makefiles/Makefile.darwin
+++ b/src/makefiles/Makefile.darwin
@@ -1,7 +1,5 @@
AROPT = crs
-DLSUFFIX = .so
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = DYLD_LIBRARY_PATH
diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd
index 75db21ba14..0e77616b0f 100644
--- a/src/makefiles/Makefile.freebsd
+++ b/src/makefiles/Makefile.freebsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-export-dynamic
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# extra stuff for $(with_temp_install)
# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
# rpath, if no DT_RUNPATH is present in the executable. The conditions
diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 7e18770d89..25e036bd8d 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -25,12 +25,6 @@ INSTALL_SHLIB_OPTS = -m 555
AROPT = crs
-ifeq ($(host_cpu), ia64)
- DLSUFFIX = .so
-else
- DLSUFFIX = .sl
-endif
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = SHLIB_PATH
diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux
index 645f73aa2b..1ffec9d169 100644
--- a/src/makefiles/Makefile.linux
+++ b/src/makefiles/Makefile.linux
@@ -5,8 +5,6 @@ export_dynamic = -Wl,-E
# This allows LD_LIBRARY_PATH to still work when needed.
rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.netbsd
+++ b/src/makefiles/Makefile.netbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.openbsd
+++ b/src/makefiles/Makefile.openbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index 62a6c01c3a..5496edcafc 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -9,8 +9,6 @@ else
rpath = -Wl,-R'$(rpathdir)'
endif
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32
index e72cb2db0e..17d6819644 100644
--- a/src/makefiles/Makefile.win32
+++ b/src/makefiles/Makefile.win32
@@ -11,7 +11,6 @@ endif
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
AROPT = crs
-DLSUFFIX = .dll
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
diff --git a/src/template/cygwin b/src/template/cygwin
index 1e7274bc33..3f42e2f8b6 100644
--- a/src/template/cygwin
+++ b/src/template/cygwin
@@ -13,3 +13,5 @@ CFLAGS_SL=""
# we'd prefer to use --disable-auto-import to match MSVC linking behavior,
# but support for it in Cygwin is too haphazard
LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--enable-auto-import"
+
+DLSUFFIX=".dll"
diff --git a/src/template/hpux b/src/template/hpux
index 50fff80c53..5105a74c78 100644
--- a/src/template/hpux
+++ b/src/template/hpux
@@ -25,3 +25,10 @@ case $host in
fi
;;
esac
+
+case $host_cpu in
+ ia64)
+ DLSUFFIX=".so";;
+ *)
+ DLSUFFIX=".sl";;
+esac
diff --git a/src/template/win32 b/src/template/win32
index 1380d16548..1895f067a8 100644
--- a/src/template/win32
+++ b/src/template/win32
@@ -7,3 +7,5 @@ CFLAGS_SL=""
# pg_toupper() etc. in both libpq and pgport
# --disable-auto-import is to ensure we get MSVC-like linking behavior
LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--disable-auto-import"
+
+DLSUFFIX=".dll"
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index b40361c84c..88b82d9268 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -25,8 +25,7 @@ endif
# stuff to pass into build of pg_regress
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
- '-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"'
+ '-DSHELLPROG="$(SHELL)"'
##
## Prepare for tests
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a21ea9bef9..ef5476d034 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -216,6 +216,7 @@ sub GenerateFiles
CONFIGURE_ARGS => '"' . $self->GetFakeConfigure() . '"',
DEF_PGPORT => $port,
DEF_PGPORT_STR => qq{"$port"},
+ DLSUFFIX => '".dll"',
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
ENABLE_NLS => $self->{options}->{nls} ? 1 : undef,
ENABLE_THREAD_SAFETY => 1,
--
2.35.1
Attachments:
[text/plain] 0001-Refactor-DLSUFFIX-handling.patch (12.8K, ../../[email protected]/2-0001-Refactor-DLSUFFIX-handling.patch)
download | inline diff:
From 763943176a1e0a0c954414ba9da07742ad791656 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 24 Mar 2022 16:00:54 +0100
Subject: [PATCH] Refactor DLSUFFIX handling
Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
assignment from src/makefiles/ to src/templates/, have configure read
it, and then substitute it into Makefile.global and pg_config.h. This
avoids the need of all users to locally set CPPFLAGS.
---
config/python.m4 | 4 +++-
configure | 13 ++++++++++++-
configure.ac | 5 +++++
src/Makefile.global.in | 2 ++
src/backend/jit/Makefile | 2 --
src/backend/utils/fmgr/Makefile | 2 --
src/backend/utils/fmgr/dfmgr.c | 5 -----
src/bin/pg_upgrade/Makefile | 2 +-
src/include/pg_config.h.in | 3 +++
src/include/port/win32_port.h | 3 ---
src/interfaces/ecpg/test/Makefile | 1 -
src/makefiles/Makefile.aix | 1 -
src/makefiles/Makefile.cygwin | 1 -
src/makefiles/Makefile.darwin | 2 --
src/makefiles/Makefile.freebsd | 2 --
src/makefiles/Makefile.hpux | 6 ------
src/makefiles/Makefile.linux | 2 --
src/makefiles/Makefile.netbsd | 2 --
src/makefiles/Makefile.openbsd | 2 --
src/makefiles/Makefile.solaris | 2 --
src/makefiles/Makefile.win32 | 1 -
src/template/cygwin | 2 ++
src/template/hpux | 7 +++++++
src/template/win32 | 2 ++
src/test/regress/GNUmakefile | 3 +--
src/tools/msvc/Solution.pm | 1 +
26 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/config/python.m4 b/config/python.m4
index 52f34070dd..e500873ff3 100644
--- a/config/python.m4
+++ b/config/python.m4
@@ -120,7 +120,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure b/configure
index e066cbe2c8..519cef76a9 100755
--- a/configure
+++ b/configure
@@ -743,6 +743,7 @@ BITCODE_CFLAGS
CFLAGS_VECTORIZE
CFLAGS_UNROLL_LOOPS
PERMIT_DECLARATION_AFTER_STATEMENT
+DLSUFFIX
LLVM_BINPATH
LLVM_CXXFLAGS
LLVM_CFLAGS
@@ -5219,11 +5220,19 @@ fi # fi
unset CFLAGS
unset CXXFLAGS
+DLSUFFIX=".so"
+
#
# Read the template
#
. "$srcdir/src/template/$template" || exit
+
+
+cat >>confdefs.h <<_ACEOF
+#define DLSUFFIX "$DLSUFFIX"
+_ACEOF
+
# C[XX]FLAGS are selected so:
# If the user specifies something in the environment, that is used.
# else: If the template file set something, that is used.
@@ -10560,7 +10569,9 @@ else
found_shlib=0
for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
do
- # We don't know the platform DLSUFFIX here, so check 'em all.
+ # Note: DLSUFFIX is for loadable modules, not shared
+ # libraries, so cannot be used here portably. Just
+ # check all known possibilities.
for e in .so .dll .dylib .sl; do
if test -e "$d/lib${ldlibrary}$e"; then
python_libdir="$d"
diff --git a/configure.ac b/configure.ac
index 078381e568..79ae882133 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,11 +397,16 @@ AS_IF([test "$with_llvm" = yes], [
unset CFLAGS
unset CXXFLAGS
+DLSUFFIX=".so"
+
#
# Read the template
#
. "$srcdir/src/template/$template" || exit
+AC_SUBST(DLSUFFIX)
+AC_DEFINE_UNQUOTED([DLSUFFIX], ["$DLSUFFIX"], [Define to the file name extension of dynamically-loadable modules.])dnl
+
# C[XX]FLAGS are selected so:
# If the user specifies something in the environment, that is used.
# else: If the template file set something, that is used.
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index bbdc1c4bda..0726b2020f 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -545,6 +545,8 @@ WIN32_STACK_RLIMIT=4194304
# Set if we have a working win32 crashdump header
have_win32_dbghelp = @have_win32_dbghelp@
+DLSUFFIX = @DLSUFFIX@
+
# Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port
diff --git a/src/backend/jit/Makefile b/src/backend/jit/Makefile
index a895ebac5f..a9a603e639 100644
--- a/src/backend/jit/Makefile
+++ b/src/backend/jit/Makefile
@@ -15,8 +15,6 @@ subdir = src/backend/jit
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
OBJS = \
jit.o
diff --git a/src/backend/utils/fmgr/Makefile b/src/backend/utils/fmgr/Makefile
index f552b95ca9..ceffb807fb 100644
--- a/src/backend/utils/fmgr/Makefile
+++ b/src/backend/utils/fmgr/Makefile
@@ -17,6 +17,4 @@ OBJS = \
fmgr.o \
funcapi.o
-override CPPFLAGS += -DDLSUFFIX=\"$(DLSUFFIX)\"
-
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 050da78080..3774f33e0e 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -483,11 +483,6 @@ file_exists(const char *name)
}
-/* Example format: ".so" */
-#ifndef DLSUFFIX
-#error "DLSUFFIX must be defined to compile this file."
-#endif
-
/*
* If name contains a slash, check if the file exists, if so return
* the name. Else (no slash) try to expand using search path (see
diff --git a/src/bin/pg_upgrade/Makefile b/src/bin/pg_upgrade/Makefile
index 49b94f0ac7..7a3225b27c 100644
--- a/src/bin/pg_upgrade/Makefile
+++ b/src/bin/pg_upgrade/Makefile
@@ -25,7 +25,7 @@ OBJS = \
util.o \
version.o
-override CPPFLAGS := -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
all: pg_upgrade
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 635fbb2181..9e2ca83993 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -42,6 +42,9 @@
/* Define to the default TCP port number as a string constant. */
#undef DEF_PGPORT_STR
+/* Define to the file name extension of dynamically-loadable modules. */
+#undef DLSUFFIX
+
/* Define to build with GSSAPI support. (--with-gssapi) */
#undef ENABLE_GSS
diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index d3cb765976..4bb6fc5e1e 100644
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -529,9 +529,6 @@ typedef unsigned short mode_t;
#define W_OK 2
#define R_OK 4
-/* Pulled from Makefile.port in MinGW */
-#define DLSUFFIX ".dll"
-
#endif /* _MSC_VER */
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || \
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index be53b7b94d..10f53c708c 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -12,7 +12,6 @@ override CPPFLAGS := \
'-I$(top_srcdir)/src/test/regress' \
'-DHOST_TUPLE="$(host_tuple)"' \
'-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"' \
$(CPPFLAGS)
# default encoding for regression tests
diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
index ba3695dd57..84f26b49b8 100644
--- a/src/makefiles/Makefile.aix
+++ b/src/makefiles/Makefile.aix
@@ -14,7 +14,6 @@ else
rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
endif
-DLSUFFIX = .so
ifeq ($(host_os), aix3.2.5)
ifneq ($(GCC), yes)
LDFLAGS_SL += -e _nostart -H512 -bM:SRE
diff --git a/src/makefiles/Makefile.cygwin b/src/makefiles/Makefile.cygwin
index 81089d6257..6afa9a06a1 100644
--- a/src/makefiles/Makefile.cygwin
+++ b/src/makefiles/Makefile.cygwin
@@ -11,7 +11,6 @@ endif
LIBS:=$(filter-out -lm -lc, $(LIBS))
AROPT = crs
-DLSUFFIX = .dll
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
diff --git a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin
index b17598f058..4fc81c1584 100644
--- a/src/makefiles/Makefile.darwin
+++ b/src/makefiles/Makefile.darwin
@@ -1,7 +1,5 @@
AROPT = crs
-DLSUFFIX = .so
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = DYLD_LIBRARY_PATH
diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd
index 75db21ba14..0e77616b0f 100644
--- a/src/makefiles/Makefile.freebsd
+++ b/src/makefiles/Makefile.freebsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-export-dynamic
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# extra stuff for $(with_temp_install)
# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
# rpath, if no DT_RUNPATH is present in the executable. The conditions
diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 7e18770d89..25e036bd8d 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -25,12 +25,6 @@ INSTALL_SHLIB_OPTS = -m 555
AROPT = crs
-ifeq ($(host_cpu), ia64)
- DLSUFFIX = .so
-else
- DLSUFFIX = .sl
-endif
-
# env var name to use in place of LD_LIBRARY_PATH
ld_library_path_var = SHLIB_PATH
diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux
index 645f73aa2b..1ffec9d169 100644
--- a/src/makefiles/Makefile.linux
+++ b/src/makefiles/Makefile.linux
@@ -5,8 +5,6 @@ export_dynamic = -Wl,-E
# This allows LD_LIBRARY_PATH to still work when needed.
rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.netbsd
+++ b/src/makefiles/Makefile.netbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd
index 6f9cb1d45d..421b735e40 100644
--- a/src/makefiles/Makefile.openbsd
+++ b/src/makefiles/Makefile.openbsd
@@ -3,8 +3,6 @@ AROPT = cr
export_dynamic = -Wl,-E
rpath = -Wl,-R'$(rpathdir)'
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index 62a6c01c3a..5496edcafc 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -9,8 +9,6 @@ else
rpath = -Wl,-R'$(rpathdir)'
endif
-DLSUFFIX = .so
-
# Rule for building a shared library from a single .o file
%.so: %.o
diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32
index e72cb2db0e..17d6819644 100644
--- a/src/makefiles/Makefile.win32
+++ b/src/makefiles/Makefile.win32
@@ -11,7 +11,6 @@ endif
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
AROPT = crs
-DLSUFFIX = .dll
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
diff --git a/src/template/cygwin b/src/template/cygwin
index 1e7274bc33..3f42e2f8b6 100644
--- a/src/template/cygwin
+++ b/src/template/cygwin
@@ -13,3 +13,5 @@ CFLAGS_SL=""
# we'd prefer to use --disable-auto-import to match MSVC linking behavior,
# but support for it in Cygwin is too haphazard
LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--enable-auto-import"
+
+DLSUFFIX=".dll"
diff --git a/src/template/hpux b/src/template/hpux
index 50fff80c53..5105a74c78 100644
--- a/src/template/hpux
+++ b/src/template/hpux
@@ -25,3 +25,10 @@ case $host in
fi
;;
esac
+
+case $host_cpu in
+ ia64)
+ DLSUFFIX=".so";;
+ *)
+ DLSUFFIX=".sl";;
+esac
diff --git a/src/template/win32 b/src/template/win32
index 1380d16548..1895f067a8 100644
--- a/src/template/win32
+++ b/src/template/win32
@@ -7,3 +7,5 @@ CFLAGS_SL=""
# pg_toupper() etc. in both libpq and pgport
# --disable-auto-import is to ensure we get MSVC-like linking behavior
LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition -Wl,--disable-auto-import"
+
+DLSUFFIX=".dll"
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index b40361c84c..88b82d9268 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -25,8 +25,7 @@ endif
# stuff to pass into build of pg_regress
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
- '-DSHELLPROG="$(SHELL)"' \
- '-DDLSUFFIX="$(DLSUFFIX)"'
+ '-DSHELLPROG="$(SHELL)"'
##
## Prepare for tests
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a21ea9bef9..ef5476d034 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -216,6 +216,7 @@ sub GenerateFiles
CONFIGURE_ARGS => '"' . $self->GetFakeConfigure() . '"',
DEF_PGPORT => $port,
DEF_PGPORT_STR => qq{"$port"},
+ DLSUFFIX => '".dll"',
ENABLE_GSS => $self->{options}->{gss} ? 1 : undef,
ENABLE_NLS => $self->{options}->{nls} ? 1 : undef,
ENABLE_THREAD_SAFETY => 1,
--
2.35.1
^ permalink raw reply [nested|flat] 44+ messages in thread
* Re: [RFC] building postgres with meson -v6
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-24 15:16 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
@ 2022-03-24 15:40 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 44+ messages in thread
From: Andres Freund @ 2022-03-24 15:40 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2022-03-24 16:16:15 +0100, Peter Eisentraut wrote:
> On 09.03.22 13:37, Peter Eisentraut wrote:
> > v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz
> >
> > I think the right way here is actually to go the other way around:
> > Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
> > assignment from src/makefiles/ to src/templates/, have configure read
> > it, and then substitute it into Makefile.global and pg_config.h.
> >
> > Then we also don't have to patch the Windows build code a bunch of
> > times to add the DLSUFFIX define everywhere.
>
> This patch should do it.
> From 763943176a1e0a0c954414ba9da07742ad791656 Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <[email protected]>
> Date: Thu, 24 Mar 2022 16:00:54 +0100
> Subject: [PATCH] Refactor DLSUFFIX handling
>
> Move DLSUFFIX into header files for all platforms. Move the DLSUFFIX
> assignment from src/makefiles/ to src/templates/, have configure read
> it, and then substitute it into Makefile.global and pg_config.h. This
> avoids the need of all users to locally set CPPFLAGS.
Reading through it, this looks good to me. Thanks!
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 44+ messages in thread
end of thread, other threads:[~2023-04-14 15:58 UTC | newest]
Thread overview: 44+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 07:45 [PATCH v2] Fix various shared memory estimates. Julien Rouhaud <[email protected]>
2022-03-08 02:56 Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
2022-03-09 12:37 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-09 16:44 ` Re: [RFC] building postgres with meson -v7 Andres Freund <[email protected]>
2022-03-10 16:31 ` Re: [RFC] building postgres with meson -v7 Peter Eisentraut <[email protected]>
2022-03-22 02:22 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-25 09:01 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-28 19:59 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-03-28 22:44 ` Re: [RFC] building postgres with meson -v8 Andrew Dunstan <[email protected]>
2022-03-28 22:58 ` Re: [RFC] building postgres with meson -v8 Tom Lane <[email protected]>
2022-03-28 23:11 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-13 10:26 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-20 13:09 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-04-29 17:46 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-02 14:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-02 16:36 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-04 11:53 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-06 21:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-06 22:08 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-11 10:11 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-01 04:55 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-01 20:53 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-11 10:18 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-12 19:30 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-16 15:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-16 16:15 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-13 23:17 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-16 15:48 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-16 16:13 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-18 08:30 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-05-18 19:48 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-05-24 18:08 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-06 07:54 ` Re: [RFC] building postgres with meson -v8 Michael Paquier <[email protected]>
2022-06-08 06:27 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-08 12:33 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-14 18:27 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-06-14 18:47 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-06-14 18:51 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-06-14 18:23 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2023-04-14 15:58 ` Re: [RFC] building postgres with meson -v8 Greg Stark <[email protected]>
2022-04-20 21:04 ` Re: [RFC] building postgres with meson -v8 Andres Freund <[email protected]>
2022-04-21 20:36 ` Re: [RFC] building postgres with meson -v8 Peter Eisentraut <[email protected]>
2022-03-24 15:16 ` Re: [RFC] building postgres with meson -v6 Peter Eisentraut <[email protected]>
2022-03-24 15:40 ` Re: [RFC] building postgres with meson -v6 Andres Freund <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox