[opensuse-packaging] Changing locale settings for building a package
I’m working on creating a package where the ‘build’ process seems to depend on being run under a UTF-8 locale. It turns out the the package when built on the OBS succeeds, but contains an invalid file, due to improper multibyte handling. I can get the same invalid file by doing a ‘LC_ALL=C make’ on my local system. Is there a way to make OBS run under a UTF-8 locale, like ‘en_US.UTF-8’? What is the recommend way of handling problems like this? -- Karl Ove Hufthammer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 17/02/13 18:19, Karl Ove Hufthammer escribió:
I’m working on creating a package where the ‘build’ process seems to depend on being run under a UTF-8 locale. It turns out the the package when built on the OBS succeeds, but contains an invalid file, due to improper multibyte handling. I can get the same invalid file by doing a ‘LC_ALL=C make’ on my local system.
Is there a way to make OBS run under a UTF-8 locale, like ‘en_US.UTF-8’? What is the recommend way of handling problems like this?
What you want is to fix the root cause, not to make build run which utf8 locale. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sun, 17 Feb 2013 22:25, Cristian Rodríguez <crrodriguez@...> wrote:
El 17/02/13 18:19, Karl Ove Hufthammer escribió:
I’m working on creating a package where the ‘build’ process seems to depend on being run under a UTF-8 locale. It turns out the the package when built on the OBS succeeds, but contains an invalid file, due to improper multibyte handling. I can get the same invalid file by doing a ‘LC_ALL=C make’ on my local system.
Is there a way to make OBS run under a UTF-8 locale, like ‘en_US.UTF-8’? What is the recommend way of handling problems like this?
What you want is to fix the root cause, not to make build run which utf8 locale.
Lets be VERY careful here and NOT trow stones, because we may be in a glasshouse. I'll give you an example: A file, with changeing encoding (e.g. UTF16be <-> UTF16le) has to be modified. In an unicode aware environment this works. In an ASCII 7bit (LANG=C) it will crash. Upstream says: Use unicode aware environment or die. Root cause is the NON-unicode aware build environment. Been there, done that, got no shirt. Chiniese is FUN, not. @Karl: To patch the Makefile to export the LANG=xx.UTF-8 you need, is a not nice way, but it may be helpful to start the fix. Isolate what file comes out invalid, what is done to create this file, and maybe what singluar command causes the change from valid to invalid. Then try to prefix just that command from <cmd> to LANG=xx.UTF-8 <cmd>. Try to contact upstream about the trouble, if upstream is NOT helful, make note about that in the changelog and the spec file. -- Yamaban.
su. den 17. 02. 2013 klokka 23.26 (+0100) skreiv Yamaban:
@Karl: To patch the Makefile to export the LANG=xx.UTF-8 you need, is a not nice way, but it may be helpful to start the fix.
Isolate what file comes out invalid, what is done to create this file, and maybe what singluar command causes the change from valid to invalid.
Then try to prefix just that command from <cmd> to LANG=xx.UTF-8 <cmd>.
Prefixing the ‘make’ command with ‘LC_ALL=en_US.UTF-8’ did the trick. Thanks everyone for the suggestion.
Try to contact upstream about the trouble, if upstream is NOT helful, make note about that in the changelog and the spec file.
Well, I’m actually both upstream and the packager in this case. And I don’t really see an easy way to fix this, except publishing the source code with the given file ‘pre-compiled’. The application (a command-line one) depends on being run in an UTF-8 environment, which is not really a problem, as ‘everyone’ uses UTF-8 today (people not doing this is not the target audience of this application, as it’s a dictionary application for words based on non-ASCII/Unicode characters). Basically, what the build step does is run awk, sort, grep and iconv on a UTF-8 text file to create a new text file. When run under the C locale, the first three commands don’t work properly (iconv complains about an ‘illegal input sequence’). But since ‘LC_ALL=en_US.UTF-8’ works, I’m basically happy. :) -- Karl Ove Hufthammer http://huftis.org/ Jabber: karl@huftis.org -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Dnia niedziela, 17 lutego 2013 22:19:02 Karl Ove Hufthammer pisze:
I’m working on creating a package where the ‘build’ process seems to depend on being run under a UTF-8 locale. It turns out the the package when built on the OBS succeeds, but contains an invalid file, due to improper multibyte handling. I can get the same invalid file by doing a ‘LC_ALL=C make’ on my local system.
Is there a way to make OBS run under a UTF-8 locale, like ‘en_US.UTF-8’? What is the recommend way of handling problems like this?
How about ordering { LANG=en_US.UTF-8 make; }? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 18/02/13 14:11, Krzysztof Żelechowski escribió:
Dnia niedziela, 17 lutego 2013 22:19:02 Karl Ove Hufthammer pisze:
I’m working on creating a package where the ‘build’ process seems to depend on being run under a UTF-8 locale. It turns out the the package when built on the OBS succeeds, but contains an invalid file, due to improper multibyte handling. I can get the same invalid file by doing a ‘LC_ALL=C make’ on my local system.
Is there a way to make OBS run under a UTF-8 locale, like ‘en_US.UTF-8’? What is the recommend way of handling problems like this?
How about ordering { LANG=en_US.UTF-8 make; }?
I believe he might need to buildrequire glibc-locale too . -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 18.02.2013 20:14, schrieb Cristian Rodríguez:
El 18/02/13 14:11, Krzysztof Żelechowski escribió:
How about ordering { LANG=en_US.UTF-8 make; }?
I believe he might need to buildrequire glibc-locale too .
No, that's required by rpm-build already :-) It might still be a good idea to add an explicit dependency to express clearly that it is needed. -- Stefan Seyfried "If your lighter runs out of fluid or flint and stops making fire, and you can't be bothered to figure out about lighter fluid or flint, that is not Zippo's fault." -- bkw -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Cristian Rodríguez
-
Karl Ove Hufthammer
-
Krzysztof Żelechowski
-
Stefan Seyfried
-
Yamaban