| Summary: | Wrong path to terminfo files in buildtools-tarball causes python version check to fail | ||
|---|---|---|---|
| Product: | [Yocto Project Subprojects] ADT | Reporter: | Saul Wold <sgw> |
| Component: | adt | Assignee: | Hongxu Jia <hongxu.jia> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | hongxu.jia, kai.kang, liezhi.yang, mark.hatle, ning.zhang, poky.adt.watcher, poky.watcher, Qi.Chen, richard.purdie, sen.zhang, sgw, wenzong.fan, yi.zhao |
| Version: | 1.5 | ||
| Target Milestone: | 1.5 M3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Saul Wold
2013-06-14 17:16:25 UTC
I tried setting TERMPATH TERMINFO_DIRS, TERMINFO, all had no effect with the xterm-256color entry, it would search the nativesdk terminfo if set, but failing to find it would then search the system terminfo files More interesting is is works OK on Fedora, but fails on Ubuntu for the same TERM settings Since we are operating in a script, preserving TERM and unsetting TERM seems like the right approach with a consistent result. (In reply to comment #1) > Since we are operating in a script, preserving TERM and unsetting TERM seems > like the right approach with a consistent result. No, this is a really bad idea. Think about devshell for example. Setting TERM and running python should not break and this is a problem in the nativesdk. Lets fix the nativesdk, not hack around it. devshell works fine, it's the value that the shell is testing from python. Vi and all the other tools work fine in a devshell since they are using distro tools, distro terminfo. Even knotty looks correct and sets the correct colors. I agree we need to fix the nativesdk's python build, but until then, people are going to be running into this with older releases and will be getting failures with master. Have a better fix for this pending... This was fixed by http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c281cd149bdbce29fc69cb34c65c4295cfed2060 and http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=534c4d0f1e287d0ac82504b273a5497d3457582a (In reply to comment #5) > This was fixed by > http://git.yoctoproject.org/cgit.cgi/poky/commit/ > ?id=c281cd149bdbce29fc69cb34c65c4295cfed2060 and > http://git.yoctoproject.org/cgit.cgi/poky/commit/ > ?id=534c4d0f1e287d0ac82504b273a5497d3457582a This should fixed the xterm issue but xterm-256color still failed, shall we add a tinfo file for xterm-256color? or just link it to xterm-color simply? I think the issue is still there since xterm-256color is added to terminfo-base in ncurses: NATIVELSBSTRING = "Ubuntu-13.04" TARGET_SYS = "i586-poky-linux" MACHINE = "emenlow-noemgd" master 3dee534f1e25109e0bdb681de0746c336f4b8840 * On host bitbake nativesdk-python -cdevshell root:Python-2.7.3# export TERM=xterm-256color root:Python-2.7.3# which python /home/jiahongxu/yocto/build-20130522-pmount-sysvinit/tmp/sysroots/x86_64-linux/usr/bin/python-native/python root:Python-2.7.3# python -c "import readline;print 'a'" | hexdump -c 0000000 033 [ ? 1 0 3 4 h a \n 000000a * On target root@emenlow-noemgd:~# export TERM=xterm-256color root@emenlow-noemgd:~# which python /usr/bin/python root@emenlow-noemgd:~# python -c "import readline;print 'a'" | hexdump -c 0000000 033 [ ? 1 0 3 4 h a \n While imports readline in python, if the term in terminfo is available and it contains the variable 'km' and 'smm', the readline initialization will output the value of 'smm' which is the escape sequence '\E[?1034h'. 'km' means the terminal has a meta key which is a special key on MIT keyboards, 'smm' means turn on the meta key if this terminal has one. There are ** solutin to fix this issue: 1) Preserving TERM and unsetting TERM, or setting TERM with a terminal without 'smm' (such as terminal 'dumb'). This is the most common approach. https://bugzilla.redhat.com/show_bug.cgi?id=304181 http://bugs.python.org/issue11390 http://lists.gnu.org/archive/html/bug-readline/2013-06/msg00000.html But the effect is global even we don't import readline. 2) Modify readline.c in python, let readline use a term without 'smm' as default terminal (such as 'dumb'), it is similar to the above solution, but it localizes the effect in readline. 3) Modify terminfo.src in ncurses, let terminfo database doesn't contian 'smm', but the kinds of terms we supported is limited. 4) Modify terminal.c and readline.c in GNU Readline library to explicity disable meta key, or just comment out the outputing code. I prefer solution 2, because it has the least side effect. Explicitly use dumb as default terminal to avoid probably escape sequence output. The dumb is used to label tty lines when you don't know what kind of terminal is on it. The characteristics of an unknown terminal are the lowest common denominator. Another option is for the nativesdk version to not hardcode include the readline library, since bitbake imports readline it will work correctly. Hardcoding the terminal to dumb would break the bitbake knotty interface. How about to explicitly disable meta key in python readline module while readline initialization. Meta key is a special key on MIT keyboards such as the space-cadet keyboard, and on Sun Microsystems keyboards, marked as a solid diamond. It almost doesn't exist in our keyboards, so it has no side effect to disable it. |