I think this patch finally looks good. I read the SOURCE_DATE_EPOCH spec and we seem to be following it correctly. Thanks for all your hard work (I know it's been a lot) on this!
Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net> On Fri, Jul 1, 2016 at 9:22 AM, Emil Velikov <emil.l.veli...@gmail.com> wrote: > From: Emil Velikov <emil.veli...@collabora.com> > > 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. > > v2: Remove .tmp rule. Its not needed since we want for the header to be > regenerated on each time we call make (Eric). > > v3: > - Honour SOURCE_DATE_EPOCH, to make the build reproducible (Michel) > - Replace the generated header with a define, to prevent needless > builds on consecutive `make' and/or `make install' calls. (Dave) > > v4: > - Keep the timestamp generation at make time. (Jason) > > v5: > - Ensure that file is regenerated on incremental builds. > > Cc: mesa-sta...@lists.freedesktop.org > Signed-off-by: Emil Velikov <emil.veli...@collabora.com> > --- > configure.ac | 2 ++ > src/intel/vulkan/Makefile.am | 10 +++++++++- > src/intel/vulkan/anv_device.c | 4 ++-- > 3 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 8321e8e..3d32c53 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -2620,6 +2620,8 @@ AC_SUBST([XA_MINOR], $XA_MINOR) > AC_SUBST([XA_TINY], $XA_TINY) > AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY") > > +AC_SUBST([TIMESTAMP_CMD], '`test $(SOURCE_DATE_EPOCH) && echo > $(SOURCE_DATE_EPOCH) || date +%s`') > + > AC_ARG_ENABLE(valgrind, > [AS_HELP_STRING([--enable-valgrind], > [Build mesa with valgrind support (default: > auto)])], > diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am > index 4d9ff90..3f49020 100644 > --- a/src/intel/vulkan/Makefile.am > +++ b/src/intel/vulkan/Makefile.am > @@ -131,8 +131,16 @@ anv_entrypoints.c : anv_entrypoints_gen.py > $(vulkan_include_HEADERS) > $(AM_V_GEN) cat $(vulkan_include_HEADERS) |\ > $(PYTHON2) $(srcdir)/anv_entrypoints_gen.py code > $@ > > +.PHONY: anv_timestamp.h > + > +anv_timestamp.h: > + @echo "Updating anv_timestamp.h" > + $(AM_V_GEN) echo "#define ANV_TIMESTAMP \"$(TIMESTAMP_CMD)\"" > $@ > + > +anv_device.$(OBJEXT): anv_timestamp.h > + > BUILT_SOURCES = $(VULKAN_GENERATED_FILES) > -CLEANFILES = $(BUILT_SOURCES) dev_icd.json > +CLEANFILES = $(BUILT_SOURCES) dev_icd.json anv_timestamp.h > EXTRA_DIST = \ > $(top_srcdir)/include/vulkan/vk_icd.h \ > anv_entrypoints_gen.py \ > diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c > index ea8e875..dd941b6 100644 > --- a/src/intel/vulkan/anv_device.c > +++ b/src/intel/vulkan/anv_device.c > @@ -28,7 +28,7 @@ > #include <fcntl.h> > > #include "anv_private.h" > -#include "git_sha1.h" > +#include "anv_timestamp.h" > #include "util/strtod.h" > #include "util/debug.h" > > @@ -426,7 +426,7 @@ void > anv_device_get_cache_uuid(void *uuid) > { > memset(uuid, 0, VK_UUID_SIZE); > - snprintf(uuid, VK_UUID_SIZE, "anv-%s", MESA_GIT_SHA1 + 4); > + snprintf(uuid, VK_UUID_SIZE, "anv-%s", ANV_TIMESTAMP); > } > > void anv_GetPhysicalDeviceProperties( > -- > 2.8.2 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev