Skip to content

perl: pin cf_time/cf_by for reproducible builds#249

Merged
bryan-minimal merged 3 commits into
mainfrom
bryan/perl-reproducible-cf-time
Jun 17, 2026
Merged

perl: pin cf_time/cf_by for reproducible builds#249
bryan-minimal merged 3 commits into
mainfrom
bryan/perl-reproducible-cf-time

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Jun 15, 2026

Copy link
Copy Markdown
Member

Problem

perl's Configure bakes the wall-clock build time (and builder name) into
Config_heavy.pl, perlbug, and perlthanks via cf_time/cf_by. Two builds
of the same source therefore produce different bytes. Confirmed with a
build-twice-and-diff:

build A:  cf_time='Mon Jun 15 18:48:21 UTC 2026'
build B:  cf_time='Mon Jun 15 18:50:59 UTC 2026'

Fix

Pin both values deterministically from SOURCE_DATE_EPOCH and pass them explicitly
to Configure (perl does not honor SOURCE_DATE_EPOCH natively):

export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-0}"
CF_TIME="$(LC_ALL=C TZ=UTC date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || echo 'Thu Jan  1 00:00:00 UTC 1970')"
# ... Configure ... -D cf_time="$CF_TIME" -D cf_by=builder

Verification

A from-source double-build (~34 min) now produces byte-identical content
repro-check diff reports no content differences (previously: cf_time digits
differed in the 3 files above).

Note: on a case-insensitive filesystem (e.g. macOS APFS), perl's Unicode property
tables (_PerlAny.pl, etc.) show a spurious file-set diff because their names
case-collide. That's a filesystem artifact of the test host, not a build issue —
on a case-sensitive Linux builder the output is fully reproducible.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced build reproducibility by standardizing build-time configuration settings to ensure consistent builds across different environments.

Configure bakes the wall-clock build time into Config_heavy.pl/perlbug/perlthanks (cf_time/cf_by), making builds non-reproducible. Pin both from SOURCE_DATE_EPOCH and pass them explicitly to Configure (perl doesn't honor SOURCE_DATE_EPOCH natively). Verified byte-identical content across a from-source double-build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c01ed4ec-c39f-4342-ab9b-b8e4f5c6d9d0

📥 Commits

Reviewing files that changed from the base of the PR and between 6e6f29b and dfa3ca7.

📒 Files selected for processing (1)
  • packages/perl/build.sh

📝 Walkthrough

Walkthrough

packages/perl/build.sh gains two reproducibility fixes: it defaults SOURCE_DATE_EPOCH to 0, derives CF_TIME from it as a UTC date string (with a fallback), and forwards both -D cf_time="$CF_TIME" and -D cf_by=builder to Perl's Configure invocation.

Changes

Perl Reproducible Build

Layer / File(s) Summary
Deterministic timestamp derivation and Configure wiring
packages/perl/build.sh
SOURCE_DATE_EPOCH is defaulted to 0; CF_TIME is computed from it via date -u with a fallback literal string. The Configure call is updated to pass -D cf_time="$CF_TIME" and -D cf_by=builder.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A timestamp once floated, unknown and free,
Now anchored to epoch, as stable as me.
cf_by=builder, no username in sight,
The bunny ensures every build is just right.
Reproducible hops, from zero to done! 🕐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: pinning cf_time and cf_by configuration variables in the perl build script for reproducible builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bryan/perl-reproducible-cf-time

Comment @coderabbitai help to get the list of available commands and usage tips.

…ed to 8h)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bryan-minimal bryan-minimal added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 16, 2026
@bryan-minimal bryan-minimal added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 16, 2026
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bryan-minimal bryan-minimal added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 6ecf75b Jun 17, 2026
4 checks passed
@bryan-minimal bryan-minimal deleted the bryan/perl-reproducible-cf-time branch June 17, 2026 01:42
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