aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2021-07-02 08:21:04 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2021-07-02 08:21:05 +0000
commit2eb9ad427475190e87d026de4ca7fc296947f2a0 (patch)
treefa5e681f5d5da74087d03e93b0d1c1b0031998be
parentacb1f1269c6f4ff89a0d28ba742f6687e9ef779d (diff)
downloadsrc-2eb9ad427475190e87d026de4ca7fc296947f2a0.tar.gz
src-2eb9ad427475190e87d026de4ca7fc296947f2a0.zip
Simplify and speed up the kyua build
Instead of having multiple kyua libraries, just include the files as part of usr.bin/kyua. Previously, we would build each kyua source up to four times: once as a .o file and once as a .pieo. Additionally, the kyua libraries might be built again for compat32. As all the kyua libraries amount to 102 C++ sources the build time is significant (especially when using an assertions enabled compiler). This change ensures that we build 306 fewer .cpp source files as part of buildworld. Reviewed By: brooks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30967
-rw-r--r--lib/kyua/Makefile10
-rw-r--r--lib/kyua/Makefile.inc20
-rw-r--r--lib/kyua/Makefile.kyua11
-rw-r--r--lib/kyua/cli/Makefile29
-rw-r--r--lib/kyua/drivers/Makefile12
-rw-r--r--lib/kyua/engine/Makefile22
-rw-r--r--lib/kyua/model/Makefile13
-rw-r--r--lib/kyua/store/Makefile18
-rw-r--r--lib/kyua/utils/Makefile65
-rw-r--r--share/mk/src.libnames.mk30
-rw-r--r--usr.bin/kyua/Makefile140
-rw-r--r--usr.bin/kyua/config.h (renamed from lib/kyua/config.h)0
-rw-r--r--usr.bin/kyua/utils/defs.hpp (renamed from lib/kyua/utils/defs.hpp)0
13 files changed, 135 insertions, 235 deletions
diff --git a/lib/kyua/Makefile b/lib/kyua/Makefile
deleted file mode 100644
index 1a1ea8bf5828..000000000000
--- a/lib/kyua/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= cli \
- drivers \
- engine \
- model \
- store \
- utils
-
-.include <bsd.subdir.mk>
diff --git a/lib/kyua/Makefile.inc b/lib/kyua/Makefile.inc
deleted file mode 100644
index 52f19d3140b3..000000000000
--- a/lib/kyua/Makefile.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIBDIR:= ${.PARSEDIR}
-
-.include "${KYUA_LIBDIR}/Makefile.kyua"
-
-LIB_CXX= kyua_${KYUA_LIB}
-INTERNALLIB=
-
-.PATH: ${KYUA_SRCDIR}/${KYUA_LIB}
-CFLAGS+= -I${KYUA_LIBDIR} \
- -I${KYUA_SRCDIR} \
- -I${SRCTOP}/contrib/lutok/include
-
-CFLAGS+= -DHAVE_CONFIG_H
-
-# kyua uses auto_ptr
-CFLAGS+= -Wno-deprecated-declarations
-
-.include "${.PARSEDIR}/../Makefile.inc"
diff --git a/lib/kyua/Makefile.kyua b/lib/kyua/Makefile.kyua
deleted file mode 100644
index 1fd30a135409..000000000000
--- a/lib/kyua/Makefile.kyua
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-
-KYUA_VERSION= 0.13
-
-KYUA_CONFDIR= /etc/kyua
-KYUA_DOCDIR= /usr/share/doc/kyua
-KYUA_EGDIR= /usr/share/examples/kyua
-KYUA_MISCDIR= /usr/share/kyua/misc
-KYUA_STOREDIR= /usr/share/kyua/store
-
-KYUA_SRCDIR= ${SRCTOP}/contrib/kyua
diff --git a/lib/kyua/cli/Makefile b/lib/kyua/cli/Makefile
deleted file mode 100644
index b5de51607c12..000000000000
--- a/lib/kyua/cli/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= cli
-INTERNALLIB=
-LIBADD= kyua_drivers kyua_engine kyua_model kyua_store kyua_utils
-CFLAGS+= -DKYUA_CONFDIR=\"${KYUA_CONFDIR}\" \
- -DKYUA_DOCDIR=\"${KYUA_DOCDIR}\" \
- -DKYUA_MISCDIR=\"${KYUA_MISCDIR}\" \
- -DPACKAGE=\"kyua\" \
- -DPACKAGE_NAME=\"Kyua\" \
- -DPACKAGE_VERSION=\"${KYUA_VERSION}\" \
- -DVERSION=\"${KYUA_VERSION}\"
-
-SRCS= cmd_about.cpp \
- cmd_config.cpp \
- cmd_db_exec.cpp \
- cmd_db_migrate.cpp \
- cmd_debug.cpp \
- cmd_help.cpp \
- cmd_list.cpp \
- cmd_report.cpp \
- cmd_report_html.cpp \
- cmd_report_junit.cpp \
- cmd_test.cpp \
- common.cpp \
- config.cpp \
- main.cpp
-
-.include <bsd.lib.mk>
diff --git a/lib/kyua/drivers/Makefile b/lib/kyua/drivers/Makefile
deleted file mode 100644
index adf9c0601269..000000000000
--- a/lib/kyua/drivers/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= drivers
-LIBADD= kyua_model kyua_engine kyua_store
-
-SRCS= debug_test.cpp \
- list_tests.cpp \
- report_junit.cpp \
- run_tests.cpp \
- scan_results.cpp
-
-.include <bsd.lib.mk>
diff --git a/lib/kyua/engine/Makefile b/lib/kyua/engine/Makefile
deleted file mode 100644
index 4f0c9053c692..000000000000
--- a/lib/kyua/engine/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= engine
-LIBADD= lutok kyua_utils
-CFLAGS= -DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\" \
- -DKYUA_PLATFORM=\"${MACHINE}\"
-
-SRCS= atf.cpp \
- atf_list.cpp \
- atf_result.cpp \
- config.cpp \
- exceptions.cpp \
- filters.cpp \
- kyuafile.cpp \
- plain.cpp \
- requirements.cpp \
- scanner.cpp \
- tap.cpp \
- tap_parser.cpp \
- scheduler.cpp
-
-.include <bsd.lib.mk>
diff --git a/lib/kyua/model/Makefile b/lib/kyua/model/Makefile
deleted file mode 100644
index d4a0b91587e7..000000000000
--- a/lib/kyua/model/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= model
-LIBADD= lutok
-
-SRCS= context.cpp \
- exceptions.cpp \
- metadata.cpp \
- test_case.cpp \
- test_program.cpp \
- test_result.cpp
-
-.include <bsd.lib.mk>
diff --git a/lib/kyua/store/Makefile b/lib/kyua/store/Makefile
deleted file mode 100644
index 39753691873e..000000000000
--- a/lib/kyua/store/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= store
-LIBADD= kyua_model kyua_utils sqlite3
-
-CFLAGS+= -DKYUA_STOREDIR=\"${KYUA_STOREDIR}\"
-
-SRCS= dbtypes.cpp \
- exceptions.cpp \
- layout.cpp \
- metadata.cpp \
- migrate.cpp \
- read_backend.cpp \
- read_transaction.cpp \
- write_backend.cpp \
- write_transaction.cpp
-
-.include <bsd.lib.mk>
diff --git a/lib/kyua/utils/Makefile b/lib/kyua/utils/Makefile
deleted file mode 100644
index 740b395d6951..000000000000
--- a/lib/kyua/utils/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# $FreeBSD$
-
-KYUA_LIB= utils
-LIBADD= lutok
-
-CFLAGS+= -I${SRCTOP}/contrib/sqlite3
-CFLAGS+= -DGDB=\"/usr/local/bin/gdb\"
-
-SRCS= datetime.cpp \
- env.cpp \
- memory.cpp \
- passwd.cpp \
- sanity.cpp \
- stacktrace.cpp \
- stream.cpp \
- units.cpp \
- cmdline/base_command.cpp \
- cmdline/exceptions.cpp \
- cmdline/globals.cpp \
- cmdline/options.cpp \
- cmdline/parser.cpp \
- cmdline/ui.cpp \
- cmdline/ui_mock.cpp \
- config/exceptions.cpp \
- config/keys.cpp \
- config/lua_module.cpp \
- config/nodes.cpp \
- config/parser.cpp \
- config/tree.cpp \
- format/exceptions.cpp \
- format/formatter.cpp \
- fs/auto_cleaners.cpp \
- fs/directory.cpp \
- fs/exceptions.cpp \
- fs/lua_module.cpp \
- fs/operations.cpp \
- fs/path.cpp \
- logging/operations.cpp \
- process/child.cpp \
- process/deadline_killer.cpp \
- process/exceptions.cpp \
- process/executor.cpp \
- process/fdstream.cpp \
- process/isolation.cpp \
- process/operations.cpp \
- process/status.cpp \
- process/system.cpp \
- process/systembuf.cpp \
- signals/exceptions.cpp \
- signals/interrupts.cpp \
- signals/misc.cpp \
- signals/programmer.cpp \
- signals/timer.cpp \
- sqlite/c_gate.cpp \
- sqlite/database.cpp \
- sqlite/exceptions.cpp \
- sqlite/statement.cpp \
- sqlite/transaction.cpp \
- text/exceptions.cpp \
- text/operations.cpp \
- text/regex.cpp \
- text/table.cpp \
- text/templates.cpp \
-
-.include <bsd.lib.mk>
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 61373dceb4d1..2db4a0dee4d8 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -41,12 +41,6 @@ _INTERNALLIBS= \
fifolog \
ifconfig \
ipf \
- kyua_cli \
- kyua_drivers \
- kyua_engine \
- kyua_model \
- kyua_store \
- kyua_utils \
lpr \
lua \
lutok \
@@ -286,12 +280,6 @@ _DP_bsnmp= crypto
_DP_geom= bsdxml sbuf
_DP_cam= sbuf
_DP_kvm= elf
-_DP_kyua_cli= kyua_drivers kyua_engine kyua_model kyua_store kyua_utils
-_DP_kyua_drivers= kyua_model kyua_engine kyua_store
-_DP_kyua_engine= lutok kyua_utils
-_DP_kyua_model= lutok
-_DP_kyua_utils= lutok
-_DP_kyua_store= kyua_model kyua_utils sqlite3
_DP_casper= nv
_DP_cap_dns= nv
_DP_cap_fileargs= nv
@@ -510,24 +498,6 @@ _LIB_OBJTOP?= ${OBJTOP}
LIBELFTCDIR= ${_LIB_OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a
-LIBKYUA_CLIDIR= ${_LIB_OBJTOP}/lib/kyua/cli
-LIBKYUA_CLI?= ${LIBKYUA_CLIDIR}/libkyua_cli${PIE_SUFFIX}.a
-
-LIBKYUA_DRIVERSDIR= ${_LIB_OBJTOP}/lib/kyua/drivers
-LIBKYUA_DRIVERS?= ${LIBKYUA_DRIVERSDIR}/libkyua_drivers${PIE_SUFFIX}.a
-
-LIBKYUA_ENGINEDIR= ${_LIB_OBJTOP}/lib/kyua/engine
-LIBKYUA_ENGINE?= ${LIBKYUA_ENGINEDIR}/libkyua_engine${PIE_SUFFIX}.a
-
-LIBKYUA_MODELDIR= ${_LIB_OBJTOP}/lib/kyua/model
-LIBKYUA_MODEL?= ${LIBKYUA_MODELDIR}/libkyua_model${PIE_SUFFIX}.a
-
-LIBKYUA_STOREDIR= ${_LIB_OBJTOP}/lib/kyua/store
-LIBKYUA_STORE?= ${LIBKYUA_STOREDIR}/libkyua_store${PIE_SUFFIX}.a
-
-LIBKYUA_UTILSDIR= ${_LIB_OBJTOP}/lib/kyua/utils
-LIBKYUA_UTILS?= ${LIBKYUA_UTILSDIR}/libkyua_utils${PIE_SUFFIX}.a
-
LIBLUADIR= ${_LIB_OBJTOP}/lib/liblua
LIBLUA?= ${LIBLUADIR}/liblua${PIE_SUFFIX}.a
diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile
index e27c8603f11b..966927709a06 100644
--- a/usr.bin/kyua/Makefile
+++ b/usr.bin/kyua/Makefile
@@ -2,14 +2,20 @@
.include <src.opts.mk>
-.include "${SRCTOP}/lib/kyua/Makefile.kyua"
-
+KYUA_CONFDIR= /etc/kyua
+KYUA_DOCDIR= /usr/share/doc/kyua
+KYUA_EGDIR= /usr/share/examples/kyua
+KYUA_MISCDIR= /usr/share/kyua/misc
+KYUA_STOREDIR= /usr/share/kyua/store
+KYUA_VERSION= 0.13
+
+KYUA_SRCDIR= ${SRCTOP}/contrib/kyua
.PATH: ${KYUA_SRCDIR}
PACKAGE= tests
PROG_CXX= kyua
SRCS= main.cpp
-LIBADD= kyua_cli kyua_drivers kyua_engine kyua_model kyua_store
+LIBADD= lutok sqlite3
MAN= kyua-about.1 \
kyua-config.1 \
@@ -26,10 +32,134 @@ MAN= kyua-about.1 \
kyua.conf.5 \
kyuafile.5
-CFLAGS+= -I${KYUA_SRCDIR}
-
+CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR}
+CFLAGS+= -I${SRCTOP}/contrib/lutok/include
+CFLAGS+= -I${SRCTOP}/contrib/sqlite3
# kyua uses auto_ptr
CFLAGS+= -Wno-deprecated-declarations
+CFLAGS+= -DHAVE_CONFIG_H
+
+# We compile the kyua libraries as part of the main executable as this saves
+# compile time and we don't install them anyway.
+CFLAGS+= -DGDB=\"/usr/local/bin/gdb\" \
+ -DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\" \
+ -DKYUA_CONFDIR=\"${KYUA_CONFDIR}\" \
+ -DKYUA_DOCDIR=\"${KYUA_DOCDIR}\" \
+ -DKYUA_MISCDIR=\"${KYUA_MISCDIR}\" \
+ -DKYUA_PLATFORM=\"${MACHINE}\" \
+ -DKYUA_STOREDIR=\"${KYUA_STOREDIR}\" \
+ -DPACKAGE=\"kyua\" \
+ -DPACKAGE_NAME=\"Kyua\" \
+ -DPACKAGE_VERSION=\"${KYUA_VERSION}\" \
+ -DVERSION=\"${KYUA_VERSION}\"
+
+SRCS+= utils/datetime.cpp \
+ utils/env.cpp \
+ utils/memory.cpp \
+ utils/passwd.cpp \
+ utils/sanity.cpp \
+ utils/stacktrace.cpp \
+ utils/stream.cpp \
+ utils/units.cpp \
+ utils/cmdline/base_command.cpp \
+ utils/cmdline/exceptions.cpp \
+ utils/cmdline/globals.cpp \
+ utils/cmdline/options.cpp \
+ utils/cmdline/parser.cpp \
+ utils/cmdline/ui.cpp \
+ utils/cmdline/ui_mock.cpp \
+ utils/config/exceptions.cpp \
+ utils/config/keys.cpp \
+ utils/config/lua_module.cpp \
+ utils/config/nodes.cpp \
+ utils/config/parser.cpp \
+ utils/config/tree.cpp \
+ utils/format/exceptions.cpp \
+ utils/format/formatter.cpp \
+ utils/fs/auto_cleaners.cpp \
+ utils/fs/directory.cpp \
+ utils/fs/exceptions.cpp \
+ utils/fs/lua_module.cpp \
+ utils/fs/operations.cpp \
+ utils/fs/path.cpp \
+ utils/logging/operations.cpp \
+ utils/process/child.cpp \
+ utils/process/deadline_killer.cpp \
+ utils/process/exceptions.cpp \
+ utils/process/executor.cpp \
+ utils/process/fdstream.cpp \
+ utils/process/isolation.cpp \
+ utils/process/operations.cpp \
+ utils/process/status.cpp \
+ utils/process/system.cpp \
+ utils/process/systembuf.cpp \
+ utils/signals/exceptions.cpp \
+ utils/signals/interrupts.cpp \
+ utils/signals/misc.cpp \
+ utils/signals/programmer.cpp \
+ utils/signals/timer.cpp \
+ utils/sqlite/c_gate.cpp \
+ utils/sqlite/database.cpp \
+ utils/sqlite/exceptions.cpp \
+ utils/sqlite/statement.cpp \
+ utils/sqlite/transaction.cpp \
+ utils/text/exceptions.cpp \
+ utils/text/operations.cpp \
+ utils/text/regex.cpp \
+ utils/text/table.cpp \
+ utils/text/templates.cpp
+
+SRCS+= model/context.cpp \
+ model/exceptions.cpp \
+ model/metadata.cpp \
+ model/test_case.cpp \
+ model/test_program.cpp \
+ model/test_result.cpp
+
+SRCS+= engine/atf.cpp \
+ engine/atf_list.cpp \
+ engine/atf_result.cpp \
+ engine/config.cpp \
+ engine/exceptions.cpp \
+ engine/filters.cpp \
+ engine/kyuafile.cpp \
+ engine/plain.cpp \
+ engine/requirements.cpp \
+ engine/scanner.cpp \
+ engine/tap.cpp \
+ engine/tap_parser.cpp \
+ engine/scheduler.cpp
+
+SRCS+= store/dbtypes.cpp \
+ store/exceptions.cpp \
+ store/layout.cpp \
+ store/metadata.cpp \
+ store/migrate.cpp \
+ store/read_backend.cpp \
+ store/read_transaction.cpp \
+ store/write_backend.cpp \
+ store/write_transaction.cpp
+
+SRCS+= drivers/debug_test.cpp \
+ drivers/list_tests.cpp \
+ drivers/report_junit.cpp \
+ drivers/run_tests.cpp \
+ drivers/scan_results.cpp
+
+SRCS+= cli/cmd_about.cpp \
+ cli/cmd_config.cpp \
+ cli/cmd_db_exec.cpp \
+ cli/cmd_db_migrate.cpp \
+ cli/cmd_debug.cpp \
+ cli/cmd_help.cpp \
+ cli/cmd_list.cpp \
+ cli/cmd_report.cpp \
+ cli/cmd_report_html.cpp \
+ cli/cmd_report_junit.cpp \
+ cli/cmd_test.cpp \
+ cli/common.cpp \
+ cli/config.cpp \
+ cli/main.cpp
FILESGROUPS= DOCS MISC STORE
diff --git a/lib/kyua/config.h b/usr.bin/kyua/config.h
index 132972229364..132972229364 100644
--- a/lib/kyua/config.h
+++ b/usr.bin/kyua/config.h
diff --git a/lib/kyua/utils/defs.hpp b/usr.bin/kyua/utils/defs.hpp
index 32d1f9bb2344..32d1f9bb2344 100644
--- a/lib/kyua/utils/defs.hpp
+++ b/usr.bin/kyua/utils/defs.hpp