Bug 15469 - oe-init-build-env uses unbound shell variables
Summary: oe-init-build-env uses unbound shell variables
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 5.1
Hardware: All Multiple
: Medium normal
Target Milestone: 6.2
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard: newcomer
Depends on:
Blocks:
 
Reported: 2024-04-11 11:35 UTC by Ross Burton
Modified: 2026-10-27 11:01 UTC (History)
3 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 Ross Burton 2024-04-11 11:35:55 UTC
oe-init-build-env uses potentially unbound variables (that is, it expands variables without knowing that they're set).

This is quite conventional for shell scripts, but people writing scripts carefully may use 'set -u' so that variables need to be assigned before use, and if those scripts call oe-init-build-env then bash will exit with errors.

$ set -u
$ . oe-init-build-env
-bash: BBSERVER: unbound variable
-bash: ZSH_NAME: unbound variable
-bash: OEROOT: unbound variable
-bash: OEROOT: unbound variable
-bash: OEROOT: unbound variable
-bash: BUILDDIR: unbound variable
$ echo $?
1