New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 761153 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

cros_sdk always prints " * Generating locale-archive: forcing # of jobs to 1"

Project Member Reported by briannorris@chromium.org, Aug 31 2017

Issue description

I'm not the only one who's been annoyed:

https://groups.google.com/a/chromium.org/d/msg/chromium-os-dev/BKKIACmwT-w/HQD0_BHlCwAJ

This comes from the 'locale-gen' tool, which is packaged with sys-libs/glibc, and comes from 'extra' sources included in the Gentoo glibc patchset.

It seems that somewhere between 2.13 (what we were using last year) and 2.23 (what we have now), the Gentoo patchset included code that automatically determined the number of jobs to use, even if we didn't specify it:


if [[ -z ${JOBS_MAX} ]] ; then
        JOBS_MAX=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
        : ${JOBS_MAX:=1}
fi


It then decided to complain about that later:

if ${LOCALE_ARCHIVE} ; then
        if [[ ${JOBS_MAX} != 1 ]] ; then
                ewarn "Generating locale-archive: forcing # of jobs to 1"
                JOBS_MAX=1
        fi
...


It seems like it should only complain about that if a user requested a number of jobs, and the script decided to reject it. But if no "--jobs" argument was provided, it should just do its thing silently.

(Another argument: this warning should possibly respect the "--quiet" arg that we're providing it?)

Anyway, patch attached. Should we get this (or similar) upstreamed to Gentoo?

Assigning to vapier only for the answer to how the previous question should be handled.
 
locale-gen.diff
906 bytes Download
Or, we could hack this:

diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index f5737004ec8c..1b75a9c2aa78 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -226,7 +226,7 @@ generate_locales() {
     # but locale-gen doesn't need to be run in any locale in the
     # first place, so just go with C to keep it fast.
     chroot "${FLAGS_chroot}" env LC_ALL=C locale-gen -q -u \
-      -G "$(printf '%s\n' "${gen_locales[@]}")"
+      -j 1 -G "$(printf '%s\n' "${gen_locales[@]}")"
   fi
 }

Comment 2 by vapier@chromium.org, Aug 31 2017

it's been mentioned a few times in various e-mail threads, but no bug has been posted before, and we've just been ignoring it ;)

improving locale-gen makes sense, but that workaround should also be fine since we're forced to use -j1 by locale-archive anyways

my blue sky dreams have been to improve the upstream glibc's localedef tool to properly support parallel generation and then delete a lot of the locale-gen script logic.  but that's quite a can o worms.
Owner: briannorris@chromium.org
Status: Started (was: Assigned)
I'll upload the workaround then, and let your blue sky dreams age in peace ;)
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosutils/+/e83a1472848314742e1ad0742ce16b1bfd764e71

commit e83a1472848314742e1ad0742ce16b1bfd764e71
Author: Brian Norris <briannorris@chromium.org>
Date: Fri Sep 01 05:10:47 2017

enter_chroot: force jobs=1; locale-gen complains less; profit!

locale-gen has some logic to automagically determine the numbers of CPUs
(and therefore number of jobs). But it also has logic to force jobs to 1
when running locale-archive. The net effect is that we get 1 job, and an
annoying warning along with it:

 * Generating locale-archive: forcing # of jobs to 1

This happens every time we enter the chroot.

Let's just force jobs=1, to workaround locale-gen's internal
disagreements.

BUG= chromium:761153 
TEST=`cros_sdk`

Change-Id: Id3f0b8537eb4d987c1e2d94b83c53240750b0d49
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/646763
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e83a1472848314742e1ad0742ce16b1bfd764e71/sdk_lib/enter_chroot.sh

Status: Fixed (was: Started)
w00t

Comment 7 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 8 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment