Skip to content

devtools: Respect SOURCE_DATE_EPOCH for build_id#44459

Merged
jdm merged 2 commits into
servo:mainfrom
jschwe:jschwender/fix-build-id
Apr 24, 2026
Merged

devtools: Respect SOURCE_DATE_EPOCH for build_id#44459
jdm merged 2 commits into
servo:mainfrom
jschwe:jschwender/fix-build-id

Conversation

@jschwe

@jschwe jschwe commented Apr 23, 2026

Copy link
Copy Markdown
Member

We are probably not anywhere close to reproducible builds, but we should try to follow best practices where trivially possible.
See also: https://reproducible-builds.org/docs/source-date-epoch/

Firefox devtools expects the build_id to be provided in a datetime specific format.
This PR also switches the time to UTC instead of Local, since there seems to be no clear reason to use Local, and SOURCE_DATE_EPOCH is UTC.

Testing: No functional changes, the devtools build_id is not covered by any tests.
Fixes: #44458

We are probably not anywhere close to reproducible builds, but we
should try to follow best practices where trivially possible.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe requested review from atbrakhi and eerii as code owners April 23, 2026 16:21
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 23, 2026
Comment thread components/devtools/build.rs Outdated
),
)
.unwrap();
let timestamp = env::var_os("SOURCE_DATE_EPOCH")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we might want to parse this into chrono, if we wanted to format the build id in some standard way. But it's a bit unclear to me where the build_id is actually exposed in devtools, so perhaps some input from people familiar with devtools on the use case would also be nice.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's sent as one property in the description of the device hosting the devtools server in

appbuildid: BUILD_ID.to_string(),
. It only matters in this particular check for whether a build is too recent to connect: https://searchfox.org/firefox-main/rev/be31b3948198286e39a9855e414823cb17b6e94c/devtools/client/shared/remote-debugging/version-checker.js#133-139

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the link! I updated the PR to take that into account. The other notable change is that I switched to UTC since that is what SOURCE_DATE_EPOCH is based on. That shouldn't affect devtools in any way though I think.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe force-pushed the jschwender/fix-build-id branch from 9581eb9 to c5b769d Compare April 24, 2026 11:45
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 24, 2026
@jdm jdm added this pull request to the merge queue Apr 24, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 24, 2026
Merged via the queue into servo:main with commit ee72fca Apr 24, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 24, 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.

devtools BUILD_ID does not honor SOURCE_DATE_EPOCH

3 participants