-
Notifications
You must be signed in to change notification settings - Fork 192
Closed
Description
Problem
In `src/frontend/preprocessor/predefined_macros.rs:154`, `DATE` is hardcoded to `"Jan 1 2025"` instead of the actual compilation date. While hardcoding improves build reproducibility, it breaks code that uses `DATE` for build versioning.
GCC uses the actual date unless `SOURCE_DATE_EPOCH` is set for reproducible builds.
```c
const char *built = DATE;
// GCC: "Feb 6 2026" (actual date)
// CCC: always "Jan 1 2025"
```
Suggested approach
Use the actual date by default, but respect `SOURCE_DATE_EPOCH` environment variable for reproducible builds (matching GCC/Clang behavior).
Files to modify
- `src/frontend/preprocessor/predefined_macros.rs` — Use `chrono` or `std::time` for actual date, with `SOURCE_DATE_EPOCH` override
Acceptance criteria
- `DATE` reflects actual compilation date
- `TIME` reflects actual compilation time (if also hardcoded)
- `SOURCE_DATE_EPOCH` env var overrides to a fixed date for reproducibility
- `cargo test --lib` passes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels