| Summary: | The manual never mentions what environment tasks run in | ||
|---|---|---|---|
| Product: | [Documentation] BitBake User Manual | Reporter: | ulfalizer |
| Component: | bitbake-manual | Assignee: | Scott Rifenbark <srifenbark> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | joshuagloe, richard.purdie, ross.burton, srifenbark |
| Version: | 2.0 | ||
| Target Milestone: | 2.1 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | 15 Feb 2016: RESOLVED | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Done (doc changes complete) | |
Moving this to 2.1. Also placing in NEEDINFO as I need some explanation on this one from developers. Scott Assigned to Richard to comment. Drive-by comment: export in a .bb is exactly what you expect from sh: it exports a variable into the environment. By default BitBake clears the environment of non-whitelisted variables unless the BB_PRESERVE_ENV[1] variable is set. The BitBake User Manual alludes to the environment cleaning in "2.1. Parsing the Base Configuration Metadata"[2] and the reference for the relevant variables; BB_ENV_WHITELIST[3], BB_ENV_EXTRAWHITE[4], BB_PRESERVE_ENV[1] and BB_ORIGENV[6]. Section "3.5.3. Passing Information Into the Build Task Environment"[5] talks about the task execution environment and how to pass extra data in to it. It's probable that we could be clearer and explicitly state that by default the environment is cleaned of variables which aren't in the whitelist before it is loaded into the datastore and that the whitelist of variables is composed of the BB_ENV_WHITELIST internal variable and the BB_ENV_EXTRAWHITE variable. It's worth noting, though perhaps not in the BitBake manual (I don't know whether the BB manual refers to OE at all?), that OpenEmbedded's oe-init-env script sets BB_ENV_EXTRAWHITE to include several variables[7]. 1. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#var-BB_PRESERVE_ENV 2. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#parsing-the-base-configuration-metadata 3. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#var-BB_ENV_WHITELIST 4. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#var-BB_ENV_EXTRAWHITE 5. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#passing-information-into-the-build-task-environment 6. https://www.yoctoproject.org/docs/2.0/bitbake-user-manual/bitbake-user-manual.html#var-BB_ORIGENV 7. http://git.openembedded.org/openembedded-core/tree/scripts/oe-buildenv-internal#n106 I'd also just add that this is specfically referring to shell task execution environment. Reassign to Scott, Joshua should be able to help with any needed info or further review. Hi, I have made some changes to two sections to try and make this issue of environment variables more clear. The information was in there but this attempt should make it easier on the user. Please look at the following two sections and let me know if this helps: * http://www.yoctoproject.org/docs/temp/bitbake-user-manual/bitbake-user-manual.html#parsing-the-base-configuration-metadata * http://www.yoctoproject.org/docs/temp/bitbake-user-manual/bitbake-user-manual.html#passing-information-into-the-build-task-environment Thanks, Scott Looks a bit clearer and more explicit now. Thanks! Thanks for the review. I am setting to RESOLVED and putting the doc flag to "done." Scott |
...as far as I can see ("environment" as in "environment variables"). Is this some static cleaned-up environment? What does it contain? Is there some way for users to put variables into it, or are tasks supposed to do any environment manipulation required themselves? If I'm understanding things right, BitBake's "export" statement has nothing to do with exporting variables to the environment, like "export" would do in sh. This is potentially confusing and could be mentioned too.