diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2019-08-16 14:06:05 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-21 15:29:02 +0100 |
commit | 8102c55bc1851233d3c5632e47e0adfddc4b23f8 (patch) | |
tree | 46f6d89aac60f3d794763366cdccef6c2a09feb2 /meta/classes/libc-package.bbclass | |
parent | fb20d734612d403b3e41a1a781714fd5f63f7e35 (diff) | |
download | poky-8102c55bc1851233d3c5632e47e0adfddc4b23f8.tar.gz |
libc-package.bbclass: Split locale hard link processing into two parts
The locale-processing in cross-localedef was proven to be unsafe to
run in parallel due to the way it tried to make hard links to files
that could disappear before the link operation was completed.
To avoid corruption of the pseudo database, and create a
deterministically generated link tree, the operation of the locale
generation and the hard link resolution have been split into two
separate parts. A side effect of this change is that the do_package()
rule for glibc-locale will be slightly smaller because some of the
hard links were missed in the past, particularly if you had a lot of
cpus free to perform the work.
Before the patch:
% du -sk locale-tree
312524 locale-tree
With the patch:
% du -sk locale-tree
290772 locale-tree
A number of comparisons were performed such as diffing the output,
cross checking the link references using tar's listing output, and
comparing against the results with out a parallel build to ensure the
locale-tree is correct in its final form.
[YOCTO #11299]
[YOCTO #12434]
(From OE-Core rev: 93d935927dd0ec0fa6f0a80a71236a7b00a5d1a4)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/libc-package.bbclass')
-rw-r--r-- | meta/classes/libc-package.bbclass | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 8859dad566..a66e540884 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
@@ -82,6 +82,9 @@ do_collect_bins_from_locale_tree() { | |||
82 | parent=$(dirname ${localedir}) | 82 | parent=$(dirname ${localedir}) |
83 | mkdir -p ${PKGD}/$parent | 83 | mkdir -p ${PKGD}/$parent |
84 | tar -cf - -C $treedir/$parent -p $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent | 84 | tar -cf - -C $treedir/$parent -p $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent |
85 | |||
86 | # Finalize tree by chaning all duplicate files into hard links | ||
87 | cross-localedef-hardlink -c -v ${WORKDIR}/locale-tree | ||
85 | } | 88 | } |
86 | 89 | ||
87 | inherit qemu | 90 | inherit qemu |
@@ -265,7 +268,7 @@ python package_do_split_gconvs () { | |||
265 | bb.error("locale_arch_options not found for target_arch=" + target_arch) | 268 | bb.error("locale_arch_options not found for target_arch=" + target_arch) |
266 | bb.fatal("unknown arch:" + target_arch + " for locale_arch_options") | 269 | bb.fatal("unknown arch:" + target_arch + " for locale_arch_options") |
267 | 270 | ||
268 | localedef_opts += " --force --no-archive --prefix=%s \ | 271 | localedef_opts += " --force --no-hard-links --no-archive --prefix=%s \ |
269 | --inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \ | 272 | --inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \ |
270 | % (treedir, treedir, datadir, locale, encoding, outputpath, name) | 273 | % (treedir, treedir, datadir, locale, encoding, outputpath, name) |
271 | 274 | ||
@@ -273,7 +276,7 @@ python package_do_split_gconvs () { | |||
273 | (path, i18npath, gconvpath, localedef_opts) | 276 | (path, i18npath, gconvpath, localedef_opts) |
274 | else: # earlier slower qemu way | 277 | else: # earlier slower qemu way |
275 | qemu = qemu_target_binary(d) | 278 | qemu = qemu_target_binary(d) |
276 | localedef_opts = "--force --no-archive --prefix=%s \ | 279 | localedef_opts = "--force --no-hard-links --no-archive --prefix=%s \ |
277 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ | 280 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ |
278 | % (treedir, datadir, locale, encoding, name) | 281 | % (treedir, datadir, locale, encoding, name) |
279 | 282 | ||