On 22.06.2016 21:04, Emil Velikov wrote: > From: Emil Velikov <[email protected]> > > Do not rely on the git sha1: > - its current truncated form makes it less unique > - it does not attribute for local (Vulkand or otherwise) changes > > Use a timestamp produced at the time of build. It's perfectly unique, > unless someone explicitly thinkers with their system clock. Even then > chances of producing the exact same one are very small, if not zero. > > Cc: Jason Ekstrand <[email protected]> > Cc: [email protected] > Signed-off-by: Emil Velikov <[email protected]> > --- > Current approach uses seconds since Epoch, but if people prefer we > can use nano seconds, combination of the two and/or other. > --- > src/intel/vulkan/.gitignore | 2 ++ > src/intel/vulkan/Makefile.am | 15 ++++++++++++++- > src/intel/vulkan/anv_device.c | 4 ++-- > 3 files changed, 18 insertions(+), 3 deletions(-) > > diff --git a/src/intel/vulkan/.gitignore b/src/intel/vulkan/.gitignore > index a496146..7ef6a48 100644 > --- a/src/intel/vulkan/.gitignore > +++ b/src/intel/vulkan/.gitignore > @@ -2,3 +2,5 @@ > /anv_entrypoints.c > /anv_entrypoints.h > /dev_icd.json > +/anv_timestamp.h.tmp > +/anv_timestamp.h > diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am > index 4d9ff90..8332ae5 100644 > --- a/src/intel/vulkan/Makefile.am > +++ b/src/intel/vulkan/Makefile.am > @@ -131,7 +131,20 @@ anv_entrypoints.c : anv_entrypoints_gen.py > $(vulkan_include_HEADERS) > $(AM_V_GEN) cat $(vulkan_include_HEADERS) |\ > $(PYTHON2) $(srcdir)/anv_entrypoints_gen.py code > $@ > > -BUILT_SOURCES = $(VULKAN_GENERATED_FILES) > + > +.PHONY: anv_timestamp.h.tmp > +anv_timestamp.h.tmp: > + $(AM_V_GEN) echo "#define ANV_TIMESTAMP `date +%s`" > $@
This conflicts with efforts to make builds reproducible, see e.g. https://wiki.debian.org/ReproducibleBuilds . One technique used by such efforts is to replace any timestamps with all 0s. Would it be possible to generate a hash over all source files listed in any Makefile.sources, or something like that? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
