[systemd-commits] 4 commits - .gitignore Makefile.am src/libsystemd-bus src/python-systemd

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Tue Nov 12 16:05:54 PST 2013


 .gitignore                            |    4 
 Makefile.am                           |  137 +++++++++++++++++++++++++++++-----
 src/libsystemd-bus/libsystemd-bus.sym |    6 -
 src/python-systemd/_daemon.c          |    2 
 src/python-systemd/docs/daemon.rst    |    2 
 5 files changed, 129 insertions(+), 22 deletions(-)

New commits:
commit 9173a3082f019f78b02efe8c0642a88e36b7bd44
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Nov 12 19:02:28 2013 -0500

    build-sys: parallelize 'exported' target

diff --git a/.gitignore b/.gitignore
index eeb373f..458cea5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 /defined
 /undefined
 /exported
+/exported-*
 /TAGS
 /accelerometer
 /ata_id
diff --git a/Makefile.am b/Makefile.am
index f4bfe66..f2d7a69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4667,10 +4667,11 @@ valgrind-tests: $(TESTS)
 	        libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=4194400 --error-exitcode=55 $(builddir)/$$f ; \
 	done
 
-exported: $(lib_LTLIBRARIES)
-	$(AM_V_GEN)for f in $(lib_LTLIBRARIES:.la=.so) ; do \
-		nm -g --defined-only $(builddir)/.libs/"$$f" 2>&1 /dev/null | grep " T " | cut -d" " -f3 ; \
-	done > $@
+exported-%: %
+	$(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
+
+exported: $(addprefix exported-, $(lib_LTLIBRARIES))
+	$(AM_V_GEN)cat $^ > $@
 
 check-api-docs: exported man
 	$(AM_V_GEN)for symbol in `cat exported` ; do \

commit a23873387a6e722b711092c89a08ab3f3d19361c
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Nov 11 19:53:59 2013 -0500

    systemd-python: fix booted() and add two functions to docs
    
    For some reason sphinx doesn't want to show inherited C functions.

diff --git a/src/python-systemd/_daemon.c b/src/python-systemd/_daemon.c
index 6b84fb8..f0ab16f 100644
--- a/src/python-systemd/_daemon.c
+++ b/src/python-systemd/_daemon.c
@@ -51,7 +51,7 @@ static PyObject* booted(PyObject *self, PyObject *args) {
         assert(args == NULL);
 
         r = sd_booted();
-        if (set_error(r, NULL, NULL))
+        if (set_error(r, NULL, NULL) < 0)
                 return NULL;
 
         return PyBool_FromLong(r);
diff --git a/src/python-systemd/docs/daemon.rst b/src/python-systemd/docs/daemon.rst
index 72280ca..0ad11ed 100644
--- a/src/python-systemd/docs/daemon.rst
+++ b/src/python-systemd/docs/daemon.rst
@@ -14,3 +14,5 @@
    .. autofunction:: _is_socket_unix
    .. autofunction:: _is_socket_inet
    .. autofunction:: _is_mq
+   .. autofunction:: notify
+   .. autofunction:: booted

commit dc579853d429d15fba611213c4c0e8ab524e831b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Nov 11 19:32:34 2013 -0500

    build-sys: make public libraries depend on .sym files
    
    This way modyfing the .sym file causes a rebuild.

diff --git a/Makefile.am b/Makefile.am
index 151c4cc..f4bfe66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1881,6 +1881,7 @@ systemd_tty_ask_password_agent_LDADD = \
 
 # ------------------------------------------------------------------------------
 libsystemd_daemon_la_SOURCES = \
+	src/libsystemd-daemon/libsystemd-daemon.sym \
 	src/libsystemd-daemon/sd-daemon.c
 
 libsystemd_daemon_internal_la_SOURCES = \
@@ -1926,11 +1927,11 @@ pkgconfiglib_DATA += \
 	src/libsystemd-daemon/libsystemd-daemon.pc
 
 EXTRA_DIST += \
-	src/libsystemd-daemon/libsystemd-daemon.pc.in \
-	src/libsystemd-daemon/libsystemd-daemon.sym
+	src/libsystemd-daemon/libsystemd-daemon.pc.in
 
 # ------------------------------------------------------------------------------
 libsystemd_bus_la_SOURCES = \
+	src/libsystemd-bus/libsystemd-bus.sym \
 	src/systemd/sd-bus.h \
 	src/systemd/sd-bus-protocol.h \
 	src/systemd/sd-bus-vtable.h \
@@ -1991,8 +1992,7 @@ pkgconfiglib_DATA += \
 	src/libsystemd-bus/libsystemd-bus.pc
 
 EXTRA_DIST += \
-	src/libsystemd-bus/libsystemd-bus.pc.in \
-	src/libsystemd-bus/libsystemd-bus.sym
+	src/libsystemd-bus/libsystemd-bus.pc.in
 
 lib_LTLIBRARIES += \
 	libsystemd-bus.la
@@ -2220,6 +2220,7 @@ lib_LTLIBRARIES += \
 	libudev.la
 
 libudev_la_SOURCES =\
+	src/libudev/libudev.sym \
 	src/libudev/libudev-private.h \
 	src/libudev/libudev.c \
 	src/libudev/libudev-list.c \
@@ -2249,8 +2250,7 @@ pkgconfiglib_DATA += \
 	src/libudev/libudev.pc
 
 EXTRA_DIST += \
-	src/libudev/libudev.pc.in \
-	src/libudev/libudev.sym
+	src/libudev/libudev.pc.in
 
 CLEANFILES += \
 	src/libudev/libudev.pc \
@@ -2802,6 +2802,7 @@ udevlibexec_PROGRAMS += \
 
 # ------------------------------------------------------------------------------
 libsystemd_id128_la_SOURCES = \
+	src/libsystemd-id128/libsystemd-id128.sym \
 	src/libsystemd-id128/sd-id128.c
 
 libsystemd_id128_la_CFLAGS = \
@@ -2853,8 +2854,7 @@ INSTALL_EXEC_HOOKS += libsystemd-id128-install-hook
 UNINSTALL_EXEC_HOOKS += libsystemd-id128-uninstall-hook
 
 EXTRA_DIST += \
-	src/libsystemd-id128/libsystemd-id128.pc.in \
-	src/libsystemd-id128/libsystemd-id128.sym
+	src/libsystemd-id128/libsystemd-id128.pc.in
 
 # ------------------------------------------------------------------------------
 
@@ -2984,6 +2984,7 @@ test_catalog_LDADD = \
 	libsystemd-journal-core.la
 
 libsystemd_journal_la_SOURCES = \
+	src/journal/libsystemd-journal.sym \
 	src/journal/sd-journal.c \
 	src/systemd/sd-journal.h \
 	src/systemd/_sd-common.h \
@@ -3201,7 +3202,6 @@ SYSINIT_TARGET_WANTS += \
 
 EXTRA_DIST += \
 	src/journal/libsystemd-journal.pc.in \
-	src/journal/libsystemd-journal.sym \
 	units/systemd-journald.service.in \
 	units/systemd-journal-flush.service.in \
 	src/journal/journald-gperf.gperf
@@ -4006,6 +4006,7 @@ tests += \
 	test-login-shared
 
 libsystemd_login_la_SOURCES = \
+	src/login/libsystemd-login.sym \
 	src/login/sd-login.c \
 	src/systemd/sd-login.h \
 	src/login/login-shared.c \
@@ -4141,7 +4142,6 @@ polkitpolicy_in_files += \
 EXTRA_DIST += \
 	src/login/logind-gperf.gperf \
 	src/login/libsystemd-login.pc.in \
-	src/login/libsystemd-login.sym \
 	src/login/71-seat.rules.in \
 	src/login/73-seat-late.rules.in \
 	units/systemd-logind.service.in \

commit f1e0c18340acb7df53d5b638846fe5687255dad0
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Nov 10 22:17:25 2013 -0500

    build-sys: add a link test for exported symbols
    
    I know that this is a pretty big net to catch some small fish,
    but we *do* regularly forget to properly export symbols that
    were supposed to be exported.
    
    This time sd_bus_get_current and some renamed symbols are caught.

diff --git a/.gitignore b/.gitignore
index cf9bb6d..eeb373f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 /Makefile
 /defined
 /undefined
+/exported
 /TAGS
 /accelerometer
 /ata_id
@@ -156,6 +157,8 @@
 /test-utf8
 /test-util
 /test-watchdog
+/test-libsystemd-*-sym*
+/test-libudev-sym*
 /timedatectl
 /udevadm
 /v4l_id
diff --git a/Makefile.am b/Makefile.am
index ce47171..151c4cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4662,23 +4662,24 @@ install-tree: all
 # Let's run all tests of the test suite, but under valgrind. Let's
 # exclude the one perl script we have in there
 valgrind-tests: $(TESTS)
-	for f in $(TESTS) ; do \
-		[ "$$f" == "$${f/.pl/}" ] && libtool --mode=execute valgrind --leak-check=full --error-exitcode=55 $(builddir)/$$f ; \
+	$(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
+		echo "Running $$f"; \
+	        libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=4194400 --error-exitcode=55 $(builddir)/$$f ; \
 	done
 
 exported: $(lib_LTLIBRARIES)
-	$(AM_V_GEN)for f in $(lib_LTLIBRARIES) ; do \
-		nm -g --defined-only $(builddir)/.libs/"$${f/.la/.so}" 2>&1 /dev/null | grep " T " | cut -d" " -f3 ; \
+	$(AM_V_GEN)for f in $(lib_LTLIBRARIES:.la=.so) ; do \
+		nm -g --defined-only $(builddir)/.libs/"$$f" 2>&1 /dev/null | grep " T " | cut -d" " -f3 ; \
 	done > $@
 
 check-api-docs: exported man
-	for symbol in `cat exported` ; do \
+	$(AM_V_GEN)for symbol in `cat exported` ; do \
 		if test -f $(builddir)/man/$$symbol.html ; then \
 			echo "  Symbol $$symbol() is documented." ; \
 		else \
 			echo "‣ Symbol $$symbol() lacks documentation." ; \
 		fi ; \
-	 done
+	done
 
 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
@@ -4694,3 +4695,102 @@ CLEANFILES += \
 
 check-api-unused: defined undefined exported
 	( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
+
+# Stupid test that everything purported to be exported really is
+
+define generate-sym-test
+	$(AM_V_at)$(MKDIR_P) $(dir $@)
+	$(AM_V_at)echo '#include <stdio.h>' > $@
+	$(AM_V_at)for file in $(notdir $(filter %.h, $^)); do \
+		echo "#include \"$$file\""; \
+	done >> $@
+	$(AM_V_at)echo 'void* functions[] = {' >> $@
+	$(AM_V_GEN)sed -r -n 's/^( +[a-zA-Z0-9_]+);/\1,/p' $< >> $@
+	$(AM_V_at)echo '};' >> $@
+	$(AM_V_at)echo 'int main(void) {' >> $@
+	$(AM_V_at)echo ' unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%p\n", functions[i]);' >> $@
+	$(AM_V_at)echo 'return 0; }' >> $@
+endef
+
+test-libsystemd-bus-sym.c: \
+	src/libsystemd-bus/libsystemd-bus.sym \
+	src/systemd/sd-bus.h \
+	src/systemd/sd-utf8.h \
+	Makefile
+	$(generate-sym-test)
+
+test-libsystemd-daemon-sym.c: \
+	src/libsystemd-daemon/libsystemd-daemon.sym \
+	src/systemd/sd-daemon.h \
+	Makefile
+	$(generate-sym-test)
+
+test-libsystemd-id128-sym.c: \
+	src/libsystemd-id128/libsystemd-id128.sym \
+	src/systemd/sd-id128.h \
+	Makefile
+	$(generate-sym-test)
+
+test-libsystemd-journal-sym.c: \
+	src/journal/libsystemd-journal.sym \
+	src/systemd/sd-journal.h \
+	Makefile
+	$(generate-sym-test)
+
+test-libsystemd-login-sym.c: \
+	src/login/libsystemd-login.sym \
+	src/systemd/sd-login.h \
+	Makefile
+	$(generate-sym-test)
+
+test-libudev-sym.c: \
+	src/libudev/libudev.sym \
+	src/udev/udev.h \
+	Makefile
+	$(generate-sym-test)
+
+test_libsystemd_bus_sym_SOURCES = \
+	test-libsystemd-bus-sym.c
+test_libsystemd_bus_sym_LDADD = \
+	libsystemd-bus.la
+
+test_libsystemd_daemon_sym_SOURCES = \
+	test-libsystemd-daemon-sym.c
+test_libsystemd_daemon_sym_LDADD = \
+	libsystemd-daemon.la
+
+test_libsystemd_id128_sym_SOURCES = \
+	test-libsystemd-id128-sym.c
+test_libsystemd_id128_sym_LDADD = \
+	libsystemd-id128.la
+
+test_libsystemd_journal_sym_SOURCES = \
+	test-libsystemd-journal-sym.c
+test_libsystemd_journal_sym_LDADD = \
+	libsystemd-journal.la
+
+test_libsystemd_login_sym_SOURCES = \
+	test-libsystemd-login-sym.c
+test_libsystemd_login_sym_LDADD = \
+	libsystemd-login.la
+
+test_libudev_sym_SOURCES = \
+	test-libudev-sym.c
+test_libudev_sym_LDADD = \
+	libudev.la
+
+BUILT_SOURCES += \
+	$(test_libsystemd_bus_sym_SOURCES) \
+	$(test_libsystemd_daemon_sym_SOURCES) \
+	$(test_libsystemd_id128_sym_SOURCES) \
+	$(test_libsystemd_journal_sym_SOURCES) \
+	$(test_libsystemd_login_sym_SOURCES) \
+	$(test_libudev_sym_SOURCES)
+
+tests += \
+	test-libsystemd-bus-sym \
+	test-libsystemd-daemon-sym \
+	test-libsystemd-id128-sym \
+	test-libsystemd-journal-sym \
+	test-libsystemd-login-sym \
+	test-libudev-sym
diff --git a/src/libsystemd-bus/libsystemd-bus.sym b/src/libsystemd-bus/libsystemd-bus.sym
index 8f1dba2..f1abf01 100644
--- a/src/libsystemd-bus/libsystemd-bus.sym
+++ b/src/libsystemd-bus/libsystemd-bus.sym
@@ -41,9 +41,9 @@ global:
         sd_bus_can_send;
         sd_bus_get_server_id;
         sd_bus_send;
-        sd_bus_send_with_reply;
-        sd_bus_send_with_reply_cancel;
-        sd_bus_send_with_reply_and_block;
+        sd_bus_call;
+        sd_bus_call_async;
+        sd_bus_call_async_cancel;
         sd_bus_get_fd;
         sd_bus_get_events;
         sd_bus_get_timeout;



More information about the systemd-commits mailing list