Skip to content

Avoid shell use

Anders Heimer yocto-patches 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3steps: avoid shell when writing repo metadatasteps/writebbsetupjson.py steps/writelayerinfo.py+14 -240 replies
2/3builders: pass getproperties command as argv listbuilders.py+10 -20 replies
3/3builders: avoid shell pipeline for disk space checkbuilders.py+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [yocto-autobuilder2][PATCH 0/3] Avoid shell use

This series removes shell use from a few backend paths where Buildbot already has structured command arguments or generated file contents.

The changes are intended as hardening/cleanup with no intentional behaviour change.

Testing:
* Metadata writers:
- qemuarm-oecore build wrote layerinfo.json and bbsetup-overrides.json via StringDownload
- both files parsed correctly and preserved repo, branch and revision values literally
- whitebox comparison showed byte-for-byte identical output for qemuarm-oecore, a-quick, docs and default-repo fallback cases.

* getproperties.py argv change:
- live qemuarm-oecore build reached and passed "Load build revisions"
- the step set 15 properties
- Buildbot log showed direct argv execution:
argv: [b'.../getproperties.py', b'.../build', b'qemuarm-oecore']
- direct replay on a preserved qemuarm-oecore build tree matched the old shell-string output exactly.

* Disk-space check:
- live builds passed the canStartBuild disk gate and started normally
- local comparison showed the old findmnt --df fifth field matched the new findmnt -o AVAIL output for ., /tmp and the worker tree

Anders Heimer (3):
steps: avoid shell when writing repo metadata
builders: pass getproperties command as argv list
builders: avoid shell pipeline for disk space check

 builders.py               | 16 +++++++++++++---
 steps/writebbsetupjson.py | 19 +++++++------------
 steps/writelayerinfo.py   | 19 +++++++------------
 3 files changed, 27 insertions(+), 27 deletions(-)