Bug 2934 - [HOB] Hob should save any customizations into the project's configuration
Summary: [HOB] Hob should save any customizations into the project's configuration
Status: VERIFIED FIXED
Alias: None
Product: Hob
Classification: Build System, Metadata & Runtime
Component: hob (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 1.4 M4
Assignee: Cristiana Voicu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 2935 2950 3007 3213
  Show dependency tree
 
Reported: 2012-08-11 12:28 UTC by Trevor Woerner
Modified: 2013-03-04 12:53 UTC (History)
11 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Woerner 2012-08-11 12:28:06 UTC
When Hob starts it begins by taking the configuration it finds in, for example,
the conf/local.conf file of the project (post "source oe-init-build-env") in which
it is started (e.g. DL_DIR, BB_NUMBER_THREADS, etc). However, any changes the
user subsequently makes to any of these parameters from within Hob are not
updated in the underlying configuration files.

Only after the user explicitly clicks "Save" are any of these modifications
saved, but they're saved not to the project's configuration file(s) but to
a separate Hob-only configuration file in the project's ".hob" directory.

Ideally people should be able to achieve the same customized build result using
either the command-line or Hob for configuration and then using either the
command-line or Hob for the bake step.

It would also be great if this change could apply not just to the build
parameters in conf/local.conf but to everything a user can do within Hob
(i.e. layers, package selection, image selection, etc).
Comment 1 Cristiana Voicu 2012-11-12 08:40:13 UTC
I have started to implement the enhancement which resolves the consistency of configuration files, I almost finished it, but I have an issue. In hob you can save the project configuration as a "template". In fact, it saves all the files in .hob directory (also the configuration files from hob). What will happen when a template is loaded? It should change also the configuration files from "conf/" directory? If not, we will not have consistency, yes means to change configuration files from bitbake for a feature available in hob. 

Can you please advise me which is the best approach for those "templates"?
Comment 2 Trevor Woerner 2012-11-13 13:32:17 UTC
In my experience, Hob never was really saving a "template" as such, it was
saving the full configuration (wasn't it?). In my opinion, the whole
"save as template" wording and functionality should be removed and replaced
with this new "save configuration" feature.

The workflow I was using at the time was to:
- edit some of the configuration files by hand
- start up Hob
- notice that my hand edits were present in the Hob configuration
- make more changes to the configuration using Hob
- find no way to save the configuration in Hob
- select "save as template"
- exit Hob and return to the cmdline
- run "bitbake <image>" on the cmdline and find my Hob edits were not honoured

In my opinion, Hob should be a second way of working with the same
configuration a user would work with from the cmdline in any given work
area (which is created with oe-init-build-env). Presently Hob creates a
second, parallel build in a work area (second to anything done on the cmdline).

In fact I'm not even sure Hob needs an explicit "save" input from the user.
If the user changes the number of threads, why not write that to the
configuration file immediately? (but maybe that wouldn't be a popular idea)

Similarly, a user wouldn't "load a template" explicitly, but simply fire up
Hob in any given work area. The current configuration (conf/local.conf etc...)
would be loaded in, and manipulated by Hob.

Maybe I use Yocto differently than others, but for each project on which I
work (i.e. for each board and/or build) I make separate oe-init-build-env's.
As I switch between projects, I 'cd' into the different project directories.
I don't start Hob once from one of them, and then work with all the others
from the same Hob instance.

How do you others feel about these ideas?
Comment 3 Cristiana Voicu 2012-11-14 11:34:04 UTC
  I agree with you. Also, after speaking with Jessica we have agreed that we will change the " save configuration" functionality, by providing an menu option in hob to load the existing saved configurations and populate the corresponding local configurations.

Thanks,
Cristiana



(In reply to comment #2)
> In my experience, Hob never was really saving a "template" as such, it was
> saving the full configuration (wasn't it?). In my opinion, the whole
> "save as template" wording and functionality should be removed and replaced
> with this new "save configuration" feature.
> 
> The workflow I was using at the time was to:
> - edit some of the configuration files by hand
> - start up Hob
> - notice that my hand edits were present in the Hob configuration
> - make more changes to the configuration using Hob
> - find no way to save the configuration in Hob
> - select "save as template"
> - exit Hob and return to the cmdline
> - run "bitbake <image>" on the cmdline and find my Hob edits were not
> honoured
> 
> In my opinion, Hob should be a second way of working with the same
> configuration a user would work with from the cmdline in any given work
> area (which is created with oe-init-build-env). Presently Hob creates a
> second, parallel build in a work area (second to anything done on the
> cmdline).
> 
> In fact I'm not even sure Hob needs an explicit "save" input from the user.
> If the user changes the number of threads, why not write that to the
> configuration file immediately? (but maybe that wouldn't be a popular idea)
> 
> Similarly, a user wouldn't "load a template" explicitly, but simply fire up
> Hob in any given work area. The current configuration (conf/local.conf
> etc...)
> would be loaded in, and manipulated by Hob.
> 
> Maybe I use Yocto differently than others, but for each project on which I
> work (i.e. for each board and/or build) I make separate oe-init-build-env's.
> As I switch between projects, I 'cd' into the different project directories.
> I don't start Hob once from one of them, and then work with all the others
> from the same Hob instance.
> 
> How do you others feel about these ideas?
Comment 4 Cristiana Voicu 2012-11-27 13:43:08 UTC
After a review made with RP, I have identified some weknesses for my patch. It will work weird for some examples and also it should more abstract. I have to change how the variables are store in a configuration file.
Comment 5 Cristiana Voicu 2013-01-04 13:29:57 UTC
I have made a new implementation following the advices from RP. This can be found at http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=cvoicu/consistency-conf-files and it includes the last 4 commits.

Cristiana
Comment 6 Cristiana Voicu 2013-01-31 12:56:13 UTC
Patch merged to master. commit f0aef9953d3504e673c8572f1ae64cefdf678b0f
Hob now saves hte variables from local.conf and bblayers.conf directly in the build/conf directory. It saves there the variables that before were saved in build/.hob/local-default.conf and build/.hob/bblayers-default.conf.
Comment 7 Andreea Brandusa Proca 2013-02-28 10:14:13 UTC
Verified in commit: 7d22ef28e64de06b6238d0ef9b664c0bee6efa46.
Comment 8 Trevor Woerner 2013-03-02 16:24:54 UTC
I had a chance to test out this new code and it is looking good!
Thanks for implementing this change!


I wonder, though, seeing that it is possible to have configuration variables
such as DL_DIR and BB_NUMBER_THREADS consistent between cmdline and
Hob, would it also be possible to have Hob pick all the rest of a user's
conf/local.conf?

For example:
- MACHINE
- IMAGE_INSTALL_append

?
Comment 9 Cristiana Voicu 2013-03-04 09:03:10 UTC
Hello,

The current implementation is for the following variables:
from local.conf : ["MACHINE", "PACKAGE_CLASSES", "DISTRO", "DL_DIR", "SSTATE_DIR", "SSTATE_MIRRORS", "PARALLEL_MAKE", "BB_NUMBER_THREADS", "CONF_VERSION"]
from bblayers.conf: ["BBLAYERS", "LCONF_VERSION"]

The rest of them are still saved in .hob/template-default.hob. At the beginning, it takes all the vars from bitbake, but if you change them Hob will take them from template-default.hob.  The API to save a var could be used to save any var, but I need to know where to save. For example, if you define a variable in Hob, that was not  defined till then, there is a problem. But, the good news is that this happens rarelly.

Is this the answer you are looking for? :)
Thanks,
Cristiana

(In reply to comment #8)
> I had a chance to test out this new code and it is looking good!
> Thanks for implementing this change!
> 
> 
> I wonder, though, seeing that it is possible to have configuration variables
> such as DL_DIR and BB_NUMBER_THREADS consistent between cmdline and
> Hob, would it also be possible to have Hob pick all the rest of a user's
> conf/local.conf?
> 
> For example:
> - MACHINE
> - IMAGE_INSTALL_append
> 
> ?
Comment 10 Trevor Woerner 2013-03-04 12:44:26 UTC
(In reply to comment #9)
> The current implementation is for the following variables:
> from local.conf : ["MACHINE",

I wonder about this one. In my conf/local.conf MACHINE is set to qemux86,
but when I start Hob the machine setting is set to "-- select a machine --".
Comment 11 Cristiana Voicu 2013-03-04 12:53:27 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > The current implementation is for the following variables:
> > from local.conf : ["MACHINE",
> 
> I wonder about this one. In my conf/local.conf MACHINE is set to qemux86,
> but when I start Hob the machine setting is set to "-- select a machine --".

Aaa..this was made in special for settings(from settings, advanced settings, layers), except machine. I don't think we should take into consideration also the machine.