Skip to contentSkip to conversation

uninative-tarball.xz - reproducibility fix

PATCH Superseded Robert Berger 2 participants 4 messages Jun 29, 2023 – Jun 30, 2023 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uninative-tarball.xz - reproducibility fix

added --clamp-mtime --mtime to the tar command

see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15148

---
 meta/classes-recipe/populate_sdk_base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/populate_sdk_base.bbclass +2 -1
index b23ea26d40..c804e7520a 100644
@@ -86,7 +86,7 @@ python () {
        d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; zip -r ${SDK_ZIP_OPTIONS} ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} .')
     else:
        d.setVar('SDK_ARCHIVE_DEPENDS', 'xz-native')
-       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
+       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} ${SDKTAROPTS_ADDON} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
 }
 
 SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
@@ -286,6 +286,7 @@ python check_sdk_sysroots() {
 }
 
 SDKTAROPTS = "--owner=root --group=root"
+SDKTAROPTS_ADDON ?= "--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"
 
 fakeroot archive_sdk() {
 	# Package it up
Signature · 1 line
2.17.1
#1 lore raw
Quoted 24 lines · Robert Berger

added --clamp-mtime --mtime to the tar command

see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15148

---
 meta/classes-recipe/populate_sdk_base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/populate_sdk_base.bbclass +1 -1
index b23ea26d40..c804e7520a 100644
@@ -86,7 +86,7 @@ python () {
        d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; zip -r ${SDK_ZIP_OPTIONS} ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} .')
     else:
        d.setVar('SDK_ARCHIVE_DEPENDS', 'xz-native')
-       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
+       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} ${SDKTAROPTS_ADDON} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
 }
 
 SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"

meta/classes-recipe/populate_sdk_base.bbclass python check_sdk_sysroots() { · line 290

Quoted 5 lines
meta/classes-recipe/populate_sdk_base.bbclass +1 -0
@@ -286,6 +286,7 @@ python check_sdk_sysroots() {
 }
 
 SDKTAROPTS = "--owner=root --group=root"
+SDKTAROPTS_ADDON ?= "--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"
 

Thanks, looks good. I did wonder if we could just put this in SDKTAROPTS though? Do we really need to add a new variable?

Cheers,

Richard

#2 lore raw

Hi,

Not sure my previous reply made it to the list.
So I try it again here.

Quoted 27 lines · Richard Purdie
Quoted 26 lines · Robert Berger

added --clamp-mtime --mtime to the tar command

see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15148

---
  meta/classes-recipe/populate_sdk_base.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/populate_sdk_base.bbclass +1 -1
index b23ea26d40..c804e7520a 100644
@@ -86,7 +86,7 @@ python () {
         d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; zip -r ${SDK_ZIP_OPTIONS} ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE} .')
      else:
         d.setVar('SDK_ARCHIVE_DEPENDS', 'xz-native')
-       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
+       d.setVar('SDK_ARCHIVE_CMD', 'cd ${SDK_OUTPUT}/${SDKPATH}; tar ${SDKTAROPTS} ${SDKTAROPTS_ADDON} -cf - . | xz ${SDK_XZ_OPTIONS} > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}')
  }
 
  SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
@@ -286,6 +286,7 @@ python check_sdk_sysroots() {
  }
 
Quoted 6 lines

meta/classes-recipe/populate_sdk_base.bbclass python check_sdk_sysroots() { · line 290

Quoted 3 lines
meta/classes-recipe/populate_sdk_base.bbclass +1 -0
  SDKTAROPTS = "--owner=root --group=root"
+SDKTAROPTS_ADDON ?= "--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"
 

Thanks, looks good. I did wonder if we could just put this in SDKTAROPTS though? Do we really need to add a new variable?

Functionality-wise it's fine to add it to SDKTAROPTS. The default value I added would give people the chance to experiment with different options as well.

If you want me to "hard code" it I'll create a v2.

Just let me know.

Quoted 5 lines

Cheers,

Richard

Regards,

Robert

Signature · 11 lines
Robert Berger
Embedded Software Evangelist

Reliable Embedded Systems
Consulting Training Engineering
URL: https://www.reliableembeddedsystems.com

Schedule a web meeting:
https://calendly.com/reliableembeddedsystems/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
#4 lore raw
In reply to a message not in the archive
Quoted 12 lines · Robert Berger

Hi,

My comments are inline

Quoted 6 lines · Richard Purdie
Quoted 2 lines

+SDKTAROPTS_ADDON ?= "--clamp-mtime --mtime=@${SOURCE_DATE_EPOCH}"

Thanks, looks good. I did wonder if we could just put this in SDKTAROPTS though? Do we really need to add a new variable?

Quoted 7 lines

Functionality-wise it's fine to add it to SDKTAROPTS. The default value I added would give people the chance to experiment with different options as well.

If you want me to "hard code" it I'll create a v2.

Just let me know.

Lets just add to the existing variable, I don't think we need another one for this.

Cheers,

Richard