diff options
| author | Chris Laplante <chris.laplante@agilent.com> | 2024-12-06 11:24:40 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-06 23:33:54 +0000 |
| commit | c7b362f5ec380bea7dcce9790f739d3b507b4341 (patch) | |
| tree | ee8894900a0fb69a57f316e73c5958731227f399 /bitbake/lib/bb | |
| parent | 1859213e67a0deb12403886aca75270ea6069d81 (diff) | |
| download | poky-c7b362f5ec380bea7dcce9790f739d3b507b4341.tar.gz | |
bitbake: knotty: print an error if MACHINE is not set
When the user forgets to set MACHINE, bitbake just exits without
printing anything.
This is because BB_CONSOLELOG ends up with an unexpanded '${MACHINE}', which
bb.utils.mkdirhier tries to report using bb.fatal. But bb.fatal utilizes the
very logging infrastructure that this code was trying to setup.
(Bitbake rev: 7d3f3655b2f610f76898c84b8b97ef2e26529c41)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 3784c93ad8..881df9e5fb 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -555,8 +555,18 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 555 | } | 555 | } |
| 556 | }) | 556 | }) |
| 557 | 557 | ||
| 558 | bb.utils.mkdirhier(os.path.dirname(consolelogfile)) | 558 | consolelogdirname = os.path.dirname(consolelogfile) |
| 559 | loglink = os.path.join(os.path.dirname(consolelogfile), 'console-latest.log') | 559 | # `bb.utils.mkdirhier` has this check, but it reports failure using bb.fatal, which logs |
| 560 | # to the very logger we are trying to set up. | ||
| 561 | if '${' in str(consolelogdirname): | ||
| 562 | print( | ||
| 563 | "FATAL: Directory name {} contains unexpanded bitbake variable. This may cause build failures and WORKDIR pollution.".format( | ||
| 564 | consolelogdirname)) | ||
| 565 | if '${MACHINE}' in consolelogdirname: | ||
| 566 | print("HINT: It looks like you forgot to set MACHINE in local.conf.") | ||
| 567 | |||
| 568 | bb.utils.mkdirhier(consolelogdirname) | ||
| 569 | loglink = os.path.join(consolelogdirname, 'console-latest.log') | ||
| 560 | bb.utils.remove(loglink) | 570 | bb.utils.remove(loglink) |
| 561 | try: | 571 | try: |
| 562 | os.symlink(os.path.basename(consolelogfile), loglink) | 572 | os.symlink(os.path.basename(consolelogfile), loglink) |
