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

2016-06-27 Thread Michel Dänzer
On 24.06.2016 19:21, Emil Velikov wrote:
> On 24 June 2016 at 03:32, Michel Dänzer  wrote:
>> On 23.06.2016 22:25, Emil Velikov wrote:
>>> On 23 June 2016 at 03:49, Michel Dänzer  wrote:
 On 22.06.2016 21:04, Emil Velikov wrote:
> From: Emil Velikov 
>
> 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 
> Cc: mesa-sta...@lists.freedesktop.org
> Signed-off-by: Emil Velikov 
> ---
> 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.

>>> Thanks to letting me know before things got swapped with 0s. Is there
>>> a way to contact/check how other projects have handled/resolved this ?
>>
>> The wiki page above has a link to
>> https://wiki.debian.org/ReproducibleBuilds/Contribute which lists
>> several ways to get in touch with people working on this.
>>
> Sweet, thanks.
> 
>>
 Would it be possible to generate a hash over all source files listed in
 any Makefile.sources, or something like that?

>>> If you want to pursue that task please do.
>>
>> I'm not going to work on this, I merely suggested a possible alternative.
>>
> JFYI Pekka did mention the exact same alternative, and the above
> mentioned 'limitations' came to play. Would be great if we didn't have
> to care for either one, but I suspect that there's at least dozen of
> people who do.
> 
> I'll check with the people leading the initiative for other ways,
> meanwhile do you feel strongly against the patch ?

Yes, I agree with Dave that this approach is a dead end due to the above
conflict.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-24 Thread Emil Velikov
On 24 June 2016 at 03:32, Michel Dänzer  wrote:
> On 23.06.2016 22:25, Emil Velikov wrote:
>> On 23 June 2016 at 03:49, Michel Dänzer  wrote:
>>> On 22.06.2016 21:04, Emil Velikov wrote:
 From: Emil Velikov 

 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 
 Cc: mesa-sta...@lists.freedesktop.org
 Signed-off-by: Emil Velikov 
 ---
 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.
>>>
>> Thanks to letting me know before things got swapped with 0s. Is there
>> a way to contact/check how other projects have handled/resolved this ?
>
> The wiki page above has a link to
> https://wiki.debian.org/ReproducibleBuilds/Contribute which lists
> several ways to get in touch with people working on this.
>
Sweet, thanks.

>
>>> Would it be possible to generate a hash over all source files listed in
>>> any Makefile.sources, or something like that?
>>>
>> If you want to pursue that task please do.
>
> I'm not going to work on this, I merely suggested a possible alternative.
>
JFYI Pekka did mention the exact same alternative, and the above
mentioned 'limitations' came to play. Would be great if we didn't have
to care for either one, but I suspect that there's at least dozen of
people who do.

I'll check with the people leading the initiative for other ways,
meanwhile do you feel strongly against the patch ?

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-24 Thread Emil Velikov
On 24 June 2016 at 03:59, Dave Airlie  wrote:
> On 23 June 2016 at 23:25, Emil Velikov  wrote:
>> On 23 June 2016 at 03:49, Michel Dänzer  wrote:
>>> On 22.06.2016 21:04, Emil Velikov wrote:
 From: Emil Velikov 

 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 
 Cc: mesa-sta...@lists.freedesktop.org
 Signed-off-by: Emil Velikov 
 ---
 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.
>>>
>> Thanks to letting me know before things got swapped with 0s. Is there
>> a way to contact/check how other projects have handled/resolved this ?
>> The page linked looks like a policy/guidelines one and I'm struggling
>> to see any examples of how things were resolved for project X or Y :-\
>>
>>>
>>> Would it be possible to generate a hash over all source files listed in
>>> any Makefile.sources, or something like that?
>>>
>> If you want to pursue that task please do.
>>
>> A couple of humble requests a) can you get some very rough measurement
>> how long all the hashing takes, b) please try to avoid adding extra
>> external dependencies (not sure how many people will like that).
>>
>
> I think you should be taking that as a NAK for this approach.
>
Hmm possibly. I would really appreciate if people say so from the beginning.

> If one of the reasons for not using the git_sha1 is we can't detect
> patches from distros, and one distro is knowingly going to have to
> patch the approach out, then the approach isn't really suitable.
>
There are multiple reasons for reworking the git_sha1.h dependency,
here's a few:
 - multiple reports that git_sha1.h broke my workflow', with people
resisting the suggested one line fix
 - some people ignore the suggestion and place something else "which
should be enough"
 - others outright revert the patch(es) that mandate git_sha1.h
 - provides uniqueness, even if one patches the sources.

> I'm also not sure but does running make install on the same tree twice
> re-generate this file? or did we take that into a/c?
>
I did consider that - thus my 'use a define' suggestions above. Guess
I should have explicitly mentioned that it will be added _only_ to the
file(s) that need it. Thus the whole anv won't get rebuilt, as per
Jason's concern.

To sum it up: the goal is to minimise complains/reverts/other from
builders while saving Jason, you, others time debugging, when old
cache(s) are used.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-23 Thread Dave Airlie
On 23 June 2016 at 23:25, Emil Velikov  wrote:
> On 23 June 2016 at 03:49, Michel Dänzer  wrote:
>> On 22.06.2016 21:04, Emil Velikov wrote:
>>> From: Emil Velikov 
>>>
>>> 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 
>>> Cc: mesa-sta...@lists.freedesktop.org
>>> Signed-off-by: Emil Velikov 
>>> ---
>>> 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.
>>
> Thanks to letting me know before things got swapped with 0s. Is there
> a way to contact/check how other projects have handled/resolved this ?
> The page linked looks like a policy/guidelines one and I'm struggling
> to see any examples of how things were resolved for project X or Y :-\
>
>>
>> Would it be possible to generate a hash over all source files listed in
>> any Makefile.sources, or something like that?
>>
> If you want to pursue that task please do.
>
> A couple of humble requests a) can you get some very rough measurement
> how long all the hashing takes, b) please try to avoid adding extra
> external dependencies (not sure how many people will like that).
>

I think you should be taking that as a NAK for this approach.

If one of the reasons for not using the git_sha1 is we can't detect
patches from distros, and one distro is knowingly going to have to
patch the approach out, then the approach isn't really suitable.

I'm also not sure but does running make install on the same tree twice
re-generate this file? or did we take that into a/c?

Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-23 Thread Michel Dänzer
On 23.06.2016 22:25, Emil Velikov wrote:
> On 23 June 2016 at 03:49, Michel Dänzer  wrote:
>> On 22.06.2016 21:04, Emil Velikov wrote:
>>> From: Emil Velikov 
>>>
>>> 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 
>>> Cc: mesa-sta...@lists.freedesktop.org
>>> Signed-off-by: Emil Velikov 
>>> ---
>>> 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.
>>
> Thanks to letting me know before things got swapped with 0s. Is there
> a way to contact/check how other projects have handled/resolved this ?

The wiki page above has a link to
https://wiki.debian.org/ReproducibleBuilds/Contribute which lists
several ways to get in touch with people working on this.


>> Would it be possible to generate a hash over all source files listed in
>> any Makefile.sources, or something like that?
>>
> If you want to pursue that task please do.

I'm not going to work on this, I merely suggested a possible alternative.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-23 Thread Emil Velikov
On 23 June 2016 at 03:49, Michel Dänzer  wrote:
> On 22.06.2016 21:04, Emil Velikov wrote:
>> From: Emil Velikov 
>>
>> 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 
>> Cc: mesa-sta...@lists.freedesktop.org
>> Signed-off-by: Emil Velikov 
>> ---
>> 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.
>
Thanks to letting me know before things got swapped with 0s. Is there
a way to contact/check how other projects have handled/resolved this ?
The page linked looks like a policy/guidelines one and I'm struggling
to see any examples of how things were resolved for project X or Y :-\

>
> Would it be possible to generate a hash over all source files listed in
> any Makefile.sources, or something like that?
>
If you want to pursue that task please do.

A couple of humble requests a) can you get some very rough measurement
how long all the hashing takes, b) please try to avoid adding extra
external dependencies (not sure how many people will like that).

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-22 Thread Michel Dänzer
On 22.06.2016 21:04, Emil Velikov wrote:
> From: Emil Velikov 
> 
> 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 
> Cc: mesa-sta...@lists.freedesktop.org
> Signed-off-by: Emil Velikov 
> ---
> 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
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-22 Thread Emil Velikov
On 22 June 2016 at 17:07, Eric Engestrom  wrote:
> On Wed, Jun 22, 2016 at 04:57:39PM +0100, Eric Engestrom wrote:
>> On Wed, Jun 22, 2016 at 01:04:41PM +0100, Emil Velikov wrote:
>> > From: Emil Velikov 
>
> [...]
>
>> > 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`" > $@
>> > +
>> > +anv_timestamp.h: anv_timestamp.h.tmp
>> > +   @echo "Updating anv_timestamp.h"
>> > +   @if ! cmp -s anv_timestamp.h.tmp anv_timestamp.h; then \
>> > +   mv anv_timestamp.h.tmp anv_timestamp.h ;\
>> > +   else \
>> > +   rm anv_timestamp.h.tmp ;\
>> > +   fi
>>
>> For the else branch to be taken, the target would have to be generated
>> twice within the same second, and I don't see why we would want to avoid
>> modifying anv_timestamp.h's timestamp in this case, since that would be
>> the only thing that would be changed, and said timestamp would be within
>> the same second anyway.
>> I suggest to drop the `if` and unconditionally do the move.
>>
>> Since this wouldn't change the behaviour anyway, with or without my
>> suggestion this patch is:
>> Reviewed-by: Eric Engestrom 
>
>
> Actually, the .tmp target isn't needed either, you just have to tag the
> .h target as PHONY:
>
>   .PHONY: anv_timestamp.h
>   anv_timestamp.h:
> @echo "Updating anv_timestamp.h"
> $(AM_V_GEN) echo "#define ANV_TIMESTAMP `date +%s`" > $@
>
> Unless I'm missing something, this has the exact same behaviour.
Hmm yes, we don't need the temporary here since we _want_ the .h to be
regenerated on each make invocation (unlike git_sha1.h where this came
from).
In practise this patch does the same, although it is an overkill :-)

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-22 Thread Eric Engestrom
On Wed, Jun 22, 2016 at 04:57:39PM +0100, Eric Engestrom wrote:
> On Wed, Jun 22, 2016 at 01:04:41PM +0100, Emil Velikov wrote:
> > From: Emil Velikov 

[...]

> > 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`" > $@
> > +
> > +anv_timestamp.h: anv_timestamp.h.tmp
> > +   @echo "Updating anv_timestamp.h"
> > +   @if ! cmp -s anv_timestamp.h.tmp anv_timestamp.h; then \
> > +   mv anv_timestamp.h.tmp anv_timestamp.h ;\
> > +   else \
> > +   rm anv_timestamp.h.tmp ;\
> > +   fi
> 
> For the else branch to be taken, the target would have to be generated
> twice within the same second, and I don't see why we would want to avoid
> modifying anv_timestamp.h's timestamp in this case, since that would be
> the only thing that would be changed, and said timestamp would be within
> the same second anyway.
> I suggest to drop the `if` and unconditionally do the move.
> 
> Since this wouldn't change the behaviour anyway, with or without my
> suggestion this patch is:
> Reviewed-by: Eric Engestrom 


Actually, the .tmp target isn't needed either, you just have to tag the
.h target as PHONY:

  .PHONY: anv_timestamp.h
  anv_timestamp.h:
@echo "Updating anv_timestamp.h"
$(AM_V_GEN) echo "#define ANV_TIMESTAMP `date +%s`" > $@

Unless I'm missing something, this has the exact same behaviour.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-06-22 Thread Eric Engestrom
On Wed, Jun 22, 2016 at 01:04:41PM +0100, Emil Velikov wrote:
> From: Emil Velikov 
> 
> 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 
> Cc: mesa-sta...@lists.freedesktop.org
> Signed-off-by: Emil Velikov 
> ---
> 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`" > $@
> +
> +anv_timestamp.h: anv_timestamp.h.tmp
> + @echo "Updating anv_timestamp.h"
> + @if ! cmp -s anv_timestamp.h.tmp anv_timestamp.h; then \
> + mv anv_timestamp.h.tmp anv_timestamp.h ;\
> + else \
> + rm anv_timestamp.h.tmp ;\
> + fi

For the else branch to be taken, the target would have to be generated
twice within the same second, and I don't see why we would want to avoid
modifying anv_timestamp.h's timestamp in this case, since that would be
the only thing that would be changed, and said timestamp would be within
the same second anyway.
I suggest to drop the `if` and unconditionally do the move.

Since this wouldn't change the behaviour anyway, with or without my
suggestion this patch is:
Reviewed-by: Eric Engestrom 

> +
> +BUILT_SOURCES = $(VULKAN_GENERATED_FILES) anv_timestamp.h
>  CLEANFILES = $(BUILT_SOURCES) dev_icd.json
>  EXTRA_DIST = \
>   $(top_srcdir)/include/vulkan/vk_icd.h \
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 97300c3..e395b1c 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -28,7 +28,7 @@
>  #include 
>  
>  #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] [PATCH 2/4] anv: use cache uuid based on the build timestamp.

2016-06-22 Thread Emil Velikov
From: Emil Velikov 

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 
Cc: mesa-sta...@lists.freedesktop.org
Signed-off-by: Emil Velikov 
---
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`" > $@
+
+anv_timestamp.h: anv_timestamp.h.tmp
+   @echo "Updating anv_timestamp.h"
+   @if ! cmp -s anv_timestamp.h.tmp anv_timestamp.h; then \
+   mv anv_timestamp.h.tmp anv_timestamp.h ;\
+   else \
+   rm anv_timestamp.h.tmp ;\
+   fi
+
+BUILT_SOURCES = $(VULKAN_GENERATED_FILES) anv_timestamp.h
 CLEANFILES = $(BUILT_SOURCES) dev_icd.json
 EXTRA_DIST = \
$(top_srcdir)/include/vulkan/vk_icd.h \
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 97300c3..e395b1c 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -28,7 +28,7 @@
 #include 
 
 #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