Move various files that don't need to be in basic/ to shared/

This doesn't have much effect on the final build, because we link libbasic.a
into libsystemd-shared.so, so in the end, all the object built from basic/
end up in libsystemd-shared. And when the static library is linked into binaries,
any objects that are included in it but are not used are trimmed. Hence, the
size of output artifacts doesn't change:

$ du -sb /var/tmp/inst*
54181861	/var/tmp/inst1    (old)
54207441	/var/tmp/inst1s   (old split-usr)
54182477	/var/tmp/inst2    (new)
54208041	/var/tmp/inst2s   (new split-usr)

(The negligible change in size is because libsystemd-shared.so is bigger
by a few hundred bytes. I guess it's because symbols are named differently
or something like that.)

The effect is on the build process, in particular partial builds. This change
effectively moves the requirements on some build steps toward the leaves of the
dependency tree. Two effects:
- when building items that do not depend on libsystemd-shared, we
  build less stuff for libbasic.a (which wouldn't be used anyway,
  so it's a net win).
- when building items that do depend on libshared, we reduce libbasic.a as a
  synchronization point, possibly allowing better parallelism.

Method:
1. copy list of .h files from src/basic/meson.build to /tmp/basic
2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-11-19 11:12:28 +01:00
parent 278939be7a
commit d284b82b3e
49 changed files with 47 additions and 47 deletions

View File

@ -1666,7 +1666,7 @@ endif
if conf.get('HAVE_BLKID') == 1
executable('systemd-gpt-auto-generator',
'src/gpt-auto-generator/gpt-auto-generator.c',
'src/basic/blkid-util.h',
'src/shared/blkid-util.h',
include_directories : includes,
link_with : [libshared],
dependencies : libblkid,

View File

@ -15,23 +15,14 @@ basic_sources = files('''
async.h
audit-util.c
audit-util.h
barrier.c
barrier.h
bitmap.c
bitmap.h
blkid-util.h
blockdev-util.c
blockdev-util.h
bpf-program.c
bpf-program.h
btrfs-ctree.h
btrfs-util.c
btrfs-util.h
build.h
bus-label.c
bus-label.h
calendarspec.c
calendarspec.h
cap-list.c
cap-list.h
capability-util.c
@ -40,16 +31,10 @@ basic_sources = files('''
cgroup-util.h
chattr-util.c
chattr-util.h
clock-util.c
clock-util.h
conf-files.c
conf-files.h
copy.c
copy.h
cpu-set-util.c
cpu-set-util.h
crypt-util.c
crypt-util.h
def.h
device-nodes.c
device-nodes.h
@ -63,20 +48,12 @@ basic_sources = files('''
escape.h
ether-addr-util.c
ether-addr-util.h
exec-util.c
exec-util.h
exit-status.c
exit-status.h
extract-word.c
extract-word.h
fd-util.c
fd-util.h
fileio-label.c
fileio-label.h
fileio.c
fileio.h
format-table.c
format-table.h
format-util.h
fs-util.c
fs-util.h
@ -97,11 +74,6 @@ basic_sources = files('''
io-util.c
io-util.h
ioprio.h
journal-importer.c
journal-importer.h
json-internal.h
json.c
json.h
khash.c
khash.h
label.c
@ -109,8 +81,6 @@ basic_sources = files('''
list.h
locale-util.c
locale-util.h
lockfile-util.c
lockfile-util.h
log.c
log.h
login-util.c
@ -129,8 +99,6 @@ basic_sources = files('''
nss-util.h
ordered-set.c
ordered-set.h
os-util.c
os-util.h
pager.c
pager.h
parse-util.c
@ -151,17 +119,11 @@ basic_sources = files('''
ratelimit.h
raw-clone.h
raw-reboot.h
reboot-util.c
reboot-util.h
refcnt.h
replace-var.c
replace-var.h
rlimit-util.c
rlimit-util.h
rm-rf.c
rm-rf.h
securebits-util.c
securebits-util.h
securebits.h
selinux-util.c
selinux-util.h
@ -175,8 +137,6 @@ basic_sources = files('''
smack-util.c
smack-util.h
socket-label.c
socket-protocol-list.c
socket-protocol-list.h
socket-util.c
socket-util.h
sparse-endian.h
@ -213,16 +173,10 @@ basic_sources = files('''
utf8.h
util.c
util.h
verbs.c
verbs.h
virt.c
virt.h
web-util.c
web-util.h
xattr-util.c
xattr-util.h
xml.c
xml.h
'''.split())
missing_h = files('missing.h')

View File

@ -8,24 +8,39 @@ shared_sources = files('''
apparmor-util.h
ask-password-api.c
ask-password-api.h
barrier.c
barrier.h
base-filesystem.c
base-filesystem.h
bitmap.c
bitmap.h
blkid-util.h
boot-timestamps.c
boot-timestamps.h
bootspec.c
bootspec.h
bpf-program.c
bpf-program.h
bus-unit-util.c
bus-unit-util.h
bus-util.c
bus-util.h
calendarspec.c
calendarspec.h
cgroup-show.c
cgroup-show.h
clean-ipc.c
clean-ipc.h
clock-util.c
clock-util.h
condition.c
condition.h
conf-parser.c
conf-parser.h
cpu-set-util.c
cpu-set-util.h
crypt-util.c
crypt-util.h
dev-setup.c
dev-setup.h
dissect-image.c
@ -37,9 +52,17 @@ shared_sources = files('''
efivars.c
efivars.h
enable-mempool.c
exec-util.c
exec-util.h
exit-status.c
exit-status.h
fdset.c
fdset.h
fileio-label.c
fileio-label.h
firewall-util.h
format-table.c
format-table.h
fstab-util.c
fstab-util.h
generator.c
@ -56,8 +79,15 @@ shared_sources = files('''
install-printf.h
install.c
install.h
journal-importer.c
journal-importer.h
journal-util.c
journal-util.h
json-internal.h
json.c
json.h
lockfile-util.c
lockfile-util.h
logs-show.c
logs-show.h
loop-util.c
@ -69,19 +99,29 @@ shared_sources = files('''
module-util.h
nsflags.c
nsflags.h
os-util.c
os-util.h
output-mode.c
output-mode.h
path-lookup.c
path-lookup.h
ptyfwd.c
ptyfwd.h
reboot-util.c
reboot-util.h
resolve-util.c
resolve-util.h
rlimit-util.c
rlimit-util.h
seccomp-util.h
securebits-util.c
securebits-util.h
serialize.c
serialize.h
sleep-config.c
sleep-config.h
socket-protocol-list.c
socket-protocol-list.h
spawn-ask-password-agent.c
spawn-ask-password-agent.h
spawn-polkit-agent.c
@ -99,13 +139,19 @@ shared_sources = files('''
uid-range.c
uid-range.h
utmp-wtmp.h
verbs.c
verbs.h
vlan-util.c
vlan-util.h
volatile-util.c
volatile-util.h
watchdog.c
watchdog.h
web-util.c
web-util.h
wireguard-netlink.h
xml.c
xml.h
'''.split())
if get_option('tests') != 'false'