Page MenuHomeFreeBSD

newvers: Include a src timestamp in vers.c
Needs ReviewPublic

Authored by emaste on Jan 29 2025, 7:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 5, 7:24 PM
Unknown Object (File)
Tue, Mar 4, 11:13 AM
Unknown Object (File)
Mon, Mar 3, 11:36 PM
Unknown Object (File)
Sun, Mar 2, 5:57 AM
Unknown Object (File)
Fri, Feb 28, 4:00 PM
Unknown Object (File)
Fri, Feb 28, 3:56 PM
Unknown Object (File)
Wed, Feb 19, 6:40 PM
Unknown Object (File)
Feb 14 2025, 5:33 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Not used anywhere right now; will be used for reproducible builds. It doesn't really need to be in a .c file, but doing so has the nice property of keeping git derived info in the same place.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.
jlduran added inline comments.
sys/conf/newvers.sh
275

What about $git_cmd log -1 --format=%ct?

zlei added inline comments.
sys/conf/newvers.sh
275

What about $git_cmd log -1 --format=%ct?

I'm not familiar with reproducible build. Does that require a clean work tree ?

I'm not familiar with reproducible build. Does that require a clean work tree ?

https://reproducible-builds.org/ has a good overview that covers the what, why, and how of reproducible builds. The most important aspect is that someone can independently build a release and produce identical artifacts, which will inherently involve an unmodified tree. The r-b definition describes an "independently-verifiable path from source to binary code" and implicit in this is that there's a way to identify the precise source that was used. You could have a reproducible build of "FreeBSD 14.2 with <patch> applied", say, but it's likely not that useful.

With respect to git log -1 --format=%ct in particular, a working tree with modifications still shows the timestamp from the most recent commit.

I'm not familiar with reproducible build. Does that require a clean work tree ?

https://reproducible-builds.org/ has a good overview that covers the what, why, and how of reproducible builds. The most important aspect is that someone can independently build a release and produce identical artifacts, which will inherently involve an unmodified tree. The r-b definition describes an "independently-verifiable path from source to binary code" and implicit in this is that there's a way to identify the precise source that was used. You could have a reproducible build of "FreeBSD 14.2 with <patch> applied", say, but it's likely not that useful.

Ahh, I see. Apparently a dirty working tree requires extra work to archive the goal reproducible build. See calculate a reproducible checksum of the dirty parts / uncommitted patch, so that a different user can apply the same patch and produce identical artifacts.