I have a Yocto build based on Poky that inherits reproducible_build
. This essentially sets BUILD_REPRODUCIBLE_BINARIES
to "1"
, and REPRODUCIBLE_TIMESTAMP_ROOTFS
to "1520598896"
, which is 12:34:56 on 9th March 2018 UTC.
In this build, I have a /www/index.html
file, that is created in the final image with an "mtime" automatically set to this same date. I'm using a third-party web-server that uses the file's mtime to set the E-Tag for caching purposes. Unfortunately, because every build has the same timestamp, the server responds to the web client's If-None-Match
HTTP request header with a 304 response - Not Modified. This causes the client to show the index.html
from the previous build, unless the user does a force-refresh (ctrl+F5). What I'd like to see is the true file being downloaded and displayed to the user.
I would prefer not to disable reproducible builds for the entire image just because of one file, so I'm looking for alternatives.
Is it possible to direct bitbake to skip the effect of BUILD_REPRODUCIBLE_BINARIES
for a single file when creating the final image? Ideally I'd like this file to have an mtime equal to the time at which is was actually built, or perhaps even specify it programmatically (e.g. to the time my pipeline was created).