Bug 15469

Summary: oe-init-build-env uses unbound shell variables
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Ross Burton <ross.burton>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 5.1   
Target Milestone: 6.2   
Hardware: All   
OS: Multiple   
Whiteboard: newcomer
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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