summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2019-07-08 12:16:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-30 16:44:42 +0100
commitb174d936e91902c3e2ab800856bb7bc492d096a0 (patch)
tree9be6c43da286f8655b8a2f3c4f6b25f2bd42755e /meta/recipes-core
parent648d939192d48aec82ee0a0cf6d49af20a96e789 (diff)
downloadpoky-b174d936e91902c3e2ab800856bb7bc492d096a0.tar.gz
glibc / glibc-locale: Fix stash_locale determinism problems
When using sstate, or performing an incremental build any change to the do_stash_locale() will cause a build failure because do_stash_locale() was destroying the results obtained from the do_install() with several mv operations. A recent change to do_stash_locale() for a different problem illustrated a number of build failures for users in the community. To fix the problem, do_stash_locale() must use copy operations instead of the mv operations. Because this is changed to a copy, the sysroot and package stage need to remove the files that would have been previously removed. The correct "fixup" code to deal with the removal already existed in the previous do_poststash_install_cleanup(). All that needed change was the path to where to remove the files from the sysroot and package stages. In order to force a re-compilation of glibc some unused white space was removed from do_compile() for glibc. I could not find any other way around this and we don't want to have all the community folks to have another iteration where they have to remove their tmp directories or purge some portion of the sstate. It also makes this change bisectable. If the change to the glibc is not included, it will fail with the following message: ===== | DEBUG: Executing shell function do_prep_locale_tree | tar: i18n: Cannot stat: No such file or directory | tar: Exiting with failure status due to previous errors | gzip: /poky/build/tmp/work/core2-64-poky-linux/glibc-locale/2.29-r0/locale-tree//usr/share/i18n/charmaps/*gz.gz: No such file or directory ===== After this one time change I tested changing only the do_stash_locale() function and it now works well because it is deterministically operating off the sstate data or a local build. (From OE-Core rev: 7e62ca2a518f1fe6e2f3c7098d17ed0b73ece48c) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/glibc/glibc-package.inc40
-rw-r--r--meta/recipes-core/glibc/glibc_2.29.bb1
2 files changed, 24 insertions, 17 deletions
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index ff17a193c3..5cfb1b6ab9 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -164,13 +164,13 @@ do_stash_locale () {
164 install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir} 164 install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
165 # Hide away the locale data from the deployment 165 # Hide away the locale data from the deployment
166 if [ -e ${D}${bindir}/localedef ]; then 166 if [ -e ${D}${bindir}/localedef ]; then
167 mv -f ${D}${bindir}/localedef ${dest}${bindir} 167 cp -a ${D}${bindir}/localedef ${dest}${bindir}
168 fi 168 fi
169 if [ -e ${D}${libdir}/gconv ]; then 169 if [ -e ${D}${libdir}/gconv ]; then
170 mv -f ${D}${libdir}/gconv ${dest}${libdir} 170 cp -a ${D}${libdir}/gconv ${dest}${libdir}
171 fi 171 fi
172 if [ -e ${D}${datadir}/i18n ]; then 172 if [ -e ${D}${datadir}/i18n ]; then
173 mv ${D}${datadir}/i18n ${dest}${datadir} 173 cp -a ${D}${datadir}/i18n ${dest}${datadir}
174 fi 174 fi
175 175
176 # Make a copy of all the libraries into the locale stash 176 # Make a copy of all the libraries into the locale stash
@@ -210,30 +210,38 @@ python do_stash_locale_setscene () {
210} 210}
211addtask do_stash_locale_setscene 211addtask do_stash_locale_setscene
212 212
213do_poststash_install_cleanup () { 213PACKAGE_PREPROCESS_FUNCS += "stash_locale_package_cleanup"
214 # Remove all files which do_stash_locale would remove (mv) 214SYSROOT_PREPROCESS_FUNCS += "stash_locale_sysroot_cleanup"
215 # since that task could have come from sstate and not get run. 215stash_locale_cleanup () {
216 cleanupdir=$1
217 # Remove all files which do_stash_locale() copies
216 for i in ${bashscripts}; do 218 for i in ${bashscripts}; do
217 rm -f ${D}${bindir}/$i 219 rm -f ${cleanupdir}${bindir}/$i
218 done 220 done
219 rm -f ${D}${bindir}/localedef 221 rm -f ${cleanupdir}${bindir}/localedef
220 rm -rf ${D}${datadir}/i18n 222 rm -rf ${cleanupdir}${datadir}/i18n
221 rm -rf ${D}${libdir}/gconv 223 rm -rf ${cleanupdir}${libdir}/gconv
222 rm -rf ${D}/${localedir} 224 rm -rf ${cleanupdir}/${localedir}
223 rm -rf ${D}${datadir}/locale 225 rm -rf ${cleanupdir}${datadir}/locale
224 if [ "${libdir}" != "${exec_prefix}/lib" ] && [ "${root_prefix}/lib" != "${exec_prefix}/lib" ]; then 226 if [ "${libdir}" != "${exec_prefix}/lib" ] && [ "${root_prefix}/lib" != "${exec_prefix}/lib" ]; then
225 if [ -d "${D}${exec_prefix}/lib" ]; then 227 if [ -d "${cleanupdir}${exec_prefix}/lib" ]; then
226 if [ -z "${ARCH_DYNAMIC_LOADER}" -o \ 228 if [ -z "${ARCH_DYNAMIC_LOADER}" -o \
227 ! -e "${D}${exec_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then 229 ! -e "${cleanupdir}${exec_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then
228 # error out if directory isn't empty 230 # error out if directory isn't empty
229 # this dir should only contain locale dir 231 # this dir should only contain locale dir
230 # which has been deleted in the previous step 232 # which has been deleted in the previous step
231 rmdir ${D}${exec_prefix}/lib 233 rmdir ${cleanupdir}${exec_prefix}/lib
232 fi 234 fi
233 fi 235 fi
234 fi 236 fi
235} 237}
236addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package 238
239stash_locale_sysroot_cleanup() {
240 stash_locale_cleanup ${SYSROOT_DESTDIR}
241}
242stash_locale_package_cleanup() {
243 stash_locale_cleanup ${PKGD}
244}
237 245
238pkg_postinst_nscd () { 246pkg_postinst_nscd () {
239 if [ -z "$D" ]; then 247 if [ -z "$D" ]; then
diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
index 073d1533e3..c6b2caad42 100644
--- a/meta/recipes-core/glibc/glibc_2.29.bb
+++ b/meta/recipes-core/glibc/glibc_2.29.bb
@@ -121,7 +121,6 @@ do_compile () {
121 echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\"" 121 echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
122 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#" 122 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
123 fi 123 fi
124
125} 124}
126 125
127require glibc-package.inc 126require glibc-package.inc