Bug 12612 - insane.bbclass: check for bashisms in packaged scripts
Summary: insane.bbclass: check for bashisms in packaged scripts
Status: UNCONFIRMED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium enhancement
Target Milestone: 6.99
Assignee: Joshua Watt
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-03-19 10:23 UTC by Joshua Watt
Modified: 2026-08-13 15:13 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Watt 2018-03-19 10:23:44 UTC
Add a QA check to verify that scripts do not contain bashisms. The Debian checkbashisms.pl script already covers this sufficiently, as it can distinguish between 3 cases:
 1) A script with #! /bin/sh that uses bashisms (BAD)
 2) A script with #! /bin/bash that uses bashisms (OK)
 3) A script with #! /bin/bash that doesn't use bashisms (OK)

At a minimum, an ERROR should be produced if #1 is encountered. We could also issue a WARNING for #3, but that is not as much of an issue.
Comment 1 Ross Burton 2018-03-19 10:27:04 UTC
IMHO, far too invasive/slow to run on every parse.

oe-core has verify-bashisms which will run all shell bits in recipes through checkbashisms.
Comment 2 Joshua Watt 2018-03-19 11:34:54 UTC
Sorry, maybe it wasn't clear, this was intended to be a QA check for on-target installed files, not bitbake metadata scripts (which is what verify-bashisms appears to be checking?). I found 

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8851

did that also evaluate the performance impact of a QA check (I didn't find anything like that in the comments)? If not, I can do some evaluation to see what the impact would be on the do_package_qa step.
Comment 3 Ross Burton 2018-03-22 10:25:44 UTC
Ah, right.  Reopening.
Comment 4 Randy MacLeod 2023-10-24 14:24:50 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 5 Randy MacLeod 2026-08-13 15:13:46 UTC
We could put the code in but leave it disabled by default for developers to use as needed.