Bug 10938 - non-deterministic oe-terminal spawning
Summary: non-deterministic oe-terminal spawning
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.3
Assignee: Juro Bystricky
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-01-17 18:30 UTC by Juro Bystricky
Modified: 2017-04-12 22:09 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juro Bystricky 2017-01-17 18:30:19 UTC
when running commands requiring terminal window (devshell, menuconfig),
with terminal setting set to "auto", we may get a different terminal each time we repeat the command.  
I believe the reason is we try to spawn a terminal based on a hard coded priority.
Providing the user does not have "tmux" installed (which is more likely than not), we spawn randomly one of the Konsole, Mate, Terminology, Gnome or Xfce.
These have all the same priority set to 2 and so ordering by priority can/will result in a different order.
This can be verified by printouts, running the same command first I obtained the list:

<class 'oe.terminal.Custom'>,
<class 'oe.terminal.TmuxRunning'>, 
<class 'oe.terminal.TmuxNewWindow'>, 
<class 'oe.terminal.Mate'>, 
<class 'oe.terminal.Terminology'>, 
<class 'oe.terminal.Konsole'>, 
<class 'oe.terminal.Xfce'>, 
<class 'oe.terminal.Gnome'>, 
<class 'oe.terminal.XTerm'>, 
<class 'oe.terminal.Rxvt'>, 
<class 'oe.terminal.Tmux'>, 
<class 'oe.terminal.Screen'>]
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "custom"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: No custom terminal (OE_TERMINAL_CUSTOMCMD) set
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-running"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-new-window"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "mate"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "terminology"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "konsole"

running the second time I got:
<class 'oe.terminal.Custom'>, 
<class 'oe.terminal.TmuxRunning'>, 
<class 'oe.terminal.TmuxNewWindow'>, 
<class 'oe.terminal.Xfce'>, 
<class 'oe.terminal.Mate'>, 
<class 'oe.terminal.Gnome'>, 
<class 'oe.terminal.Konsole'>, 
<class 'oe.terminal.Terminology'>, 
<class 'oe.terminal.Rxvt'>, 
<class 'oe.terminal.XTerm'>, 
<class 'oe.terminal.Tmux'>, 
<class 'oe.terminal.Screen'>]
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "custom"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: No custom terminal (OE_TERMINAL_CUSTOMCMD) set
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-running"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-new-window"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "xfce"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "mate"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "gnome"


So the first time menuconfig popped up in konsole and the second time in gnome.
BTW "Screen" does not seem to have any priority set, so it probably defaults to 0.
Comment 1 Juro Bystricky 2017-04-10 21:56:00 UTC
sent a patch to the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135463.html