wolfcw / libfaketime

libfaketime modifies the system time for a single application
https://github.com/wolfcw/libfaketime
GNU General Public License v2.0
2.71k stars 325 forks source link

alpine build broken with latest change #369

Closed lindt closed 2 years ago

lindt commented 2 years ago

this recent change broke our alpine build:

https://github.com/wolfcw/libfaketime/commit/36090e8ceba3dd0cc9478403eacf5949530ab6d9

FROM alpine:3.15

RUN apk add --no-cache git build-base && \
    git clone https://github.com/wolfcw/libfaketime /libfaketime
WORKDIR /libfaketime
RUN make && make install

Error message:

/libfaketime # make
make  -C src all
make[1]: Entering directory '/libfaketime/src'
cc -o libfaketime.o -c -std=gnu99 -Wall -Wextra -Werror -Wno-nonnull-compare -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'/usr/local'"' -DLIBDIRNAME='"'/lib/faketime'"'    libfaketime.c
libfaketime.c:35:10: fatal error: gnu/libc-version.h: No such file or directory
   35 | #include <gnu/libc-version.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:140: libfaketime.o] Error 1
make[1]: Leaving directory '/libfaketime/src'
make: *** [Makefile:8: all] Error 2
wolfcw commented 2 years ago

Thanks for pointing this out!

I guess we'll have to wrap those changes into something like #ifdef __GLIBC__.

@dkg: In the context of #359 and #366, this will likely put some further restrictions on how far the version auto-sensing can go. Especially if we assume that libfaketime binaries are copied over to other platforms, they do not necessarily use glibc just because it was compiled on a glibc system. Not sure if there are any generic functions to determine which libc variant and version we are currently running under.

lindt commented 2 years ago

works like charm. thanks