Bug 12197

Summary: Don't have persistent build directories
Product: [Infrastructure] AutoBuilder Reporter: Ross Burton <ross.burton>
Component: autobuilderAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: infras.ab.watcher, Infras.watcher, pidge, richard.purdie
Version: 2.2   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2017-10-06 12:13:23 UTC
There's a class of bugs which are subtle or hidden on the autobuilder because they related to build directory reuse through sstate.  Paths should be transformed away but that doesn't always happen.  The problem on the AB is that every tmpdir on the AB cluster exists on every build, so if a package does want to touch a file in the wrong tmpdir then it can.

So how about:
1) When the buildset starts, rm previous-build/ and set currentbuild=$(mktempd build-XXXXXX)
2) oe-init-build-env $currentbuild etc
3) When buildset finished, mv $currentbuild previous-build

This ensures that the paths are no longer valid for reuse in other builds via sstate, but the actual build directory exists for future debugging if required.
Comment 1 Joshua Lock 2018-03-22 08:46:03 UTC
This change will need to be made in the helper scripts now.
Comment 2 Richard Purdie 2020-11-29 11:59:18 UTC
We actually fixed this ages ago!

If builds succeed, the build directory is now destroyed.

If builds fail, the build directory is renamed "build-renamed" but preserved.

At the end of a build the directory therefore no longer exists in its default name but is preserved until the next build in case of failure. I think this addresses this issue.