<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 24, 2016 at 10:15 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">From: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
<br>
Do not rely on the git sha1:<br>
 - its current truncated form makes it less unique<br>
 - it does not attribute for local (Vulkand or otherwise) changes<br>
<br>
Use a timestamp produced at the time of build. It's perfectly unique,<br>
unless someone explicitly thinkers with their system clock. Even then<br>
chances of producing the exact same one are very small, if not zero.<br>
<br>
</span><span class="">v2: Remove .tmp rule. Its not needed since we want for the header to be<br>
regenerated on each time we call make (Eric).<br>
<br>
</span>v3:<br>
 - Honour SOURCE_DATE_EPOCH, to make the build reproducible (Michel)<br>
 - Replace the generated header with a define, to prevent needless<br>
builds on consecutive `make' and/or `make install' calls. (Dave)<br>
<br>
Cc: Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>><br>
Cc: Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>><br>
<span class="">Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
---<br>
</span>Hopefully platforms implementing SOURCE_DATE_EPOCH will ensure that<br>
things are sane. If one is really paranoid we could annotate the symbol<br>
to distinguish between the envvar and normal date +%s. I'll leave that<br>
one for later, if needed.<br>
---<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>                  | 2 ++<br>
 src/intel/vulkan/Makefile.am  | 1 +<br>
 src/intel/vulkan/anv_device.c | 3 +--<br>
 3 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index cc9bc47..e4e090f 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -2593,6 +2593,8 @@ AC_SUBST([XA_MINOR], $XA_MINOR)<br>
 AC_SUBST([XA_TINY], $XA_TINY)<br>
 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")<br>
<br>
+AC_SUBST([BUILD_TIMESTAMP], ${SOURCE_DATE_EPOCH:-$(date +%s)})<br></blockquote><div><br></div><div>Sorry to throw in more wrenches, but what happens if you don't reconfigure?  This has the potential to cause massive problems on incremental builds.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
 AC_ARG_ENABLE(valgrind,<br>
               [AS_HELP_STRING([--enable-valgrind],<br>
                              [Build mesa with valgrind support (default: auto)])],<br>
diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am<br>
index 4d9ff90..90cf338 100644<br>
--- a/src/intel/vulkan/Makefile.am<br>
+++ b/src/intel/vulkan/Makefile.am<br>
@@ -46,6 +46,7 @@ AM_CPPFLAGS = \<br>
        $(INTEL_CFLAGS) \<br>
        $(VALGRIND_CFLAGS) \<br>
        $(DEFINES) \<br>
+       -DANV_TIMESTAMP=$(BUILD_TIMESTAMP) \<br>
        -I$(top_srcdir)/include \<br>
        -I$(top_builddir)/src \<br>
        -I$(top_srcdir)/src \<br>
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c<br>
index ea8e875..b463d44 100644<br>
--- a/src/intel/vulkan/anv_device.c<br>
+++ b/src/intel/vulkan/anv_device.c<br>
@@ -28,7 +28,6 @@<br>
<span class=""> #include <fcntl.h><br>
<br>
 #include "anv_private.h"<br>
-#include "git_sha1.h"<br>
</span> #include "util/strtod.h"<br>
 #include "util/debug.h"<br>
<br>
@@ -426,7 +425,7 @@ void<br>
<div class="HOEnZb"><div class="h5"> anv_device_get_cache_uuid(void *uuid)<br>
 {<br>
    memset(uuid, 0, VK_UUID_SIZE);<br>
-   snprintf(uuid, VK_UUID_SIZE, "anv-%s", MESA_GIT_SHA1 + 4);<br>
+   snprintf(uuid, VK_UUID_SIZE, "anv-%s", ANV_TIMESTAMP);<br>
 }<br>
<br>
 void anv_GetPhysicalDeviceProperties(<br>
--<br>
2.8.2<br>
<br>
</div></div></blockquote></div><br></div></div>