Skip to content

Commit fc9a62a

Browse files
committed
Move logging.h and logging.c from src/fe_utils/ to src/common/.
The original placement of this module in src/fe_utils/ is ill-considered, because several src/common/ modules have dependencies on it, meaning that libpgcommon and libpgfeutils now have mutual dependencies. That makes it pointless to have distinct libraries at all. The intended design is that libpgcommon is lower-level than libpgfeutils, so only dependencies from the latter to the former are acceptable. We already have the precedent that fe_memutils and a couple of other modules in src/common/ are frontend-only, so it's not stretching anything out of whack to treat logging.c as a frontend-only module in src/common/. To the extent that such modules help provide a common frontend/backend environment for the rest of common/ to use, it's a reasonable design. (logging.c does not yet provide an ereport() emulation, but one can dream.) Hence, move these files over, and revert basically all of the build-system changes made by commit cc8d415. There are no places that need to grow new dependencies on libpgcommon, further reinforcing the idea that this is the right solution. Discussion: https://postgr.es/m/[email protected]
1 parent b71dad2 commit fc9a62a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+102
-115
lines changed

src/bin/initdb/initdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
#include "catalog/pg_collation_d.h"
6666
#include "common/file_perm.h"
6767
#include "common/file_utils.h"
68+
#include "common/logging.h"
6869
#include "common/restricted_token.h"
6970
#include "common/username.h"
70-
#include "fe_utils/logging.h"
7171
#include "fe_utils/string_utils.h"
7272
#include "getaddrinfo.h"
7373
#include "getopt_long.h"

src/bin/pg_archivecleanup/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ subdir = src/bin/pg_archivecleanup
77
top_builddir = ../../..
88
include $(top_builddir)/src/Makefile.global
99

10-
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils
11-
1210
OBJS = pg_archivecleanup.o $(WIN32RES)
1311

1412
all: pg_archivecleanup
1513

16-
pg_archivecleanup: $(OBJS) | submake-libpgport submake-libpgfeutils
14+
pg_archivecleanup: $(OBJS) | submake-libpgport
1715
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
1816

1917
install: all installdirs

src/bin/pg_archivecleanup/pg_archivecleanup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "pg_getopt.h"
1919

20-
#include "fe_utils/logging.h"
20+
#include "common/logging.h"
2121

2222
#include "access/xlog_internal.h"
2323

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include "access/xlog_internal.h"
3030
#include "common/file_perm.h"
3131
#include "common/file_utils.h"
32+
#include "common/logging.h"
3233
#include "common/string.h"
33-
#include "fe_utils/logging.h"
3434
#include "fe_utils/string_utils.h"
3535
#include "getopt_long.h"
3636
#include "libpq-fe.h"

src/bin/pg_basebackup/pg_receivewal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <unistd.h>
2121

2222
#include "common/file_perm.h"
23-
#include "fe_utils/logging.h"
23+
#include "common/logging.h"
2424
#include "libpq-fe.h"
2525
#include "access/xlog_internal.h"
2626
#include "getopt_long.h"

src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "access/xlog_internal.h"
2626
#include "common/file_perm.h"
2727
#include "common/fe_memutils.h"
28-
#include "fe_utils/logging.h"
28+
#include "common/logging.h"
2929
#include "getopt_long.h"
3030
#include "libpq-fe.h"
3131
#include "libpq/pqsignal.h"

src/bin/pg_basebackup/receivelog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "libpq-fe.h"
2828
#include "access/xlog_internal.h"
2929
#include "common/file_utils.h"
30-
#include "fe_utils/logging.h"
30+
#include "common/logging.h"
3131

3232

3333
/* fd and filename for currently open WAL file */

src/bin/pg_basebackup/streamutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include "access/xlog_internal.h"
2525
#include "common/fe_memutils.h"
2626
#include "common/file_perm.h"
27+
#include "common/logging.h"
2728
#include "datatype/timestamp.h"
2829
#include "fe_utils/connect.h"
29-
#include "fe_utils/logging.h"
3030
#include "port/pg_bswap.h"
3131
#include "pqexpbuffer.h"
3232

src/bin/pg_checksums/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ subdir = src/bin/pg_checksums
1515
top_builddir = ../../..
1616
include $(top_builddir)/src/Makefile.global
1717

18-
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils
19-
2018
OBJS= pg_checksums.o $(WIN32RES)
2119

2220
all: pg_checksums
2321

24-
pg_checksums: $(OBJS) | submake-libpgport submake-libpgfeutils
22+
pg_checksums: $(OBJS) | submake-libpgport
2523
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
2624

2725
install: all installdirs

src/bin/pg_checksums/pg_checksums.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "common/controldata_utils.h"
2424
#include "common/file_perm.h"
2525
#include "common/file_utils.h"
26-
#include "fe_utils/logging.h"
26+
#include "common/logging.h"
2727
#include "getopt_long.h"
2828
#include "pg_getopt.h"
2929
#include "storage/bufpage.h"

0 commit comments

Comments
 (0)