Bug 13822 - Easy to have misleading warnings if env script is executed instead of sourced
Summary: Easy to have misleading warnings if env script is executed instead of sourced
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.3 M2
Assignee: New Comer Bugs
QA Contact:
URL:
Whiteboard: NEWCOMMER
Depends on:
Blocks:
 
Reported: 2020-03-02 23:10 UTC by Richard Purdie
Modified: 2021-01-29 15:41 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2020-03-02 23:10:35 UTC
If I user executes the environment script instead of sourcing it, they see errors about a "" element in PATH. This is because bitbake isn't present in PATH which breaks the PATH change in layer.conf.

We should add a sanity check for bitbake being present in PATH and error if not about the environment not being correct (did they source the script?).
Comment 1 Dorinda 2020-10-21 00:19:00 UTC
hi,
I want to work on this bug, but i need a little bit of clarity from your description, this means i should add a sanity check in the environment script for if bitbake is present in the path, and if they sourced the script?
Comment 2 Richard Purdie 2020-11-19 16:11:34 UTC
The intent here was to check PATH in sanity.bbclass alongside other checks.
Comment 3 Richard Purdie 2020-12-31 14:44:37 UTC
To give more of a hint, where we check this in sanity.bbclass:

http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/classes/sanity.bbclass#n786

we could also add a call along the lines of "bb.utils.which(d.getVar('PATH'), 'bitbake')" which would determine if bitbake can be found in PATH. If not, we should error with a more specific error to the user.
Comment 5 Randy MacLeod 2021-01-29 15:11:21 UTC
Can you confirm that it's in oe-core/master and provide a link? Thanks.
Comment 7 Randy MacLeod 2021-01-29 15:41:44 UTC
Thanks for the link Dorinda!