Bug 8585 - Improve detection of missing host dependencies
Summary: Improve detection of missing host dependencies
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.0
Hardware: All Multiple
: Medium+ enhancement
Target Milestone: 2.1 M4
Assignee: Bill Randle
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-10-27 11:13 UTC by Paul Eggleton
Modified: 2016-04-01 17:16 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Proposed fix using NATIVELSBSTRING (2.30 KB, patch)
2016-03-22 00:47 UTC, Bill Randle
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2015-10-27 11:13:03 UTC
We have several checks in sanity.bbclass to verify that certain tools are installed on the host. A while back we decided to make these checks run only once and then we stamp that they are done and effectively never run them again unless TMPDIR gets deleted or we bump SANITY_VERSION.

As far as I can tell we have never bumped SANITY_VERSION, despite having adjusted the dependencies and checks numerous times. Additionally, users have occasionally removed packages or upgraded their distributions and then find slightly obscure errors that are traced to these tools being missing; had the checks been run the issue would have been spotted immediately.

I'd like to re-evaluate how long these checks actually take and if it's still too expensive to run them every time, it would be nice if we could at least somehow detect when a distro upgrade has taken place and trigger re-running all of the sanity checks if it has.

Additionally, we might consider using some sort of signature in conf/sanity_info so that if e.g. SANITY_REQUIRED_UTILITIES changed then the corresponding check would be re-run automatically rather than us having to remember to bump SANITY_VERSION.
Comment 1 Ross Burton 2015-10-27 11:18:00 UTC
Surely checking $PATH for ten binaries can't take that long, even in the context of just the metadata parse, and memory-resident bitbake will only need to perform the check at startup anyway.

Marking medium+ 2.1M2.
Comment 2 Ross Burton 2016-01-26 13:26:06 UTC
check_sanity_version_changed() takes my machine 2.8 seconds, 2.7 seconds of which is the "am I online" test as that hits both the main Yocto download site and bugzilla.

Removing bugzilla from CONNECTIVITY_URLS so it just pings the main yocto download site reduces the time taken to 1 second.  Changing the URL to just google.com reduces the time for the connectivity test to 0.2s.
Comment 3 Ross Burton 2016-01-26 14:18:21 UTC
Some real numbers:

NOTE: connectivity took 0.156 seconds
NOTE: sanity took 0.316 seconds

The connectivity ping to google.com took 0.156 seconds, and check_sanity_version_changed() (including the ping) took 0.316 seconds.
Comment 4 Ross Burton 2016-01-26 17:26:11 UTC
Adding Richard to the CC as he has strong opinions that bitbake startup shouldn't be slower.  Fight!
Comment 5 Ross Burton 2016-02-02 14:45:13 UTC
Connectivity check change was merged in meta-yocto b253c6073be44090a19d1743deb58ef566853056.
Comment 6 Richard Purdie 2016-02-02 15:44:40 UTC
I believe we already have far too much junk/busy work going on with bitbake startup already. Memory resident bitbake might change that but we're not there yet.

Even then, I don't think we want to check all these things every time, just in case. We should however get more diligent about bumping SANITY_VERSION, or use the checksums mechanism we now have to test when to rerun the sanity tests. We could save NATIVELSBSTRING to detect distro upgrades?
Comment 7 Paul Eggleton 2016-02-02 19:43:49 UTC
Yes - I think we should definitely use NATIVELSBSTRING to force the checks to re-execute, and we should be bumping SANITY_VERSION pretty much every time we change the checks.
Comment 8 Bill Randle 2016-03-22 00:47:33 UTC
Created attachment 3054 [details]
Proposed fix using NATIVELSBSTRING

Here's a proposed fix for your consideration. It uses a change in NATIVELSBSTRING to flag a recheck. The true value of NATIVELSBSTRING is saved in the sanity_info file.
Comment 9 Bill Randle 2016-03-22 17:27:06 UTC
Patch submitted to OE mailing list.