Bug 12197 - Don't have persistent build directories
Summary: Don't have persistent build directories
Status: RESOLVED FIXED
Alias: None
Product: AutoBuilder
Classification: Infrastructure
Component: autobuilder (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 4.99
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-10-06 12:13 UTC by Ross Burton
Modified: 2020-11-29 11:59 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.