Re: [systemd-devel] New developer building systemd

2021-09-14 Thread Lennart Poettering
On Fr, 10.09.21 17:44, Marcus Harrison (mar...@harrisonland.co.uk) wrote:

> Hey folks,
>
> I've downloaded the systemd sources and am attempting to build with GCC 9.4 on
> KDE Neon and am receiving the build error described in build-error.txt on
> updated main branch (as of writing).
>
> I've patched around it using the change described in
> remove_unused_function.patch, which allows the build to follow through, but
> the test suite has multiple failures, and requires manual intervention
> multiple times - for example, dropping to a BusyBox recovery shell or log-in
> shell, and some of the tests will hang indefinitely.
>
> I'm wondering how much of this is intended, and if my patch broke
> anything.

You are building without libcryptsetup. Apparently this combination of
build options is currently not tested (i.e. repart on, but
libcryptsetup off).


> diff --git a/src/partition/repart.c b/src/partition/repart.c
> index 926dbb2ae4..8ee78c9b08 100644
> --- a/src/partition/repart.c
> +++ b/src/partition/repart.c
> @@ -206,7 +206,7 @@ static const char *encrypt_mode_table[_ENCRYPT_MODE_MAX] 
> = {
>  [ENCRYPT_KEY_FILE_TPM2] = "key-file+tpm2",
>  };
>
> -DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(encrypt_mode, EncryptMode, 
> ENCRYPT_KEY_FILE);
> +DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(encrypt_mode, 
> EncryptMode, ENCRYPT_KEY_FILE);
>

Patch looks OK, but instead of replacing the line unconditionally, it
should be one or the other depending on `#if HAVE_LIBCRYPTSETUP`, so
that it then works in both cases.

Would be delighted if you could submit such a patch via github PR.

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] New developer building systemd

2021-09-13 Thread Cristian Rodríguez
The function is used.. only when HAVE_LIBCRYPTSETUP.

You either need to define it on an #ifdef HAVE_LIBCRYPTSETUP or add add an
__attribute__(__unused__) to it, then the warning will shut up and the
linker may garbage collect it later.



On Fri, Sep 10, 2021 at 12:50 PM Marcus Harrison 
wrote:

> Hey folks,
>
> I've downloaded the systemd sources and am attempting to build with GCC
> 9.4 on
> KDE Neon and am receiving the build error described in build-error.txt on
> updated main branch (as of writing).
>
> I've patched around it using the change described in
> remove_unused_function.patch, which allows the build to follow through,
> but
> the test suite has multiple failures, and requires manual intervention
> multiple times - for example, dropping to a BusyBox recovery shell or
> log-in
> shell, and some of the tests will hang indefinitely.
>
> I'm wondering how much of this is intended, and if my patch broke anything.
>
> Cheers,
> Marcus


Re: [systemd-devel] New developer building systemd

2021-09-10 Thread Marcus Harrison
On Freitag, 10. September 2021 17:44:56 CEST Marcus Harrison wrote:
> Hey folks,
> 
> I've downloaded the systemd sources and am attempting to build with GCC 9.4
> on KDE Neon and am receiving the build error described in build-error.txt
> on updated main branch (as of writing).
> 
> I've patched around it using the change described in
> remove_unused_function.patch, which allows the build to follow through, but
> the test suite has multiple failures, and requires manual intervention
> multiple times - for example, dropping to a BusyBox recovery shell or log-in
> shell, and some of the tests will hang indefinitely.
> 
> I'm wondering how much of this is intended, and if my patch broke anything.
> 
> Cheers,
> Marcus

That's embarrassing - it's GCC 9.3. Sorry for the noise. Questions still 
stand.

Cheers,
Marcus





[systemd-devel] New developer building systemd

2021-09-10 Thread Marcus Harrison
Hey folks,

I've downloaded the systemd sources and am attempting to build with GCC 9.4 on 
KDE Neon and am receiving the build error described in build-error.txt on 
updated main branch (as of writing).

I've patched around it using the change described in 
remove_unused_function.patch, which allows the build to follow through, but 
the test suite has multiple failures, and requires manual intervention 
multiple times - for example, dropping to a BusyBox recovery shell or log-in 
shell, and some of the tests will hang indefinitely.

I'm wondering how much of this is intended, and if my patch broke anything.

Cheers,
MarcusFAILED: systemd-repart@exe/src_partition_repart.c.o
cc -Isystemd-repart@exe -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental 
-I../src/fundamental -Isrc/systemd -I../src/systemd -I../ 
-I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device 
-I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb 
-I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal 
-I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network 
-I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared 
-I/usr/include/blkid -I/usr/include/libfdisk -I/usr/include/uuid 
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch 
-Wextra -std=gnu99 -g -Wno-format-signedness -Wno-missing-field-initializers 
-Wno-unused-parameter -Wdate-time -Wendif-labels -Werror=format=2 
-Werror=implicit-function-declaration -Werror=incompatible-pointer-types 
-Werror=overflow -Werror=return-type -Werror=shift-count-overflow 
-Werror=shift-overflow=2 -Werror=undef -Werror=unused-function -Wfloat-equal 
-Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs 
-Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith 
-Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes 
-Wsuggest-attribute=noreturn -Wwrite-strings -Wno-maybe-uninitialized 
-Wno-unused-result -Werror=missing-declarations -Werror=missing-prototypes 
-fdiagnostics-show-option -ffast-math -fno-common -fno-strict-aliasing 
-fstack-protector -fstack-protector-strong -fvisibility=hidden 
--param=ssp-buffer-size=4 -Werror=shadow -include config.h -pthread -MD -MQ 
'systemd-repart@exe/src_partition_repart.c.o' -MF 
'systemd-repart@exe/src_partition_repart.c.o.d' -o 
'systemd-repart@exe/src_partition_repart.c.o' -c ../src/partition/repart.c
In file included from ../src/partition/repart.c:61:
../src/partition/repart.c:209:49: error: ‘encrypt_mode_to_string’ defined but 
not used [-Werror=unused-function]
  209 | DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(encrypt_mode, 
EncryptMode, ENCRYPT_KEY_FILE);
  | ^~~~
../src/basic/string-table.h:18:27: note: in definition of macro 
‘_DEFINE_STRING_TABLE_LOOKUP_TO_STRING’
   18 | scope const char *name##_to_string(type i) {
\
  |   ^~~~
../src/basic/string-table.h:90:72: note: in expansion of macro 
‘_DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN’
   90 | #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes) 
_DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,static)
  |
^~~~
../src/partition/repart.c:209:1: note: in expansion of macro 
‘DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN’
  209 | DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(encrypt_mode, 
EncryptMode, ENCRYPT_KEY_FILE);
  | ^~~
cc1: some warnings being treated as errors
[22/439] Compiling C object 'systemd-analyze@exe/src_analyze_analyze.c.o'.
ninja: build stopped: subcommand failed.
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 926dbb2ae4..8ee78c9b08 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -206,7 +206,7 @@ static const char *encrypt_mode_table[_ENCRYPT_MODE_MAX] = {
 [ENCRYPT_KEY_FILE_TPM2] = "key-file+tpm2",
 };
 
-DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(encrypt_mode, EncryptMode, ENCRYPT_KEY_FILE);
+DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(encrypt_mode, EncryptMode, ENCRYPT_KEY_FILE);
 
 static uint64_t round_down_size(uint64_t v, uint64_t p) {
 return (v / p) * p;