Expected: The following should propagate the LC_ALL value to the build environment. # LC_ALL="anything" emerge "anything" Actual: The LC_ALL from /etc/profile is always used by emerge, regardless of user environment. Steps to demonstrate: (1) echo 'LC_ALL="en_US.utf-8"' > /etc/env.d/02locale (2) env-update && source /etc/profile (3) copy any ebuild from /usr/portage to /usr/local/portage (4) add the following line immediately past "src_unpack()" locale; export | grep LC_ALL; die "just testing env propagation" (5) LC_ALL="C" emerge "your_moified_ebuild" You will that that the variable LC_ALL="C" did NOT propagate. This is irrespective of FEATURES value. (6) unset LC_ALL; emerge info This command will show LC_ALL as unset, but then builds with LC_ALL from /etc/profile! Workaround: modify /etc/portage/bashrc BUT emerge _should_ propagate LC_ALL just like any other variable! Notes: # epm -qG portage sys-apps/portage-2.0.54 Root and portage users have no LC_ALL in their bashrc or bash_profile files.
Created attachment 83643 [details] Emerge info output with sensitive information removed.
One example of why this is an issue for users with unicode locales. See: bug 125998 http://bugs.gentoo.org/show_bug.cgi?id=125998
works fine for me added `locale` to the src_install() func of sandboxshell package: # emerge sandboxshell ... >>> Install sandboxshell-0.3 into /var/tmp/portage/sandboxshell-0.3/image/ LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" ... # LC_ALL=C emerge sandboxshell ... >>> Install sandboxshell-0.3 into /var/tmp/portage/sandboxshell-0.3/image/ LANG= LC_CTYPE="C" LC_NUMERIC="C" ... # LC_ALL=en_US emerge sandboxshell ... >>> Install sandboxshell-0.3 into /var/tmp/portage/sandboxshell-0.3/image/ LANG= LC_CTYPE="en_US" LC_NUMERIC="en_US" ...
(In reply to comment #3) Sorry, but the bug says the the LC_ALL doesn't propagate if it is set in the global environment. It is not set in your global environment, as shown by your command: emerge sandboxshell ... >>> Install sandboxshell-0.3 into /var/tmp/portage/sandboxshell-0.3/image/ LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" You need to set the global locale first, such that all logins already have a value of LC_ALL. Then emerge fails to override that value.
I set the global locale to: LC_ALL="en_US.utf-8" via the file /etc/env.d/02locale Now, to reproduce your test: locale; LC_ALL="C" sudo emerge sandboxshell LANG= ... LC_ALL=en_US.utf8 Calculating dependencies ...done! >>> emerge (1 of 1) app-shells/sandboxshell-0.3 to / >>> md5 files ;-) sandboxshell-0.3.ebuild ... >>> Install sandboxshell-0.3 into /var/tmp/portage/sandboxshell-0.3/image/ category app-shells LANG= LC_CTYPE="en_US.utf-8" ... LC_ALL=en_US.utf-8
i was working off of your summary rather than comments your comment (6) is invalid, that is expected behavior changing summary to be accurate since this isnt LC_ALL specific at all
Allowing the calling env to override the build env is a recipe for unpredictable results. Therefore, I'd say that it should be optional and non-default. We can recommend /etc/portage/bashrc as the preferred means to override the env.
(In reply to comment #7) Yes. Modifying /etc/portage/bashrc works. But I don't wish to edit it every time I perform an emerge. I suppose a set of case statements on $CATEGORY and $P in /etc/portage/bashrc could work, but manual setting of a particular environment variable from the 'emerge' command would be ideal. Duplicating the behavior of /bin/env is the desired behavior. Propose: - /etc/portage/package.env - emerge --env VARIABLE=VALUE ... Most documentation and discussions indicate use of: VARIABLE=VALUE emerge ... But this will not work across all systems, depending on /etc/env.d, /etc/profile.d, and /etc/profile .
*** This bug has been marked as a duplicate of 51370 ***