Skip to contentSkip to conversation

dpkg-native: Avoid 'file changed' errors from tar

PATCH In review Richard Purdie 4 participants 10 messages Mar 28, 2015 – Mar 30, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dpkg-native: Avoid 'file changed' errors from tar

See the patch header for details. Hardlink count duing do_package_write_deb can change causing dpkg-deb failures. We don't care about this error case so avoid it by checking the tar exit code.

[YOCTO #7529]

meta/recipes-devtools/dpkg/dpkg.inc +2 -0
index bbbd881..5db1fde 100644
@@ -4,6 +4,8 @@ SECTION = "base"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
 
+SRC_URI_append_class-native = " file://tar-error-code.patch"
+
 DEPENDS = "zlib bzip2 perl ncurses"
 DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
 RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +54 -0

54 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · Richard Purdie

See the patch header for details. Hardlink count duing do_package_write_deb can change causing dpkg-deb failures. We don't care about this error case so avoid it by checking the tar exit code.

[YOCTO #7529]

Please don't ask someone to see the patch header for information. This should be in the commit log and not necessarily read the diff to find this information.

Please send a v2 adding this information in the commit log.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#2 lore raw
Quoted 8 lines · Otavio Salvador
Quoted 6 lines · Richard Purdie

See the patch header for details. Hardlink count duing do_package_write_deb can change causing dpkg-deb failures. We don't care about this error case so avoid it by checking the tar exit code.

[YOCTO #7529]

Quoted 7 lines
Quoted 1 line

Please don't ask someone to see the patch header for information. This should be in the commit log and not necessarily read the diff to find this information.

Please send a v2 adding this information in the commit log.

Just referring someone to the patch header would be incorrect and I agree a summary of the problem is needed. The commit message in question does have this. I don't see the point of cut and pasting all the details from the header into the commit message. The correct place for the details in a situation like this is the patch header so that someone has full details of the patch without having to look at the repo history.

Cheers,

Richard

#3 lore raw
Quoted 15 lines · Richard Purdie
Quoted 14 lines · Otavio Salvador
Quoted 7 lines · Richard Purdie

See the patch header for details. Hardlink count duing do_package_write_deb can change causing dpkg-deb failures. We don't care about this error case so avoid it by checking the tar exit code.

[YOCTO #7529]

Please don't ask someone to see the patch header for information. This should be in the commit log and not necessarily read the diff to find this information.

Quoted 8 lines
Quoted 1 line

Please send a v2 adding this information in the commit log.

Just referring someone to the patch header would be incorrect and I agree a summary of the problem is needed. The commit message in question does have this. I don't see the point of cut and pasting all the details from the header into the commit message. The correct place for the details in a situation like this is the patch header so that someone has full details of the patch without having to look at the repo history.

+When running do_package_write_deb, we have trees of symlinked files
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package sed-ptest' in /media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#4 lore raw
Quoted 16 lines · Otavio Salvador
meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +7 -0
+When running do_package_write_deb, we have trees of symlinked files
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in

`/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1

meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +5 -0
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
Quoted 4 lines

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Well, I strong disagree with that, I don't believe it makes sense to cut and paste the same information into both places, sorry.

Cheers,

Richard

#5 lore raw
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Otavio Salvador
meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +7 -0
+When running do_package_write_deb, we have trees of symlinked files
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in

`/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1

meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +5 -0
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
Quoted 7 lines
Quoted 4 lines

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Well, I strong disagree with that, I don't believe it makes sense to cut and paste the same information into both places, sorry.

I disagree someone should go into a patch header to understand it.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#6 lore raw
Quoted 27 lines · Otavio Salvador
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Otavio Salvador
meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +7 -0
+When running do_package_write_deb, we have trees of symlinked files
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in

`/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1

meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +5 -0
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
Quoted 7 lines
Quoted 4 lines

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Well, I strong disagree with that, I don't believe it makes sense to cut and paste the same information into both places, sorry.

Quoted 2 lines

I disagree someone should go into a patch header to understand it.

I agree with Otavio here. When generating both short and long changelogs, I always use the commit messages. I don't inspect the contents of the changes to understand what happened. Having to inspect means that I can't automate the process using the git commands.

--Mark

#7 lore raw
Quoted 28 lines · Mark Hatle
Quoted 27 lines · Otavio Salvador
Quoted 24 lines · Richard Purdie
Quoted 16 lines · Otavio Salvador
(quoted diff) +7 -0
+When running do_package_write_deb, we have trees of symlinked files
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in

`/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1

(quoted diff) +5 -0
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
Quoted 4 lines

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Well, I strong disagree with that, I don't believe it makes sense to cut and paste the same information into both places, sorry.

Quoted 7 lines
Quoted 2 lines

I disagree someone should go into a patch header to understand it.

I agree with Otavio here. When generating both short and long changelogs, I always use the commit messages. I don't inspect the contents of the changes to understand what happened. Having to inspect means that I can't automate the process using the git commands.

Someone pointed out I might not have been as clear as I intended here. I was not saying I thought the commit and patch log need to match. What I meant was that I don't like seeing "See the patch header for details." in the commit message, because it causes me problems with git generated changelogs. (I have developers/customers who then come back to me asking why I didn't include the contents of the patch header in my generated changelogs.)

As for the content, the easiest is likely to duplicate the patch header into the commit message... but of course that isn't required.

--Mark

Quoted 2 lines

--Mark

#8 lore raw
In reply to Otavio Salvador
Quoted 4 lines · Otavio Salvador
Quoted 2 lines · Richard Purdie
Quoted 1 line · Otavio Salvador

+When running do_package_write_deb, we have trees of symlinked files

Richard, did you intend to write "hardlinked" here?

Quoted 23 lines
Quoted 15 lines
Quoted 15 lines
meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +6 -0
+such as the dbg source files in ${PN}-dbg. If something makes another
+copy of one of those files (or deletes one), the number of links a file
+has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in

`/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'. +| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1

meta/recipes-devtools/dpkg/dpkg/tar-error-code.patch new file +5 -0
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
Quoted 7 lines
Quoted 4 lines

This is exactly what I would expect for the long commit log. Sorry but I strongly disagrese with you as the commit log in the patch does connect with the short log so I still believe the commit log could be improved.

Well, I strong disagree with that, I don't believe it makes sense to cut and paste the same information into both places, sorry.

Quoted 2 lines

I disagree someone should go into a patch header to understand it.

It's my impression that if Richard had omitted the first sentence of his commit message, the message would still have been descriptive enough, and nobody would ever have complained.

Regards,
Andreas

#9 lore raw
Quoted 7 lines · Andreas Oberritter
Quoted 4 lines · Otavio Salvador
Quoted 2 lines · Richard Purdie
Quoted 1 line · Otavio Salvador

+When running do_package_write_deb, we have trees of symlinked files

Richard, did you intend to write "hardlinked" here?

I did, yes. I'll correct that, thanks.

Quoted 3 lines

It's my impression that if Richard had omitted the first sentence of his commit message, the message would still have been descriptive enough, and nobody would ever have complained.

That is the impression I got too. Its odd that a comment intended to help the user find more information should generate this discussion, particularly as the details in the patch header are more implementation oriented and make sense when you're looking at the dpkg code (which you can in the patch).

So I may simply remove the comment that is causing contention.

Cheers,

Richard