[Mesa-dev] [PATCH v4 2/4] anv: use cache uuid based on the build timestamp.

Emil Velikov emil.l.velikov at gmail.com
Fri Jun 24 19:35:13 UTC 2016


On 24 June 2016 at 20:15, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
>
> On Fri, Jun 24, 2016 at 11:59 AM, Emil Velikov <emil.l.velikov at gmail.com>
> wrote:
>>
>> From: Emil Velikov <emil.velikov at 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)
>>
>> Cc: Michel Dänzer <michel at daenzer.net>
>> Cc: Dave Airlie <airlied at gmail.com>
>> Cc: Jason Ekstrand <jason at jlekstrand.net>
>> Cc: mesa-stable at lists.freedesktop.org
>> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
>> ---
>> This should resolve the incremental builds, yet the solution looks quite
>> nasty. As always, input on a cleaner one is appreciated.
>> ---
>>  configure.ac                      |  2 ++
>>  src/intel/vulkan/Makefile.am      | 12 ++++++++----
>>  src/intel/vulkan/Makefile.sources |  4 +++-
>>  src/intel/vulkan/anv_device.c     |  3 +--
>>  4 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index cc9bc47..acdb8c0 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -2593,6 +2593,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..c2ebc28 100644
>> --- a/src/intel/vulkan/Makefile.am
>> +++ b/src/intel/vulkan/Makefile.am
>> @@ -33,10 +33,11 @@ lib_LTLIBRARIES = libvulkan_intel.la
>>  check_LTLIBRARIES = libvulkan-test.la
>>
>>  PER_GEN_LIBS = \
>> -   libanv-gen7.la \
>> -   libanv-gen75.la \
>> -   libanv-gen8.la \
>> -   libanv-gen9.la
>> +       libanv-device.la \
>> +       libanv-gen7.la \
>> +       libanv-gen75.la \
>> +       libanv-gen8.la \
>> +       libanv-gen9.la
>>
>>  noinst_LTLIBRARIES = $(PER_GEN_LIBS)
>>
>> @@ -63,6 +64,9 @@ AM_CPPFLAGS = \
>>
>>  AM_CFLAGS = -Wno-override-init -msse2
>>
>> +libanv_device_la_CPPFLAGS = $(AM_CPPFLAGS)
>> -DANV_TIMESTAMP=\"$(TIMESTAMP_CMD)\"
>
>
> 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.
>
You're right - it doesn't :-( I'll step away for an hour or so will
give it another try.

Apologies for all the spam all.
-Emil


More information about the mesa-dev mailing list