Debian has this goal https://wiki.debian.org/ReproducibleBuilds/
As you can see here https://reproducible.debian.net/rb-pkg/kamailio.html we are using __TIME__ and __DATE__ macros ``` gcc -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=date-time -D_FORTIFY_SOURCE=2 -DNAME='"kamailio"' -DVERSION='"4.2.0"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.9.2"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=4002000 -DCFG_DIR='"/etc/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DF_MALLOC -DDBG_F_MALLOC -DMEM_JOIN_FREE -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_ SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -c ver.c -o ver.o -MMD -MP ver.c:38:35: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time] const char ver_compiled_time[] = __TIME__ " " __DATE__ ; ^ ver.c:38:48: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] const char ver_compiled_time[] = __TIME__ " " __DATE__ ; ^ cc1: some warnings being treated as errors ```
Can we introduce a Make option to avoid this?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/60
We could create something that takes a specified timestamp from somewhere else, like a debian packaging release time. If that doesn't exist, we'll use compile-time like now.
Just brainstorming.
/O
On 30 Jan 2015, at 12:03, Victor Seva notifications@github.com wrote:
Debian has this goal https://wiki.debian.org/ReproducibleBuilds/
As you can see here https://reproducible.debian.net/rb-pkg/kamailio.html we are using TIME and DATE macros
gcc -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Werror=date-time -D_FORTIFY_SOURCE=2 -DNAME='"kamailio"' -DVERSION='"4.2.0"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.9.2"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=4002000 -DCFG_DIR='"/etc/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DF_MALLOC -DDBG_F_MALLOC -DMEM_JOIN_FREE -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DUSE_RAW_SOCKS - DHAVE_EP OLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -c ver.c -o ver.o -MMD -MP ver.c:38:35: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time] const char ver_compiled_time[] = __TIME__ " " __DATE__ ; ^ ver.c:38:48: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] const char ver_compiled_time[] = __TIME__ " " __DATE__ ; ^ cc1: some warnings being treated as errors Can we introduce a Make option to avoid this?
— Reply to this email directly or view it on GitHub.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
I see the options:
* if compiled with a flag (e.g., NO_VERSION_DATE), skip adding it completely * if compiled with VERSION_DATE=xyz and VERSION_TIME=abc, then add them instead of predefined macros * if none of above, then compile as it is
It should cover all cases one would like to have, I think.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/60#issuecomment-72198418
Pushed a patch in master allowing to disable adding time/date in version string as well as setting a particular value.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/60#issuecomment-73287432
Closed #60.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/60#event-231658236