Page MenuHome GnuPG

gpgme-1-13-1 test failure and errors and build errors
Closed, ResolvedPublic

Description

System:
Dell Precison T5810, Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz, 72 GB RAM, Radeon Pro WX 7100 CentOS 7.8.2003

./configure --prefix=/usr/local/gpgme-1.13.1 --with-libgpg-error-prefix=/usr/local/libgpg-error-1.38 --with-libassuan-prefix=/usr/local/libassuan-2.5.3

resulted in:

GPGME v1.13.1 has been configured as follows:

        Revision:          ea11c2a1  (59921)
        Platform:          x86_64-pc-linux-gnu

        UI Server:         yes
        FD Passing:        yes

        Language bindings: cl cpp python (2.7) qt

Failures during "make check":

t-verify:108: Unexpected number of signatures (got 1 expected  2)
FAIL: t-verify
Wenn Sie dies lesen können, ist es wohl nicht
geheim genug.

Test "strcmp(result1, result2)" in main failed (t-gpgconf.c:281)
FAIL: t-gpgconf
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)

hQEOA1OB6k7im6N/EAP/QRqk8g2z0G7sl2d3rygDvGIfHGac6t2PDLllexvw73fa
Htv+jMRYSP1VIrPkgatGfkcm6JLrQSWoRWCBRzLVmFgVN7e7qJtfL9BrJDT+K1BY
2MKc5lpJd9eNAGrUsYa0Z4HZy1EpY1AjG4PN3aciL586y37WItr/BYa3aSM36gQD
/3vLH9T+tl7A2/3MzWdAwAotWgMXGAh7Qo7SVemW1VXQK8sj7dDZZo9XsZDHzAUK
Ew0CNBXjALh6+cdcvUKHwDt9MRylxiAXW9ulF3gzORcjsyf8yVUWEdZjbXjGNSWa
RZDFN1w2d3wxp2GjkuWSIxabKoBhCPyYTExKvSmh/PHwjC4EAwMC1AAToXhoTmbh
EWXkrdWDDtvHLvigmVw9kZEe1eL8mMF/4ep9AlASxJtO0kcBEDSJkh6MLMVSGKQN
blCsV/rNxF49uCtgd6MC4z8rz5BPZppgnruAUWu9hOeQmnTgYMauHS3CkcvN8oyH
KEuinEpuL48U0g==
=ayDA
-----END PGP MESSAGE-----
Begin Result Decryption:
Hallo Leute
End Result.

Errors during "make check":

make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/.../gnupg/gpgme-1.13.1/tests/gpg'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/.../gnupg/gpgme-1.13.1/tests/gpg'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/.../gnupg/gpgme-1.13.1/tests/gpg'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/.../gnupg/gpgme-1.13.1/tests'
make: *** [check-recursive] Error 1

This happened 2020-06-22 and obviously "make" finished without errors back then. Today 2020-10-01 I get errors in "make":

t-json.c: In function ‘test_contains’:
t-json.c:264:11: error: ‘for’ loop initial declarations are only allowed in C99 mode
           for (cjson_t hit = hay->child; hit; hit = hit->next)
           ^
t-json.c:264:11: note: use option -std=c99 or -std=gnu99 to compile your code
t-json.c:285:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (cjson_t it = needle->next; it; it = it->next)
   ^
t-json.c:313:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
       for (cjson_t hit = hay; hit; hit = hit->next)
       ^
t-json.c: In function ‘main’:
t-json.c:491:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (const char **test = tests; *test; test++)
   ^
t-json.c: At top level:
cc1: warning: unrecognized command line option "-Wno-sizeof-pointer-div" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-format-truncation" [enabled by default]
make[3]: *** [t-json.o] Error 1
make[3]: Leaving directory `/.../gnupg/gpgme-201001/gpgme-1.13.1/tests/json'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/.../gnupg/gpgme-201001/gpgme-1.13.1/tests/json'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/.../gnupg/gpgme-201001/gpgme-1.13.1/tests'
make: *** [all-recursive] Error 1

Details

Version
1.13.1

Revisions and Commits

Event Timeline

The json problem can be overcome by changing the configure line to:

./configure CC=c99 --prefix=/usr/local/gpgme-1.13.1 --with-libgpg-error-prefix=/usr/local/libgpg-error-1.38 --with-libassuan-prefix=/usr/local/libassuan-2.5.3

but then the compilation breaks at:

g++: error: unrecognized command line option '-Wsuggest-override'
make[3]: *** [exception.lo] Error 1
make[3]: Leaving directory `/disk2/gostal/Downloads/gnupg/old/gpgme-201001/gpgme-1.13.1/lang/cpp/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/disk2/gostal/Downloads/gnupg/old/gpgme-201001/gpgme-1.13.1/lang/cpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/disk2/gostal/Downloads/gnupg/old/gpgme-201001/gpgme-1.13.1/lang'
make: *** [all-recursive] Error 1

Incidentally, exactly the same build error occurs for gpgme-1.14.0 but built with libgpg-error-1.39. I have gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) on my system.

Thinking that maybe the gcc version is too old I tried using instead CentOS gcc7 development environment (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) (which doesn't come out of the box). This was an educated guess as c99 is only partially supported in gcc-4.8.5. I have now successfully built:
libgpg-error-1.39
libassuan-2.5.3
gpgme-1.14.0
using gcc 7.3.1. All make check tests have passed.

Perhaps the only relevant observation is that apparently gcc 4.8.5 is too old to handle the latest sources. If this doesn't help anyone there is no point in keeping this bug report open or even publicly available.

Thanks for the report. Indeed, the convenient C99 feature of variable definition in a for statement does only work in recent gcc versions and thus it should not be used in GnuPG related code. (https://gnupg.org/faq/HACKING.html was out of sync with the version in gnupg's master repo which falsely stated that it is an allowed features.)

Thanks for the detailed report; it was easy to fix.

werner claimed this task.
werner added projects: toolchain, gpgme.