All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 02/21] sanity.bbclass: sanity check for if bitbake is present in PATH
Date: Mon,  1 Feb 2021 06:24:33 -1000	[thread overview]
Message-ID: <9ed5d67d5d50f97072b6054ce913a3f5d981335e.1612188857.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1612188857.git.steve@sakoman.com>

From: Dorinda <dorindabassey@gmail.com>

If a user executes the environment script instead of sourcing it,
there's an error about an empty element in PATH. This is because
bitbake isn't present in environment variable PATH. Hence, this
patch adds a sanity check to verify if bitbake is present in
PATH and if bitbake isn't present issue a warning message.

[YOCTO #13822]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e08799913a7f207bc63e085eb98196fd61ed57bc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/sanity.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 4dc21bf0a9..b678284554 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -794,6 +794,11 @@ def check_sanity_everybuild(status, d):
     if "." in paths or "./" in paths or "" in paths:
         status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
 
+    #Check if bitbake is present in PATH environment variable
+    bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake')
+    if not bb_check:
+        bb.warn("bitbake binary is not found in PATH, did you source the script?")
+
     # Check whether 'inherit' directive is found (used for a class to inherit)
     # in conf file it's supposed to be uppercase INHERIT
     inherit = d.getVar('inherit')
-- 
2.25.1


  parent reply	other threads:[~2021-02-01 16:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 16:24 [OE-core][dunfell 00/21] Patch review Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 01/21] sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHS Steve Sakoman
2021-02-01 16:24 ` Steve Sakoman [this message]
2021-02-01 16:24 ` [OE-core][dunfell 03/21] oeqa/ptest: print a warning if ptests failed Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 04/21] flex: fix build with autoconf 2.70 Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 05/21] flex: Refresh patch Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 06/21] flex: Fix --noline option behavior Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 07/21] toolchain-shar-relocate.sh: Fix handling files with colons Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 08/21] devtool: Fix source extraction for gcc shared source Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 09/21] externalsrc: Fix parsing error with devtool non-git sources Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 10/21] oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_event Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 11/21] devtool: Fix file:// fetcher symlink directory structure Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 12/21] dtc: improve reproducibility Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 13/21] core-image-sato-sdk-ptest: these images need ptest Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 14/21] ovmf-shell-image: image is only buildable on x86-64 Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 15/21] selftest/devtool: Add modify_localfiles_only test checking symlink path Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 16/21] timezone: upgrade to 2021a Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 17/21] strace: increase ptest timeout duration 120->240s Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 18/21] externalsrc: Detect code changes in submodules Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 19/21] ncurses: Don't put terminfo into the sysroot Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 20/21] python3: Avoid installing test data into recipe-sysroot Steve Sakoman
2021-02-01 16:24 ` [OE-core][dunfell 21/21] staging: Clean up files installed into the sysroot Steve Sakoman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ed5d67d5d50f97072b6054ce913a3f5d981335e.1612188857.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.