Bug 3975 - When B != S, set S as read-only
Summary: When B != S, set S as read-only
Status: RESOLVED WONTFIX
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Low enhancement
Target Milestone: Future
Assignee: Saul Wold
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-03-04 12:07 UTC by Ross Burton
Modified: 2014-01-21 10:45 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2013-03-04 12:07:03 UTC
If we're doing a build where $B != $S, then after patching set $S to read-only.  The fun will be restoring read/write on errors so the directories can be erased.
Comment 1 Matthieu Crapet 2014-01-21 10:40:12 UTC
This is quite tricky.
Adding:

<code>
check_separate_build() {
	if [ "${S}" != "${B}" ]; then
		bbnote 'Separate build: chmod a-w ${S}'
		chmod a-w ${S}
	fi
}

do_configure[prefuncs] = "check_separate_build"
</cpde>

to base.bbclass is easy, but how to revertit ? do_clean will fail because of Permissions. How to detect that do_configure failed?
Comment 2 Ross Burton 2014-01-21 10:45:01 UTC
To be honest I'm not sure if this is even possible, making the assumption that *nothing* in the build will touch $S is tough.  As the creater of this bug let's say I was over-enthusiastic and close it.