Skip to content

Conversation

@ShahanaFarooqui
Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui commented Jan 16, 2026

Problem:

  • tar archives had different checksums despite identical file listings
  • Only 368 bytes differed between CI and local builds in the clnrest binary

Why --mtime alone wasn't enough:

  • `--mtime=@1672531200' only sets file timestamps in tar metadata
  • Build IDs and compiler-embedded timestamps are actual bytes INSIDE binaries
  • These internal bytes differed even though file mtimes were identical

Solution:

  • Add SOURCE_DATE_EPOCH=1672531200 for reproducible compilation by enforcing a consistent timestamp for Fedora build. Similar to Ubuntu fix in commit
  • Add RUSTFLAGS="-C link-arg=-Wl,--build-id=none" to disable random Build IDs
  • Added no-cache to Fedora build
  • Pin Rust version to 1.92.0 prevent toolchain drift (change "stable" to specific version)

This ensures bit-for-bit identical builds across different machines and times.


Difference:
$ tar -xzf ci/clightning-v25.12.1-Fedora-40-amd64.tar.gz -C /tmp/ci
$ tar -xzf local/clightning-v25.12.1-Fedora-40-amd64.tar.gz -C /tmp/local
$ diff -r /tmp/ci /tmp/local

  • Binary files /tmp/ci/usr/local/libexec/c-lightning/plugins/clnrest and /tmp/local/usr/local/libexec/c-lightning/plugins/clnrest differ

  • Without SOURCE_DATE_EPOCH:

    • Attempt 1:
      1e47a4dbc1fe6ca81bf1e42f2303250d31ffc9683bee92e632a9c6f27de9bf0d clightning-v25.12.1-Fedora-40-amd64.tar.gz
      e74adc347f5d5de45ecc9de7116fdc44ae6e13e2291a81c0ce45370bba78e0a6 clightning-v25.12.1.zip
    • Attempt 2:
      1c2de1fa4466da9aa19d57c0a0b313d9e961a7078c46e8780d511bea12dd47a1 clightning-v25.12.1-Fedora-40-amd64.tar.gz
      e74adc347f5d5de45ecc9de7116fdc44ae6e13e2291a81c0ce45370bba78e0a6 clightning-v25.12.1.zip
  • With SOURCE_DATE_EPOCH:

    • Attempt 1:
      4c94888a08b8d94d8a0ed034ede224c1ab34b012028090343e832ad822dd6d4f clightning-v25.12.1-Fedora-40-amd64.tar.gz
      089f1d5235e3086dad338e012d32531291ffda14094e0e985c76d0adc8abd0af clightning-v25.12.1.zip
    • Attempt 2:
      4c94888a08b8d94d8a0ed034ede224c1ab34b012028090343e832ad822dd6d4f clightning-v25.12.1-Fedora-40-amd64.tar.gz
      089f1d5235e3086dad338e012d32531291ffda14094e0e985c76d0adc8abd0af clightning-v25.12.1.zip

Changelog-Fixed: Core lightning builds for Fedora on all systems are deterministic.

- Using environment variable `SOURCE_DATE_EPOCH` with fixed value will enforce a consistent timestamp for Fedora build.
. Similar to Ubuntu fix in commit ElementsProject@490fb0f
- Locked cargo version
- Add `no-cache` to Fedora build

Changelog-Fixed: Core lightning builds for Fedora on all systems are deterministic.
@ShahanaFarooqui ShahanaFarooqui added this to the v26.04 milestone Jan 16, 2026
@ShahanaFarooqui ShahanaFarooqui changed the title Fedora binaries are not matching due to different SOURCE_DATE_EPOCH for clnrest Fedora shasums are not matching due to different SOURCE_DATE_EPOCH for clnrest Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants