[PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility

Viswanath Kraleti posted 1 patch 6 months, 4 weeks ago
drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
[PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Viswanath Kraleti 6 months, 4 weeks ago
From: Ryan Eatmon <reatmon@ti.com>

The files generated by gen_header.py capture the source path to the
input files and the date.  While that can be informative, it varies
based on where and when the kernel was built as the full path is
captured.

Since all of the files that this tool is run on is under the drivers
directory, this modifies the application to strip all of the path before
drivers.  Additionally it prints <stripped> instead of the date.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
---
The files generated by gen_header.py include the source path to the
input files and the build date. While this information can be useful,
it inadvertently exposes build system configuration details in the
binaries. This hinders binary reproducibility, as the output will
vary if the build environment changes.

This change was originally submitted to the linux-yocto-dev kernel [1]
to address binary reproducibility QA errors. However, the fix is generic 
enough to be applicable to the mainline kernel and would benefit other 
distributions as well. So proposing it here for broader inclusion.

[1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
---
Changes in v2:
- Corrected author id
- Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
---
 drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/registers/gen_header.py b/drivers/gpu/drm/msm/registers/gen_header.py
index 3926485bb197b0992232447cb71bf1c1ebd0968c..a409404627c7180d5b0626f0ce6255d7d0df5113 100644
--- a/drivers/gpu/drm/msm/registers/gen_header.py
+++ b/drivers/gpu/drm/msm/registers/gen_header.py
@@ -11,6 +11,7 @@ import collections
 import argparse
 import time
 import datetime
+import re
 
 class Error(Exception):
 	def __init__(self, message):
@@ -877,13 +878,14 @@ The rules-ng-ng source files this header was generated from are:
 """)
 	maxlen = 0
 	for filepath in p.xml_files:
-		maxlen = max(maxlen, len(filepath))
+		new_filepath = re.sub("^.+drivers","drivers",filepath)
+		maxlen = max(maxlen, len(new_filepath))
 	for filepath in p.xml_files:
-		pad = " " * (maxlen - len(filepath))
+		pad = " " * (maxlen - len(new_filepath))
 		filesize = str(os.path.getsize(filepath))
 		filesize = " " * (7 - len(filesize)) + filesize
 		filetime = time.ctime(os.path.getmtime(filepath))
-		print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
+		print("- " + new_filepath + pad + " (" + filesize + " bytes, from <stripped>)")
 	if p.copyright_year:
 		current_year = str(datetime.date.today().year)
 		print()

---
base-commit: fc5c669c902c3039aa41731b6c58c0960d0b1bbf
change-id: 20250523-binrep-f8c81fa0d31d

Best regards,
-- 
Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Dmitry Baryshkov 6 months, 4 weeks ago
On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> From: Ryan Eatmon <reatmon@ti.com>
> 
> The files generated by gen_header.py capture the source path to the
> input files and the date.  While that can be informative, it varies
> based on where and when the kernel was built as the full path is
> captured.
> 
> Since all of the files that this tool is run on is under the drivers
> directory, this modifies the application to strip all of the path before
> drivers.  Additionally it prints <stripped> instead of the date.
> 
> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> ---
> The files generated by gen_header.py include the source path to the
> input files and the build date. While this information can be useful,
> it inadvertently exposes build system configuration details in the
> binaries. This hinders binary reproducibility, as the output will
> vary if the build environment changes.
> 
> This change was originally submitted to the linux-yocto-dev kernel [1]
> to address binary reproducibility QA errors. However, the fix is generic 
> enough to be applicable to the mainline kernel and would benefit other 
> distributions as well. So proposing it here for broader inclusion.
> 
> [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> ---
> Changes in v2:
> - Corrected author id
> - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> ---
>  drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 

Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Rob, WDYT?

-- 
With best wishes
Dmitry
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Rob Clark 3 months, 1 week ago
On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> wrote:
>
> On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> > From: Ryan Eatmon <reatmon@ti.com>
> >
> > The files generated by gen_header.py capture the source path to the
> > input files and the date.  While that can be informative, it varies
> > based on where and when the kernel was built as the full path is
> > captured.
> >
> > Since all of the files that this tool is run on is under the drivers
> > directory, this modifies the application to strip all of the path before
> > drivers.  Additionally it prints <stripped> instead of the date.
> >
> > Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> > ---
> > The files generated by gen_header.py include the source path to the
> > input files and the build date. While this information can be useful,
> > it inadvertently exposes build system configuration details in the
> > binaries. This hinders binary reproducibility, as the output will
> > vary if the build environment changes.
> >
> > This change was originally submitted to the linux-yocto-dev kernel [1]
> > to address binary reproducibility QA errors. However, the fix is generic
> > enough to be applicable to the mainline kernel and would benefit other
> > distributions as well. So proposing it here for broader inclusion.
> >
> > [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> > ---
> > Changes in v2:
> > - Corrected author id
> > - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> > ---
> >  drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
>
> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
> Rob, WDYT?

I'm revisiting this one, in the context of trying to re-sync
gen_header.py with mesa.. but it is only changing the contents of
comments, so it's not quite clear to me how this ends up mattering for
binary reproducibility.

That said, since the generated files are no longer checked in to mesa
or the kernel, we could probably just drop all of this if it mattered.

BR,
-R
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Ryan Eatmon 3 months, 1 week ago

On 9/6/2025 6:24 PM, Rob Clark wrote:
> On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
> <dmitry.baryshkov@oss.qualcomm.com> wrote:
>>
>> On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
>>> From: Ryan Eatmon <reatmon@ti.com>
>>>
>>> The files generated by gen_header.py capture the source path to the
>>> input files and the date.  While that can be informative, it varies
>>> based on where and when the kernel was built as the full path is
>>> captured.
>>>
>>> Since all of the files that this tool is run on is under the drivers
>>> directory, this modifies the application to strip all of the path before
>>> drivers.  Additionally it prints <stripped> instead of the date.
>>>
>>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
>>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
>>> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
>>> ---
>>> The files generated by gen_header.py include the source path to the
>>> input files and the build date. While this information can be useful,
>>> it inadvertently exposes build system configuration details in the
>>> binaries. This hinders binary reproducibility, as the output will
>>> vary if the build environment changes.
>>>
>>> This change was originally submitted to the linux-yocto-dev kernel [1]
>>> to address binary reproducibility QA errors. However, the fix is generic
>>> enough to be applicable to the mainline kernel and would benefit other
>>> distributions as well. So proposing it here for broader inclusion.
>>>
>>> [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
>>> ---
>>> Changes in v2:
>>> - Corrected author id
>>> - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
>>> ---
>>>   drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
>>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>
>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>
>> Rob, WDYT?
> 
> I'm revisiting this one, in the context of trying to re-sync
> gen_header.py with mesa.. but it is only changing the contents of
> comments, so it's not quite clear to me how this ends up mattering for
> binary reproducibility.

The reason it matters is that for Yocto, the generated header file is 
identified as a file that needs to be installed into the sysroot.  All 
files going into the sysroot are checked to make sure they do not 
contain dates and/or paths to the build directory contained within. 
Since this is a generated header file that is included in the sysroot we 
needed to strip out the path and date.

The idea for the reproducible builds are that the same files on a 
different a machine at a different time should produce 100% identical 
files.  Including paths and dates violates that tenet.

Hope that helps explain why we needed this.  So long as the 
gen_header.py is being called to generate header files then we need to 
maintain the reproducible aspect.


> That said, since the generated files are no longer checked in to mesa
> or the kernel, we could probably just drop all of this if it mattered.
> 
> BR,
> -R

-- 
Ryan Eatmon                reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS

Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Rob Clark 3 months, 1 week ago
On Mon, Sep 8, 2025 at 6:39 AM Ryan Eatmon <reatmon@ti.com> wrote:
>
>
>
> On 9/6/2025 6:24 PM, Rob Clark wrote:
> > On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
> > <dmitry.baryshkov@oss.qualcomm.com> wrote:
> >>
> >> On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> >>> From: Ryan Eatmon <reatmon@ti.com>
> >>>
> >>> The files generated by gen_header.py capture the source path to the
> >>> input files and the date.  While that can be informative, it varies
> >>> based on where and when the kernel was built as the full path is
> >>> captured.
> >>>
> >>> Since all of the files that this tool is run on is under the drivers
> >>> directory, this modifies the application to strip all of the path before
> >>> drivers.  Additionally it prints <stripped> instead of the date.
> >>>
> >>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> >>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> >>> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> >>> ---
> >>> The files generated by gen_header.py include the source path to the
> >>> input files and the build date. While this information can be useful,
> >>> it inadvertently exposes build system configuration details in the
> >>> binaries. This hinders binary reproducibility, as the output will
> >>> vary if the build environment changes.
> >>>
> >>> This change was originally submitted to the linux-yocto-dev kernel [1]
> >>> to address binary reproducibility QA errors. However, the fix is generic
> >>> enough to be applicable to the mainline kernel and would benefit other
> >>> distributions as well. So proposing it here for broader inclusion.
> >>>
> >>> [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> >>> ---
> >>> Changes in v2:
> >>> - Corrected author id
> >>> - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> >>> ---
> >>>   drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
> >>>   1 file changed, 5 insertions(+), 3 deletions(-)
> >>>
> >>
> >> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >>
> >> Rob, WDYT?
> >
> > I'm revisiting this one, in the context of trying to re-sync
> > gen_header.py with mesa.. but it is only changing the contents of
> > comments, so it's not quite clear to me how this ends up mattering for
> > binary reproducibility.
>
> The reason it matters is that for Yocto, the generated header file is
> identified as a file that needs to be installed into the sysroot.  All
> files going into the sysroot are checked to make sure they do not
> contain dates and/or paths to the build directory contained within.
> Since this is a generated header file that is included in the sysroot we
> needed to strip out the path and date.
>
> The idea for the reproducible builds are that the same files on a
> different a machine at a different time should produce 100% identical
> files.  Including paths and dates violates that tenet.
>
> Hope that helps explain why we needed this.  So long as the
> gen_header.py is being called to generate header files then we need to
> maintain the reproducible aspect.
>

My plan is (was?) to just replace the entire comment header with simply:

  /* Autogenerated file, DO NOT EDIT manually! */

That said, I'm not entirely sure why these files should get installed
into the sysroot?  I'm not super hands-on familiar with Yocto, so
maybe there is a good reason.. but if there is, maybe the plan to
remove the license/etc from the comment header isn't such a good idea
after all?

BR,
-R

>
> > That said, since the generated files are no longer checked in to mesa
> > or the kernel, we could probably just drop all of this if it mattered.
> >
> > BR,
> > -R
>
> --
> Ryan Eatmon                reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
>
>
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Ryan Eatmon 3 months, 1 week ago

On 9/8/2025 9:19 AM, Rob Clark wrote:
> On Mon, Sep 8, 2025 at 6:39 AM Ryan Eatmon <reatmon@ti.com> wrote:
>>
>>
>>
>> On 9/6/2025 6:24 PM, Rob Clark wrote:
>>> On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
>>> <dmitry.baryshkov@oss.qualcomm.com> wrote:
>>>>
>>>> On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
>>>>> From: Ryan Eatmon <reatmon@ti.com>
>>>>>
>>>>> The files generated by gen_header.py capture the source path to the
>>>>> input files and the date.  While that can be informative, it varies
>>>>> based on where and when the kernel was built as the full path is
>>>>> captured.
>>>>>
>>>>> Since all of the files that this tool is run on is under the drivers
>>>>> directory, this modifies the application to strip all of the path before
>>>>> drivers.  Additionally it prints <stripped> instead of the date.
>>>>>
>>>>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
>>>>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
>>>>> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
>>>>> ---
>>>>> The files generated by gen_header.py include the source path to the
>>>>> input files and the build date. While this information can be useful,
>>>>> it inadvertently exposes build system configuration details in the
>>>>> binaries. This hinders binary reproducibility, as the output will
>>>>> vary if the build environment changes.
>>>>>
>>>>> This change was originally submitted to the linux-yocto-dev kernel [1]
>>>>> to address binary reproducibility QA errors. However, the fix is generic
>>>>> enough to be applicable to the mainline kernel and would benefit other
>>>>> distributions as well. So proposing it here for broader inclusion.
>>>>>
>>>>> [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
>>>>> ---
>>>>> Changes in v2:
>>>>> - Corrected author id
>>>>> - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
>>>>> ---
>>>>>    drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
>>>>>    1 file changed, 5 insertions(+), 3 deletions(-)
>>>>>
>>>>
>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>>>
>>>> Rob, WDYT?
>>>
>>> I'm revisiting this one, in the context of trying to re-sync
>>> gen_header.py with mesa.. but it is only changing the contents of
>>> comments, so it's not quite clear to me how this ends up mattering for
>>> binary reproducibility.
>>
>> The reason it matters is that for Yocto, the generated header file is
>> identified as a file that needs to be installed into the sysroot.  All
>> files going into the sysroot are checked to make sure they do not
>> contain dates and/or paths to the build directory contained within.
>> Since this is a generated header file that is included in the sysroot we
>> needed to strip out the path and date.
>>
>> The idea for the reproducible builds are that the same files on a
>> different a machine at a different time should produce 100% identical
>> files.  Including paths and dates violates that tenet.
>>
>> Hope that helps explain why we needed this.  So long as the
>> gen_header.py is being called to generate header files then we need to
>> maintain the reproducible aspect.
>>
> 
> My plan is (was?) to just replace the entire comment header with simply:
> 
>    /* Autogenerated file, DO NOT EDIT manually! */
> 
> That said, I'm not entirely sure why these files should get installed
> into the sysroot?  I'm not super hands-on familiar with Yocto, so
> maybe there is a good reason.. but if there is, maybe the plan to
> remove the license/etc from the comment header isn't such a good idea
> after all?

The generated header files would be part of a linux-headers package that 
would be needed to build other packages as part of the distro.  And so 
the header files are all checked against the rules.  A linux-headers 
type package is common for distros to have available.


> BR,
> -R
> 
>>
>>> That said, since the generated files are no longer checked in to mesa
>>> or the kernel, we could probably just drop all of this if it mattered.
>>>
>>> BR,
>>> -R
>>
>> --
>> Ryan Eatmon                reatmon@ti.com
>> -----------------------------------------
>> Texas Instruments, Inc.  -  LCPD  -  MGTS
>>
>>

-- 
Ryan Eatmon                reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS

Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Mon, Sep 08, 2025 at 12:59:37PM -0500, Ryan Eatmon wrote:
> 
> 
> On 9/8/2025 9:19 AM, Rob Clark wrote:
> > On Mon, Sep 8, 2025 at 6:39 AM Ryan Eatmon <reatmon@ti.com> wrote:
> > > 
> > > 
> > > 
> > > On 9/6/2025 6:24 PM, Rob Clark wrote:
> > > > On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
> > > > <dmitry.baryshkov@oss.qualcomm.com> wrote:
> > > > > 
> > > > > On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> > > > > > From: Ryan Eatmon <reatmon@ti.com>
> > > > > > 
> > > > > > The files generated by gen_header.py capture the source path to the
> > > > > > input files and the date.  While that can be informative, it varies
> > > > > > based on where and when the kernel was built as the full path is
> > > > > > captured.
> > > > > > 
> > > > > > Since all of the files that this tool is run on is under the drivers
> > > > > > directory, this modifies the application to strip all of the path before
> > > > > > drivers.  Additionally it prints <stripped> instead of the date.
> > > > > > 
> > > > > > Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> > > > > > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > > > > Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> > > > > > ---
> > > > > > The files generated by gen_header.py include the source path to the
> > > > > > input files and the build date. While this information can be useful,
> > > > > > it inadvertently exposes build system configuration details in the
> > > > > > binaries. This hinders binary reproducibility, as the output will
> > > > > > vary if the build environment changes.
> > > > > > 
> > > > > > This change was originally submitted to the linux-yocto-dev kernel [1]
> > > > > > to address binary reproducibility QA errors. However, the fix is generic
> > > > > > enough to be applicable to the mainline kernel and would benefit other
> > > > > > distributions as well. So proposing it here for broader inclusion.
> > > > > > 
> > > > > > [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> > > > > > ---
> > > > > > Changes in v2:
> > > > > > - Corrected author id
> > > > > > - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> > > > > > ---
> > > > > >    drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
> > > > > >    1 file changed, 5 insertions(+), 3 deletions(-)
> > > > > > 
> > > > > 
> > > > > Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > > > > 
> > > > > Rob, WDYT?
> > > > 
> > > > I'm revisiting this one, in the context of trying to re-sync
> > > > gen_header.py with mesa.. but it is only changing the contents of
> > > > comments, so it's not quite clear to me how this ends up mattering for
> > > > binary reproducibility.
> > > 
> > > The reason it matters is that for Yocto, the generated header file is
> > > identified as a file that needs to be installed into the sysroot.  All
> > > files going into the sysroot are checked to make sure they do not
> > > contain dates and/or paths to the build directory contained within.
> > > Since this is a generated header file that is included in the sysroot we
> > > needed to strip out the path and date.
> > > 
> > > The idea for the reproducible builds are that the same files on a
> > > different a machine at a different time should produce 100% identical
> > > files.  Including paths and dates violates that tenet.
> > > 
> > > Hope that helps explain why we needed this.  So long as the
> > > gen_header.py is being called to generate header files then we need to
> > > maintain the reproducible aspect.
> > > 
> > 
> > My plan is (was?) to just replace the entire comment header with simply:
> > 
> >    /* Autogenerated file, DO NOT EDIT manually! */
> > 
> > That said, I'm not entirely sure why these files should get installed
> > into the sysroot?  I'm not super hands-on familiar with Yocto, so
> > maybe there is a good reason.. but if there is, maybe the plan to
> > remove the license/etc from the comment header isn't such a good idea
> > after all?
> 
> The generated header files would be part of a linux-headers package that
> would be needed to build other packages as part of the distro.  And so the
> header files are all checked against the rules.  A linux-headers type
> package is common for distros to have available.

I think you mean linux-libc-headers here. No, as Rob wrote, it is not
(these headers are not even under include/ subdir.

Do we check the work-shared/kernel-source and kernel-build-artifacts for
sysroot paths?

> 
> 
> > BR,
> > -R
> > 
> > > 
> > > > That said, since the generated files are no longer checked in to mesa
> > > > or the kernel, we could probably just drop all of this if it mattered.
> > > > 
> > > > BR,
> > > > -R
> > > 
> > > --
> > > Ryan Eatmon                reatmon@ti.com
> > > -----------------------------------------
> > > Texas Instruments, Inc.  -  LCPD  -  MGTS
> > > 
> > > 
> 
> -- 
> Ryan Eatmon                reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
> 

-- 
With best wishes
Dmitry
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Rob Clark 3 months, 1 week ago
On Mon, Sep 8, 2025 at 10:59 AM Ryan Eatmon <reatmon@ti.com> wrote:
>
>
>
> On 9/8/2025 9:19 AM, Rob Clark wrote:
> > On Mon, Sep 8, 2025 at 6:39 AM Ryan Eatmon <reatmon@ti.com> wrote:
> >>
> >>
> >>
> >> On 9/6/2025 6:24 PM, Rob Clark wrote:
> >>> On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
> >>> <dmitry.baryshkov@oss.qualcomm.com> wrote:
> >>>>
> >>>> On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> >>>>> From: Ryan Eatmon <reatmon@ti.com>
> >>>>>
> >>>>> The files generated by gen_header.py capture the source path to the
> >>>>> input files and the date.  While that can be informative, it varies
> >>>>> based on where and when the kernel was built as the full path is
> >>>>> captured.
> >>>>>
> >>>>> Since all of the files that this tool is run on is under the drivers
> >>>>> directory, this modifies the application to strip all of the path before
> >>>>> drivers.  Additionally it prints <stripped> instead of the date.
> >>>>>
> >>>>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> >>>>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> >>>>> Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> >>>>> ---
> >>>>> The files generated by gen_header.py include the source path to the
> >>>>> input files and the build date. While this information can be useful,
> >>>>> it inadvertently exposes build system configuration details in the
> >>>>> binaries. This hinders binary reproducibility, as the output will
> >>>>> vary if the build environment changes.
> >>>>>
> >>>>> This change was originally submitted to the linux-yocto-dev kernel [1]
> >>>>> to address binary reproducibility QA errors. However, the fix is generic
> >>>>> enough to be applicable to the mainline kernel and would benefit other
> >>>>> distributions as well. So proposing it here for broader inclusion.
> >>>>>
> >>>>> [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> >>>>> ---
> >>>>> Changes in v2:
> >>>>> - Corrected author id
> >>>>> - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> >>>>> ---
> >>>>>    drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
> >>>>>    1 file changed, 5 insertions(+), 3 deletions(-)
> >>>>>
> >>>>
> >>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >>>>
> >>>> Rob, WDYT?
> >>>
> >>> I'm revisiting this one, in the context of trying to re-sync
> >>> gen_header.py with mesa.. but it is only changing the contents of
> >>> comments, so it's not quite clear to me how this ends up mattering for
> >>> binary reproducibility.
> >>
> >> The reason it matters is that for Yocto, the generated header file is
> >> identified as a file that needs to be installed into the sysroot.  All
> >> files going into the sysroot are checked to make sure they do not
> >> contain dates and/or paths to the build directory contained within.
> >> Since this is a generated header file that is included in the sysroot we
> >> needed to strip out the path and date.
> >>
> >> The idea for the reproducible builds are that the same files on a
> >> different a machine at a different time should produce 100% identical
> >> files.  Including paths and dates violates that tenet.
> >>
> >> Hope that helps explain why we needed this.  So long as the
> >> gen_header.py is being called to generate header files then we need to
> >> maintain the reproducible aspect.
> >>
> >
> > My plan is (was?) to just replace the entire comment header with simply:
> >
> >    /* Autogenerated file, DO NOT EDIT manually! */
> >
> > That said, I'm not entirely sure why these files should get installed
> > into the sysroot?  I'm not super hands-on familiar with Yocto, so
> > maybe there is a good reason.. but if there is, maybe the plan to
> > remove the license/etc from the comment header isn't such a good idea
> > after all?
>
> The generated header files would be part of a linux-headers package that
> would be needed to build other packages as part of the distro.  And so
> the header files are all checked against the rules.  A linux-headers
> type package is common for distros to have available.
>

These headers should only be used to build the kernel, they are not in
include/uapi and as such should not be used for building any other
userspace package (or out of tree kernel module, for that matter).

BR,
-R

>
> > BR,
> > -R
> >
> >>
> >>> That said, since the generated files are no longer checked in to mesa
> >>> or the kernel, we could probably just drop all of this if it mattered.
> >>>
> >>> BR,
> >>> -R
> >>
> >> --
> >> Ryan Eatmon                reatmon@ti.com
> >> -----------------------------------------
> >> Texas Instruments, Inc.  -  LCPD  -  MGTS
> >>
> >>
>
> --
> Ryan Eatmon                reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
>
Re: [PATCH v2] drivers: gpu: drm: msm: registers: improve reproducibility
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Sat, Sep 06, 2025 at 04:24:29PM -0700, Rob Clark wrote:
> On Sat, May 24, 2025 at 10:15 AM Dmitry Baryshkov
> <dmitry.baryshkov@oss.qualcomm.com> wrote:
> >
> > On Sat, May 24, 2025 at 09:25:37PM +0530, Viswanath Kraleti wrote:
> > > From: Ryan Eatmon <reatmon@ti.com>
> > >
> > > The files generated by gen_header.py capture the source path to the
> > > input files and the date.  While that can be informative, it varies
> > > based on where and when the kernel was built as the full path is
> > > captured.
> > >
> > > Since all of the files that this tool is run on is under the drivers
> > > directory, this modifies the application to strip all of the path before
> > > drivers.  Additionally it prints <stripped> instead of the date.
> > >
> > > Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> > > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > Signed-off-by: Viswanath Kraleti <viswanath.kraleti@oss.qualcomm.com>
> > > ---
> > > The files generated by gen_header.py include the source path to the
> > > input files and the build date. While this information can be useful,
> > > it inadvertently exposes build system configuration details in the
> > > binaries. This hinders binary reproducibility, as the output will
> > > vary if the build environment changes.
> > >
> > > This change was originally submitted to the linux-yocto-dev kernel [1]
> > > to address binary reproducibility QA errors. However, the fix is generic
> > > enough to be applicable to the mainline kernel and would benefit other
> > > distributions as well. So proposing it here for broader inclusion.
> > >
> > > [1] https://git.yoctoproject.org/linux-yocto-dev/commit/?id=f36faf0f9f8d8f5b4c43a68e5c6bd83a62253140
> > > ---
> > > Changes in v2:
> > > - Corrected author id
> > > - Link to v1: https://lore.kernel.org/r/20250523-binrep-v1-1-c3a446518847@oss.qualcomm.com
> > > ---
> > >  drivers/gpu/drm/msm/registers/gen_header.py | 8 +++++---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > >
> >
> > Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >
> > Rob, WDYT?
> 
> I'm revisiting this one, in the context of trying to re-sync
> gen_header.py with mesa.. but it is only changing the contents of
> comments, so it's not quite clear to me how this ends up mattering for
> binary reproducibility.
> 
> That said, since the generated files are no longer checked in to mesa
> or the kernel, we could probably just drop all of this if it mattered.

SGTM.

-- 
With best wishes
Dmitry