opkg-make-index: use ctime instead of mtime
PATCH 1/1 opkg-make-index: use ctime instead of mtime
From: Stefan Agner <[email protected]>
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as:
Downloading file:/../tmp/work/../image/...ipk.
Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipk
However, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this.
---
This addresses the issue discussed here:
http://lists.openembedded.org/pipermail/openembedded-core/2018-October/156348.html
opkg-make-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
opkg-make-index +3 -3
@@ -115,12 +115,12 @@ for abspath in files: pkg = None fnameStat = os.stat(abspath) if filename in old_pkg_hash: - if filename in pkgsStamps and int(fnameStat.st_mtime) == pkgsStamps[filename]: + if filename in pkgsStamps and int(fnameStat.st_ctime) == pkgsStamps[filename]: if (verbose): sys.stderr.write("Found %s in Packages\n" % (filename,)) pkg = old_pkg_hash[filename] else: - sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,)) + sys.stderr.write("Found %s in Packages, but ctime differs - re-reading\n" % (filename,)) if not pkg: if (verbose):
@@ -137,7 +137,7 @@ for abspath in files: else: old_filename = "" s = packages.add_package(pkg, opt_a) - pkgsStamps[filename] = fnameStat.st_mtime + pkgsStamps[filename] = fnameStat.st_ctime if s == 0: if old_filename: # old package was displaced by newer
Signature · 1 line
2.13.6
Quoted 11 lines · Stefan Agner
From: Stefan Agner <[email protected]>
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as:
Downloading file:/../tmp/work/../image/...ipk. Removing corrupt package file
/../sysroot/../var/cache/opkg/volatile/...ipk
Quoted 5 lines
However, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this.
Suggested-by Khem Raj <[email protected]>Signed-off-by Stefan Agner <[email protected]>
(I've been following this problem and this makes sense to me)
Quoted 3 lines
---
This addresses the issue discussed here:
http://lists.openembedded.org/pipermail/openembedded-core/2018-October/156348.html
Quoted 37 lines
opkg-make-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)opkg-make-index +0
-1@@ -115,12 +115,12 @@ for abspath in files: pkg = None fnameStat = os.stat(abspath) if filename in old_pkg_hash: - if filename in pkgsStamps and int(fnameStat.st_mtime) ==pkgsStamps[filename]:
+ if filename in pkgsStamps andint(fnameStat.st_ctime)==
pkgsStamps[filename]:
if (verbose):
sys.stderr.write("Found %s in Packages\n" %
(filename,))
pkg = old_pkg_hash[filename]
else:
- sys.stderr.write("Found %s in Packages, but mtime
differs - re-reading\n" % (filename,))
+ sys.stderr.write("Found %s in Packages, but ctime
differs - re-reading\n" % (filename,))if not pkg:
if (verbose):opkg-make-index +1
-1@@ -137,7 +137,7 @@ for abspath in files: else: old_filename = "" s = packages.add_package(pkg, opt_a) - pkgsStamps[filename] = fnameStat.st_mtime + pkgsStamps[filename] = fnameStat.st_ctime if s == 0: if old_filename: # old package was displaced by newer
Khem Raj
Acked-byQuoted 13 lines · On Sat, Oct 20, 2018 at 10:16 AM <[email protected]> wrote:
Quoted 11 lines · Stefan Agner
From: Stefan Agner <[email protected]>
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as:
Downloading file:/../tmp/work/../image/...ipk. Removing corrupt package file
/../sysroot/../var/cache/opkg/volatile/...ipk
Quoted 8 lines
Quoted 5 lines
However, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this.
Suggested-by Khem Raj <[email protected]>Signed-off-by Stefan Agner <[email protected]>Acked-by Richard Purdie <[email protected]>
Yep, thats for following up with implementing it.
Quoted 44 lines
(I've been following this problem and this makes sense to me)
Quoted 3 lines
---
This addresses the issue discussed here:http://lists.openembedded.org/pipermail/openembedded-core/2018-October/156348.html
Quoted 37 lines
opkg-make-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)opkg-make-index +0
-1@@ -115,12 +115,12 @@ for abspath in files: pkg = None fnameStat = os.stat(abspath) if filename in old_pkg_hash: - if filename in pkgsStamps and int(fnameStat.st_mtime) ==pkgsStamps[filename]:
+ if filename in pkgsStamps andint(fnameStat.st_ctime)==
pkgsStamps[filename]:
if (verbose):
sys.stderr.write("Found %s in Packages\n" %
(filename,))
pkg = old_pkg_hash[filename]
else:
- sys.stderr.write("Found %s in Packages, but mtime
differs - re-reading\n" % (filename,))
+ sys.stderr.write("Found %s in Packages, but ctime
differs - re-reading\n" % (filename,))if not pkg:
if (verbose):opkg-make-index +1
-1@@ -137,7 +137,7 @@ for abspath in files: else: old_filename = "" s = packages.add_package(pkg, opt_a) - pkgsStamps[filename] = fnameStat.st_mtime + pkgsStamps[filename] = fnameStat.st_ctime if s == 0: if old_filename: # old package was displaced by newer
makes sense, sounds like this is going to fix a bunch of nasty intermittent failures, thanks!
merged
Quoted 51 lines · Stefan Agner
From: Stefan Agner <[email protected]>
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as:
Downloading file:/../tmp/work/../image/...ipk.
Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipkHowever, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this.
Suggested-by Khem Raj <[email protected]>Signed-off-by Stefan Agner <[email protected]>---
This addresses the issue discussed here:
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openembedded.org_pipermail_openembedded-2Dcore_2018-2DOctober_156348.html&d=DwIBaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wNcrL2akRn6jfxhHaKavUrJB_C9JAMXtynjLd8ZzgXQ&m=Innit37H69hUyZPGuuhwO6R5CbUNNTfXQwxbqsEA2NE&s=oFvqASrFTgasDqZ901HeIBFSsf6Cn4FcBieOOBU4MdI&e=opkg-make-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)opkg-make-index +3
-3@@ -115,12 +115,12 @@ for abspath in files: pkg = None fnameStat = os.stat(abspath) if filename in old_pkg_hash: - if filename in pkgsStamps and int(fnameStat.st_mtime) == pkgsStamps[filename]: + if filename in pkgsStamps and int(fnameStat.st_ctime) == pkgsStamps[filename]: if (verbose): sys.stderr.write("Found %s in Packages\n" % (filename,)) pkg = old_pkg_hash[filename] else: - sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,)) + sys.stderr.write("Found %s in Packages, but ctime differs - re-reading\n" % (filename,)) if not pkg: if (verbose):@@ -137,7 +137,7 @@ for abspath in files: else: old_filename = "" s = packages.add_package(pkg, opt_a) - pkgsStamps[filename] = fnameStat.st_mtime + pkgsStamps[filename] = fnameStat.st_ctime if s == 0: if old_filename: # old package was displaced by newer
Signature · 3 lines
Cheers, Alejandro
Hi Alejandro,
Quoted 4 lines · Alejandro Del Castillo
makes sense, sounds like this is going to fix a bunch of nasty intermittent failures, thanks!
merged
Thanks for merging!
With the merge in opkg-utils this is not yet actively used in OE of course. So my question: Is there a new release of opkg-utils planned anytime soon? Or should that be added as a patch in the OE recipe for now?
--
Stefan
Quoted 58 lines · Stefan Agner
Quoted 51 lines
From: Stefan Agner <[email protected]>
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as:
Downloading file:/../tmp/work/../image/...ipk.
Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipkHowever, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this.
Suggested-by Khem Raj <[email protected]>Signed-off-by Stefan Agner <[email protected]>---
This addresses the issue discussed here:
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openembedded.org_pipermail_openembedded-2Dcore_2018-2DOctober_156348.html&d=DwIBaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wNcrL2akRn6jfxhHaKavUrJB_C9JAMXtynjLd8ZzgXQ&m=Innit37H69hUyZPGuuhwO6R5CbUNNTfXQwxbqsEA2NE&s=oFvqASrFTgasDqZ901HeIBFSsf6Cn4FcBieOOBU4MdI&e=opkg-make-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)opkg-make-index +3
-3@@ -115,12 +115,12 @@ for abspath in files: pkg = None fnameStat = os.stat(abspath) if filename in old_pkg_hash: - if filename in pkgsStamps and int(fnameStat.st_mtime) == pkgsStamps[filename]: + if filename in pkgsStamps and int(fnameStat.st_ctime) == pkgsStamps[filename]: if (verbose): sys.stderr.write("Found %s in Packages\n" % (filename,)) pkg = old_pkg_hash[filename] else: - sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,)) + sys.stderr.write("Found %s in Packages, but ctime differs - re-reading\n" % (filename,)) if not pkg: if (verbose):@@ -137,7 +137,7 @@ for abspath in files: else: old_filename = "" s = packages.add_package(pkg, opt_a) - pkgsStamps[filename] = fnameStat.st_mtime + pkgsStamps[filename] = fnameStat.st_ctime if s == 0: if old_filename: # old package was displaced by newerSignature · 3 lines
Cheers, Alejandro
Quoted 9 lines · Stefan Agner
Hi Alejandro,
Quoted 4 lines · Alejandro Del Castillo
makes sense, sounds like this is going to fix a bunch of nasty intermittent failures, thanks!
merged
Thanks for merging!
np
Quoted 4 lines
With the merge in opkg-utils this is not yet actively used in OE of course. So my question: Is there a new release of opkg-utils planned anytime soon? Or should that be added as a patch in the OE recipe for now?
I plan to release opkg & opkg-utils, version 0.4.0 on mid-December. Maybe its worth adding the patch now?
Signature · 3 lines
Cheers, Alejandro