Open realazthat opened 1 year ago
It looks like the purpose of this code is to help produce version strings for Wave itself (including its samples). I think it might be fine to produce UNKNOWN
as a string in cases where parsing fails, instead of doing this assert. We'd need some test cases too to ensure valid date/time strings didn't start getting misparsed.
Another idea: I read about SOURCE_DATE_EPOCH; if we offered a setting that would help you implement that (i.e. by overriding system time) would that suffice?
I use bazel as my build system, and bazel specializes in reproducible builds, which basically means it tries to build everything in a sandbox with limited access to system libraries, and replaces the various date macros with some string like REDACTED . This breaks the time_conversion_helper and asserts(false) at runtime.
not sure what the best solution is, but it would be great if there was a macro that made the time-based macros optional.
My solution is to fork boost and comment out the assertion (https://github.com/boostorg/wave/blob/99ccc6e3cbd3fa347dc23f10518aa7d33d31573e/include/boost/wave/util/time_conversion_helper.hpp#L127).