i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
921 stars 404 forks source link

Build fails if git is configured with log.showSignature=true #205

Closed sersorrel closed 5 years ago

sersorrel commented 5 years ago

I originally reported this issue against i3lock-color (see PandorasFox/i3lock-color#107), but it appears to also affect i3lock itself, since the build configuration is shared.


This issue is a....

[x] Bug
[ ] Other kind of issue (Please describe in detail)

Current Behavior

Running ./configure fails if you have configured git to always show PGP signatures:

checking whether the C compiler works... no
configure: error: in `/home/josh/src/i3lock-color/x86_64-pc-linux-gnu':
configure: error: C compiler cannot create executables
See `config.log' for more details

The interesting bit of config.log:

configure:4339: checking whether the C compiler works
configure:4361: gcc  -g -O0   conftest.c  >&5
conftest.c:10:24: warning: missing terminating " character
 #define I3LOCK_VERSION "2.12.c (gpg: Signature made Tue Oct  2 16:02:18 2018 BST
                        ^
conftest.c:11:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
 gpg:                using RSA key 00C8F58D8627B3D1D8EDF4CB55DB77C2A03E1EF5
    ^
conftest.c:11:35: error: invalid suffix "C8F58D8627B3D1D8EDF4CB55DB77C2A03E1EF5" on integer constant
 gpg:                using RSA key 00C8F58D8627B3D1D8EDF4CB55DB77C2A03E1EF5
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
conftest.c:12:9: warning: missing terminating ' character
 gpg: Can't check signature: No public key
         ^
conftest.c:12:9: error: missing terminating ' character
 gpg: Can't check signature: No public key
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
conftest.c:13:20: error: stray '\' in program
 2018-10-02, branch \"tags/2.12.c\")"
                    ^
configure:4365: $? = 1
configure:4403: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "i3lock-color"
| #define PACKAGE_TARNAME "i3lock-color"
| #define PACKAGE_VERSION "2.10"
| #define PACKAGE_STRING "i3lock-color 2.10"
| #define PACKAGE_BUGREPORT "https://github.com/chrjguill/i3lock-color/issues"
| #define PACKAGE_URL ""
| #define PACKAGE "i3lock-color"
| #define VERSION "2.10"
| #define I3LOCK_VERSION "2.12.c (gpg: Signature made Tue Oct  2 16:02:18 2018 BST
| gpg:                using RSA key 00C8F58D8627B3D1D8EDF4CB55DB77C2A03E1EF5
| gpg: Can't check signature: No public key
| 2018-10-02, branch \"tags/2.12.c\")"
| /* end confdefs.h.  */

It looks like the problem is on line 35 of configure.ac:

        I3LOCK_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} log --pretty=format:%cd --date=short -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")"

Adding --no-show-signature would fix the problem, but really you shouldn't be using git log – it's a "porcelain" command, so its output format is liable to change. Instead, probably git rev-list is better: the second line of git -C ${srcdir} rev-list --pretty=format:%cd --date=short -n1 HEAD should be the same as the current git log incantation.

Expected Behavior

The build shouldn't fail depending on my git configuration...

Reproduction Instructions

$ git config --global log.showSignature true
$ ./configure
sersorrel commented 5 years ago

Apologies, I opened this prematurely - this doesn't seem to be a problem when building current i3lock (with autoreconf -i && ./configure && make).