Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6b1c5ca

Browse files
committed
Remove logging.c from the shared library of src/common/
As fe0a1dc has proved, it is not a good concept to add to libpq dependencies that would enforce the error output to a central logging facility because it breaks the promise of reporting the error back to an application in a consistent way, with the application to potentially exit() suddenly if using pieces from for example jsonapi.c. prairiedog has allowed to report an actual design problem with fe0a1dc, but it will not be around forever, so removing logging.c from libpgcommon_shlib is a simple and much better long-term way to prevent any attempt to load the central logging in libraries with general purposes. Author: Michael Paquier Reviewed-by: Tom Lane Discussion: https://postgr.es/m/20200928073330.GC2316@paquier.xyz
1 parent 7b28913 commit 6b1c5ca

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/common/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,21 @@ OBJS_COMMON += sha2.o
8888
endif
8989

9090
# A few files are currently only built for frontend, not server
91-
# (Mkvcbuild.pm has a copy of this list, too)
92-
OBJS_FRONTEND = \
91+
# (Mkvcbuild.pm has a copy of this list, too). logging.c is excluded
92+
# from OBJS_FRONTEND_SHLIB (shared library) as a matter of policy,
93+
# because it is not appropriate for general purpose libraries such
94+
# as libpq to report errors directly.
95+
OBJS_FRONTEND_SHLIB = \
9396
$(OBJS_COMMON) \
9497
fe_memutils.o \
95-
logging.o \
9698
restricted_token.o \
9799
sprompt.o
100+
OBJS_FRONTEND = \
101+
$(OBJS_FRONTEND_SHLIB) \
102+
logging.o
98103

99104
# foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c
100-
OBJS_SHLIB = $(OBJS_FRONTEND:%.o=%_shlib.o)
105+
OBJS_SHLIB = $(OBJS_FRONTEND_SHLIB:%.o=%_shlib.o)
101106
OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
102107

103108
# where to find gen_keywordlist.pl and subsidiary files

0 commit comments

Comments
 (0)