Properly written BSP layers shouldn't break builds of other MACHINEs when they are included in BBLAYERS. Can you extend http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html to explicitly say that BSP layer shouldn't change metadata for other MACHINEs (i.e. describe that MACHINE overrides have to be used for each assignment/append and MACHINE subdirectories for files used from SRC_URI)? With right use of overrides adding BSP layer in BBLAYERS should only increment some PRINC values and _add_ support for more MACHINEs without unexpected changes to other MACHINEs. It's hard to explain this to some people and having link to some well written documentation would help a lot, thanks.
Scott, Can you work with Martin to add the correct content? Thank, Jessica
Hi Martin, Is this fix precautionary? Or did you run into a situation where a BSP layer broke a build of another MACHINE? Understanding this will help me better place this fix to the documentation. Thanks, Scott
> Is this fix precautionary? Or did you run into a situation where a BSP layer broke a build of another MACHINE? It was discussed few times on ML, but when I'm reporting such issues in some BSP layers I sometimes need to persuade BSP maintainer why he should care about this. Sending him links to ML archives doesn't work well, having clear description in official documentation will add more weight to my arguments :).
Martin, I am not sure I have the technical understanding for this yet so I am going to take a stab at a paragraph and maybe you can comment/correct me. Right now I am going to target this new information at the end of the "Hardware Configuration Options" section of the BSP Manual (http://www.yoctoproject.org/docs/1.5/bsp-guide/bsp-guide.html#bsp-filelayout-machine). If that is not the best place let me know where you think it better fits. Here is my text.... Configuring the hardware properly in a BSP layer will not break builds for other machines when their layers are also included in the bblayers.conf file. You can ensure this by using MACHINE overrides for assignments and appends specific to a particular target machine. You need to also use MACHINE subdirectories for files pointed to by the SRC_URI variable. Okay Martin.. so this is terrible because I am missing the concepts of how you actually do this because I am not a developer. So, I have basically just re-worked your statements from your comments. I think what I need is some "education" here from you that will give me more understanding on how a user actually does this. I am not clear on "overrides" and "appends" as stated in your comments. Thanks for your help! Scott
I'll try to give you some examples of typical issues, maybe you'll be able to convert them to some nice explanation. you have BSP layer meta-abc which adds support for MACHINE "abc" you have .bbappend file for base-files recipe and you want to change some variables to improve support for MACHINE "abc" If you just set it like DEPENDS = "foo" then base-files for MACHINE "def" will now also depends on "foo" if you have meta-abc layer included when building for "def". You need to use DEPENDS_abc = "foo" which says that "foo" should be used only when meta-abc layer is included and MACHINE is "abc". Similar for _append/_prepend operations: instead of DEPENDS_append = " foo" which is applied to all possible MACHINEs, use: DEPENDS_append_abc = " foo" +=,=+ which are also applied for all MACHINEs should be rewritten to use _append and _<machine> override. When you have base recipe like base-files.bb which contains SRC_URI = "file://rotation" ... you can add base-files.bbappend which will use your own rotation file provided by meta-abc layer. recipes-core/base-files/base-files.bbappend: FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" and put "abc" specific rotation file in: "recipes-core/base-files/base-files/rotation" and it will be automatically used instead of default rotation file from oe-core, but again this file can be used for every MACHINE as long as meta-abc/recipes-core/base-files/base-files/ is first location where rotation file is found in FILESPATH variable. Because we don't want to use this rotation file for other MACHINEs put it in "meta-abc/recipes-core/base-files/base-files/abc/rotation" it will be found faster and without danger of unexpectedly using this "abc" specific file in build for "def" MACHINE. Reading this again I have to say, that I suck as documentation writer, hopefully you'll understand from it what are the issues and how "proper" BSPs are fixing them, we can chat about this a bit more on #yocto if you prefer it. Or ask anyone from local devs for more detailed explanation.
Hi, I have attempted a shot at this Martin. The topic got quite complicated for me so read it and see where I have gone wrong or where you think it could be improved upon. I located the information in the YP Development Manual. I had some "Best Practices" and "Recommendations" somewhat buried in a section on creating layers. So, I split that section up leaving the original to cover just the basic steps for creating layers. The existing "buried" recommendations and best practices I combined into a new section titled "Best Practices to Follow when Creating Layers." Here is the link to the new section. Let me know here in Bugzilla with your comments: http://www.yoctoproject.org/docs/1.5/dev-manual/dev-manual.html#best-practices-to-follow-when-creating-layers Thanks, Scott
I've couple of comments: - create a dependency on a file named foo that contains the altered variables: + create a dependency on "foo" by altering DEPENDS variable: - _append and _prepend overrides: _append and _prepend aren't overrides, but operations like (+=,=+). the same a bit later in "Note".
Hi, I feel pretty successful if those are the only issues Martin :) Thanks. I have made those changes. http://www.yoctoproject.org/docs/1.5/dev-manual/dev-manual.html#best-practices-to-follow-when-creating-layers Scott
No more review comments submitted. So marking RESOLVED.