Fluent Bit failed to build on Debian Bookworm
- Dominant language
- C
- Stars
- 8.1k
- Forks
- 2k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 58
Description
## Bug Report
CFL is failed to compile Debian Bookworm.
This is the same issue which I already reported on https://github.com/fluent/cfl/pull/89.
**Describe the bug**
TIME_UTC is declared as a constant for C11 specification.
ref: https://cppreference.com/c/chrono/TIME_UTC
**To Reproduce**
- Steps to reproduce the problem:
Create a compiling environment on Debian bookworm and then execute `make`:
```
% LANG=C make
[ 1%] Built target backtrace
[ 6%] Built target c-ares
[ 6%] Built target jsmn
[ 6%] Built target sqlite3
[ 7%] Built target flb-conv
[ 7%] Built target xxhash
[ 7%] Building C object lib/cfl/src/CMakeFiles/cfl-static.dir/cfl_time.c.o
/home/cosmo/GitHub/fluent-bit/lib/cfl/src/cfl_time.c: In function 'cfl_time_now':
/home/cosmo/GitHub/fluent-bit/lib/cfl/src/cfl_time.c:55:5: warning: implicit declaration of function 'timespec_get' [-Wimplicit-function-declaration]
55 | timespec_get(&tm, TIME_UTC);
| ^~~~~~~~~~~~
/home/cosmo/GitHub/fluent-bit/lib/cfl/src/cfl_time.c:55:23: error: 'TIME_UTC' undeclared (first use in this function)
55 | timespec_get(&tm, TIME_UTC);
| ^~~~~~~~
/home/cosmo/GitHub/fluent-bit/lib/cfl/src/cfl_time.c:55:23: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [lib/cfl/src/CMakeFiles/cfl-static.dir/build.make:118: lib/cfl/src/CMakeFiles/cfl-static.dir/cfl_time.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4631: lib/cfl/src/CMakeFiles/cfl-static.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
```
**Expected behavior**
Succeed to compile Debian Bookworm.
**Screenshots**
**Your Environment**
* Version used: master d55459d492c5c019c0f7dc24db42e69ef47a5437
* Configuration: Only building
* Environment name and version (e.g. Kubernetes? What version?): Debian Bookworm in Crostini (Chromebook x86_64)
* Server type and version: Client
* Operating System and version:
```
% cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```
* Filters and plugins: N/A
**Additional context**
Contributor guide
Research direction
Start by reading lib/cfl/src/cfl_time.c around cfl_time_now and reproduce the failure with make on Debian 12 Bookworm. Check how the project selects its C standard and handles timespec_get/TIME_UTC there. Done means a clean build completes on Debian Bookworm without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, debian
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100