Bug 6964

Summary: command "source toaster start" does not work with zsh
Product: [Build System, Metadata & Runtime] Toaster Reporter: fabrice.coulon
Component: toasterAssignee: Ed Bartosh <eduard.bartosh>
Status: VERIFIED FIXED QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: Low CC: alexandru.costinx.roman, alexandru.damian, belen.barros.pena, cristiana.voicu, eduard.bartosh, kergoth, richard.purdie
Version: unspecified   
Target Milestone: 1.9   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description fabrice.coulon 2014-11-13 14:21:32 UTC
I followed the instructions from:

https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster

But when I reach the following line:

% source toaster start
dirname: missing operand
Try `dirname --help' for more information.
/home/fabrice/vpython/poky/bitbake/bin/toaster:211: = not found

% echo $SHELL
/bin/zsh

Also when I open bitbake/bin/toaster, the first line starts with "#!/bin/bash" indicating that this is a bash script only.

Why is is needed to source this script in the current shell?
Comment 1 Alexandru Damian 2014-11-13 14:37:44 UTC
"source toaster start" is needed to start the bitbake server and the toasterui logging service - this is what enables toaster to record your builds

I would suggest you start "bash" as shell before sourceing "oe-init-build-env" until we fix the zsh compatibility problem
Comment 2 fabrice.coulon 2014-11-17 08:59:55 UTC
I understand that "source toaster start" is needed my question was instead why is "source" needed?

It would be just fine to run "./toaster start" even when using zsh as user shell, since like in many Linux boxes, bash is also installed.
Comment 3 Alexandru Damian 2014-11-17 10:50:50 UTC
Sourcing the file is needed because it sets environment variables that configure the build system without the need to spawn a new shell.

If you run "env" before and after sourcing the file, you can see the difference, especially the BBSERVER variable that points to the bitbake server.

Additionally the command launches the bitbake server and the toasterui (the build recording component), leaving the current shell prepared to take any bitbake commands in client mode - i.e. the bitbake command that is run after sourcing the file works in a different mode than a regular bitbake command.
Comment 4 fabrice.coulon 2014-11-27 08:13:09 UTC
It would be nice if the toaster command would output these shell variables in the requested format, like for example the ssh-agent command do, for example:

usage: toaster [options] start|stop|...
Options:
  -c          Generate C-shell commands on stdout.
  -s          Generate Bourne shell commands on stdout.
  -p          Generate Posix shell commands on stdout.


For example:

% toaster -s start
BBSERVER=ip:port; export BBSERVER;
...

So that one can do in any Posix compliant shell:

% eval `toaster -p start`

I don't know really this is just a suggestion.

*************
*
* Q: I have to present toaster to my organization, are there any slides available that I can use as a reference?
*
*************
Comment 5 Belen Barros Pena 2014-11-27 09:49:29 UTC
> 
> *************
> *
> * Q: I have to present toaster to my organization, are there any slides
> available that I can use as a reference?
> *
> *************

Hi Fabrice,

The slides for the Toaster presentation at our last dev day might be useful

https://www.yoctoproject.org/sites/default/files/toaster_presentation_elce_2014_interactive_dlr1.pdf

If you need anything else, let me know

Cheers

Belén
Comment 6 Ed Bartosh 2015-05-04 10:06:20 UTC
Should be fixed by this https://lists.yoctoproject.org/pipermail/toaster/2015-May/002064.html
Comment 8 Alexandru Roman 2015-08-31 14:51:46 UTC
verified on: 22afc047dd1b8f83e56c4a9862710776c509e3c5