Repository navigation
WIP: Set SOURCE_DATE_EPOCH env var during the build - #5256
Closed
akoeplinger wants to merge 1 commit into
Closed
akoeplinger wants to merge 1 commit into
akoeplinger wants to merge 1 commit into
Conversation
Member
omajid
reviewed
May 15, 2026
| else | ||
| sourceDateEpoch=$(TZ=UTC date -ud "${build_date:0:4}-${build_date:4:2}-${build_date:6:2} 00:00:00" '+%s') | ||
| fi | ||
| sourceDateEpoch=$((sourceDateEpoch + build_revision)) |
Member
There was a problem hiding this comment.
Alternatively, maybe export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) to base it on the timestamp of the last git commit?
mthalman
added a commit
to mthalman/dotnet
that referenced
this pull request
May 26, 2026
…elineStartTime System.PipelineStartTime is set per-job, not per-run, so parallel jobs get different values. Build.BuildNumber (format YYYYMMDD.Revision) is consistent across all stages and jobs in the same pipeline run. Parse the date portion into Unix epoch seconds and add the revision offset, matching the approach in dotnet#5256. Co-authored-by: Copilot <[email protected]>
Member
Author
|
Superseded by #6622 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NuGet is adding support for deterministic builds (NuGet/Home#14785) to make .NET more reproducible for dotnet/source-build#4963
This is a WIP PR to check if setting the SOURCE_DATE_EPOCH env var (which is already supported by various other tools like clang) causes any issues right now.