<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 24, 2016 at 11:59 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>
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>
</span>v4:<br>
- Keep the timestamp generation at make time. (Jason)<br>
<span class=""><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><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>This should resolve the incremental builds, yet the solution looks quite<br>
nasty. As always, input on a cleaner one is appreciated.<br>
---<br>
<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 2 ++<br>
src/intel/vulkan/Makefile.am | 12 ++++++++----<br>
src/intel/vulkan/Makefile.sources | 4 +++-<br>
src/intel/vulkan/anv_device.c | 3 +--<br>
4 files changed, 14 insertions(+), 7 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..acdb8c0 100644<br>
<span class="">--- 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>
</span>+AC_SUBST([TIMESTAMP_CMD], '`test $(SOURCE_DATE_EPOCH) && echo $(SOURCE_DATE_EPOCH) || date +%s`')<br>
<span class="">+<br>
AC_ARG_ENABLE(valgrind,<br>
[AS_HELP_STRING([--enable-valgrind],<br>
[Build mesa with valgrind support (default: auto)])],<br>
</span>diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am<br>
index 4d9ff90..c2ebc28 100644<br>
--- a/src/intel/vulkan/Makefile.am<br>
+++ b/src/intel/vulkan/Makefile.am<br>
@@ -33,10 +33,11 @@ lib_LTLIBRARIES = <a href="http://libvulkan_intel.la" rel="noreferrer" target="_blank">libvulkan_intel.la</a><br>
check_LTLIBRARIES = <a href="http://libvulkan-test.la" rel="noreferrer" target="_blank">libvulkan-test.la</a><br>
<br>
PER_GEN_LIBS = \<br>
- <a href="http://libanv-gen7.la" rel="noreferrer" target="_blank">libanv-gen7.la</a> \<br>
- <a href="http://libanv-gen75.la" rel="noreferrer" target="_blank">libanv-gen75.la</a> \<br>
- <a href="http://libanv-gen8.la" rel="noreferrer" target="_blank">libanv-gen8.la</a> \<br>
- <a href="http://libanv-gen9.la" rel="noreferrer" target="_blank">libanv-gen9.la</a><br>
+ <a href="http://libanv-device.la" rel="noreferrer" target="_blank">libanv-device.la</a> \<br>
+ <a href="http://libanv-gen7.la" rel="noreferrer" target="_blank">libanv-gen7.la</a> \<br>
+ <a href="http://libanv-gen75.la" rel="noreferrer" target="_blank">libanv-gen75.la</a> \<br>
+ <a href="http://libanv-gen8.la" rel="noreferrer" target="_blank">libanv-gen8.la</a> \<br>
+ <a href="http://libanv-gen9.la" rel="noreferrer" target="_blank">libanv-gen9.la</a><br>
<br>
noinst_LTLIBRARIES = $(PER_GEN_LIBS)<br>
<br>
@@ -63,6 +64,9 @@ AM_CPPFLAGS = \<br>
<br>
AM_CFLAGS = -Wno-override-init -msse2<br>
<br>
+libanv_device_la_CPPFLAGS = $(AM_CPPFLAGS) -DANV_TIMESTAMP=\"$(TIMESTAMP_CMD)\"<br></blockquote><div><br></div><div>How does doing it this way fix the "make && make install" problem? It needs to update the timestamp even if anv_device.c doesn't change.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+libanv_device_la_SOURCES = $(ANV_DEVICE_FILES)<br>
+<br>
libanv_gen7_la_CFLAGS = $(AM_CFLAGS) -DGEN_VERSIONx10=70<br>
libanv_gen7_la_SOURCES = $(GEN7_FILES)<br>
<br>
diff --git a/src/intel/vulkan/Makefile.sources b/src/intel/vulkan/Makefile.sources<br>
index aa1459a..e4e4884 100644<br>
--- a/src/intel/vulkan/Makefile.sources<br>
+++ b/src/intel/vulkan/Makefile.sources<br>
@@ -24,7 +24,6 @@ VULKAN_FILES := \<br>
anv_batch_chain.c \<br>
anv_cmd_buffer.c \<br>
anv_descriptor_set.c \<br>
- anv_device.c \<br>
anv_dump.c \<br>
anv_formats.c \<br>
anv_genX.h \<br>
@@ -52,6 +51,9 @@ VULKAN_FILES := \<br>
genX_pipeline_util.h \<br>
vk_format_info.h<br>
<br>
+ANV_DEVICE_FILES := \<br>
+ anv_device.c<br>
+<br>
VULKAN_WSI_WAYLAND_FILES := \<br>
anv_wsi_wayland.c<br>
<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>