Skip to contentSkip to conversation

Fixes for bb-matrix

PATCH In review Peter Kjellerstedt 4 participants 13 messages Sep 6, 2013 – Sep 11, 2013

lore
Share & tools
lore
#0 lore raw

cover Fixes for bb-matrix

This fixes a couple of problems with bb-matrix that I found the other day when trying to use the script. They would have saved me a day or two of test builds that were not building what I thought they were due to incorrect configurations...

//Peter

The following changes since commit ed3ef0823fde89371a473d20c0127c0bd16d062b:

qemumips: fix keyboard entry in graphical boots (2013-09-05 16:27:54 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib pkj/bb-matrix_improvements
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/bb-matrix_improvements

Peter Kjellerstedt (2):
bb-matrix: Clean before, rather than after, building
bb-matrix: Make sure local.conf does not interfere

 scripts/contrib/bb-perf/bb-matrix.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 1/2 bb-matrix: Clean before, rather than after, building

This makes sure the the first build starts from a clean state. Otherwise one could have the first build affected by any leftover state from a previous build.

This also leaves a working state behind after the final build.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
scripts/contrib/bb-perf/bb-matrix.sh +5 -7
index 37721fe..1064565 100755
@@ -63,6 +63,10 @@ for BB in $BB_RANGE; do
 		date
 		echo "BB=$BB PM=$PM Logging to $BB_LOG"
 
+		echo -n "  Preparing the work directory... "
+		rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null
+		echo "done"
+
 		# Export the variables under test and run the bitbake command
 		# Strip any leading zeroes before passing to bitbake
 		export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//')
@@ -70,12 +74,6 @@ for BB in $BB_RANGE; do
 		/usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG
 
 		echo "  $(tail -n1 $RUNTIME_LOG)"
-		echo -n "  Cleaning up..."
-		mv tmp/buildstats $RUNDIR/$BB-$PM-buildstats
-		rm -f pseudodone &> /dev/null
-		rm -rf tmp &> /dev/null
-		rm -rf sstate-cache &> /dev/null
-		rm -rf tmp-eglibc &> /dev/null
-		echo "done"
+		cp -a tmp/buildstats $RUNDIR/$BB-$PM-buildstats
 	done
 done
Signature · 1 line
1.8.2.1
#6 lore raw

PATCH 2/2 bb-matrix: Make sure local.conf does not interfere

In reply to Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR happened to be set in local.conf then the bb-matrix script would not perform as intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
index 1064565..d5127e7 100755
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and SSTATE_DIR are set
+# in local.conf
+sed -ri 's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:]]*\??=.*)/#\1/' conf/local.conf
+
 # Add a simple header
 echo "BB PM $TIME_STR" > $RUNTIME_LOG
 for BB in $BB_RANGE; do
Signature · 1 line
1.8.2.1
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] bb-matrix: Clean before, rather than after, building

In reply to Peter Kjellerstedt
Quoted 7 lines · Peter Kjellerstedt

This makes sure the the first build starts from a clean state. Otherwise one could have the first build affected by any leftover state from a previous build.

This also leaves a working state behind after the final build.

Hi Peter,

Thanks for taking the time to send in a fix!

Quoted 9 lines
---
 scripts/contrib/bb-perf/bb-matrix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 37721fe..1064565 100755

scripts/contrib/bb-perf/bb-matrix.sh for BB in $BB_RANGE; do · line 69

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -63,6 +63,10 @@ for BB in $BB_RANGE; do
 		date
 		echo "BB=$BB PM=$PM Logging to $BB_LOG"
 
+		echo -n "  Preparing the work directory... "
+		rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null
+		echo "done"
+

Makes sense to me, although there is one point worth discussing. The tmp-eglibc directory could change depending on the DISTRO setting iiuc. All of tmp, sstate-cache, and tmp-eglibc could be dealt with using cleansstate I believe:

bitbake <target> -c cleansstate

Richard, should we consider using this instead?

Either way, the above is an improvement, so:

Finally, In the future Peter, please have a look at the git log for the file(s) you are patching and if there is an obvious author/maintainer from the log, please include them on Cc. This will help ensure your patch gets reviewed and merged in a timely fashion.

Thanks again for the patch!

Quoted 17 lines
scripts/contrib/bb-perf/bb-matrix.sh +1 -7
 		# Export the variables under test and run the bitbake command
 		# Strip any leading zeroes before passing to bitbake
 		export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//')
@@ -70,12 +74,6 @@ for BB in $BB_RANGE; do
 		/usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG
 
 		echo "  $(tail -n1 $RUNTIME_LOG)"
-		echo -n "  Cleaning up..."
-		mv tmp/buildstats $RUNDIR/$BB-$PM-buildstats
-		rm -f pseudodone &> /dev/null
-		rm -rf tmp &> /dev/null
-		rm -rf sstate-cache &> /dev/null
-		rm -rf tmp-eglibc &> /dev/null
-		echo "done"
+		cp -a tmp/buildstats $RUNDIR/$BB-$PM-buildstats
 	done
 done
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#7 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

In reply to Peter Kjellerstedt
Quoted 14 lines · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR happened to be set in local.conf then the bb-matrix script would not perform as intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and SSTATE_DIR are set
+# in local.conf
+sed -ri 's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:]]*\??=.*)/#\1/' conf/local.conf
+

Unless I'm mistaken, you are modifying the users local.conf?

We definitely should *not* be doing that. I would support documenting this as a requirement and even printing a warning if any of a set of variables are found in the bitbake environment.

Note that local.conf is not the only place where these could be set.

Richard, shouldn't the env setting override anything in local.conf?

Thanks,

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#3 lore raw

Re: [PATCH 1/2] bb-matrix: Clean before, rather than after, building

In reply to Darren Hart
Quoted 35 lines · Darren Hart
Quoted 7 lines · Peter Kjellerstedt

This makes sure the the first build starts from a clean state. Otherwise one could have the first build affected by any leftover state from a previous build.

This also leaves a working state behind after the final build.

Hi Peter,

Thanks for taking the time to send in a fix!

Quoted 9 lines
---
 scripts/contrib/bb-perf/bb-matrix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 37721fe..1064565 100755

scripts/contrib/bb-perf/bb-matrix.sh for BB in $BB_RANGE; do · line 69

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -63,6 +63,10 @@ for BB in $BB_RANGE; do
 		date
 		echo "BB=$BB PM=$PM Logging to $BB_LOG"
 
+		echo -n "  Preparing the work directory... "
+		rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null
+		echo "done"
+

Makes sense to me, although there is one point worth discussing. The tmp-eglibc directory could change depending on the DISTRO setting iiuc. All of tmp, sstate-cache, and tmp-eglibc could be dealt with using cleansstate I believe:

Quoted 3 lines

bitbake <target> -c cleansstate

Richard, should we consider using this instead?

Sadly this isn't recursive, it applies to <target> and not any dependencies of it. I'd be tempted to simplify this to rm tmp* and depend on a convention of calling them tmp*...

Cheers,

Richard

#8 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

In reply to Darren Hart
Quoted 25 lines · Darren Hart
Quoted 14 lines · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR happened to be set in local.conf then the bb-matrix script would not perform as intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and SSTATE_DIR are set
+# in local.conf
+sed -ri 's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:]]*\??=.*)/#\1/' conf/local.conf
+

Unless I'm mistaken, you are modifying the users local.conf?

Quoted 7 lines

We definitely should *not* be doing that. I would support documenting this as a requirement and even printing a warning if any of a set of variables are found in the bitbake environment.

Note that local.conf is not the only place where these could be set.

Richard, shouldn't the env setting override anything in local.conf?

No, it will override a ?= or ??= but not a =.

Cheers,

Richard

#4 lore raw

Re: [PATCH 1/2] bb-matrix: Clean before, rather than after, building

In reply to Richard Purdie
Quoted 36 lines · Richard Purdie
Quoted 35 lines · Darren Hart
Quoted 7 lines · Peter Kjellerstedt

This makes sure the the first build starts from a clean state. Otherwise one could have the first build affected by any leftover state from a previous build.

This also leaves a working state behind after the final build.

Hi Peter,

Thanks for taking the time to send in a fix!

Quoted 9 lines
---
 scripts/contrib/bb-perf/bb-matrix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 37721fe..1064565 100755

scripts/contrib/bb-perf/bb-matrix.sh for BB in $BB_RANGE; do · line 69

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -63,6 +63,10 @@ for BB in $BB_RANGE; do
 		date
 		echo "BB=$BB PM=$PM Logging to $BB_LOG"
 
+		echo -n "  Preparing the work directory... "
+		rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null
+		echo "done"
+

Makes sense to me, although there is one point worth discussing. The tmp-eglibc directory could change depending on the DISTRO setting iiuc. All of tmp, sstate-cache, and tmp-eglibc could be dealt with using cleansstate I believe:

Quoted 8 lines
Quoted 3 lines

bitbake <target> -c cleansstate

Richard, should we consider using this instead?

Sadly this isn't recursive, it applies to <target> and not any dependencies of it. I'd be tempted to simplify this to rm tmp* and depend on a convention of calling them tmp*...

yes.... but.... any kind of a wildcard in an rm -rf statement makes me see purple....

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#5 lore raw

Re: [PATCH 1/2] bb-matrix: Clean before, rather than after, building

In reply to Richard Purdie
Quoted 3 lines · Richard Purdie

Sadly this isn't recursive, it applies to <target> and not any dependencies of it. I'd be tempted to simplify this to rm tmp* and depend on a convention of calling them tmp*...

You could invoke bitbake -e and get the right directories to remove (see wipe-sysroot).

Ross

#9 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

In reply to Richard Purdie
Quoted 30 lines · Richard Purdie
Quoted 29 lines · Darren Hart
Quoted 14 lines · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR happened to be set in local.conf then the bb-matrix script would not perform as intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and SSTATE_DIR are set
+# in local.conf
+sed -ri 's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:]]*\??=.*)/#\1/' conf/local.conf
+

Unless I'm mistaken, you are modifying the users local.conf?

We definitely should *not* be doing that. I would support documenting this as a requirement and even printing a warning if any of a set of variables are found in the bitbake environment.

Quoted 5 lines
Quoted 3 lines

Note that local.conf is not the only place where these could be set.

Richard, shouldn't the env setting override anything in local.conf?

No, it will override a ?= or ??= but not a =.

OK, well, a warning if found in local.conf (or site.conf?) is probably the best we can do for now. We can't check bitbake -e since that will report the default which we wouldn't be able to distinguish from an explicit setting.... unless we checked for an explicit assignment? Might be doable.... but a warning should be sufficient for a script in contrib, yes?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#10 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

Quoted 35 lines · Darren Hart
Quoted 34 lines · Richard Purdie
Quoted 32 lines · Darren Hart
Quoted 14 lines · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR happened to be set in local.conf then the bb-matrix script would not perform as intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
scripts/contrib/bb-perf/bb-matrix.sh +0 -0
index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 7 lines
scripts/contrib/bb-perf/bb-matrix.sh +4 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and SSTATE_DIR are set
+# in local.conf
+sed -ri 's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:]]*\??=.*)/#\1/' conf/local.conf
+

Unless I'm mistaken, you are modifying the users local.conf?

We definitely should *not* be doing that. I would support documenting this as a requirement and even printing a warning if any of a set of variables are found in the bitbake environment.

Note that local.conf is not the only place where these could be set.

Richard, shouldn't the env setting override anything in local.conf?

Quoted 8 lines
Quoted 1 line

No, it will override a ?= or ??= but not a =.

OK, well, a warning if found in local.conf (or site.conf?) is probably the best we can do for now. We can't check bitbake -e since that will report the default which we wouldn't be able to distinguish from an explicit setting.... unless we checked for an explicit assignment? Might be doable.... but a warning should be sufficient for a script in contrib, yes?

Yes, although I think in the comments, bitbake -e will tell you which kind of operation was used :)

Cheers,

Richard

#11 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

Quoted 65 lines

-----Original Message-----
From: Richard Purdie [mailto:[email protected]]
Sent: den 10 september 2013 17:48
To: Darren Hart
Cc: Peter Kjellerstedt; [email protected]
Subject: Re: [OE-core] [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

Quoted 4 lines · Darren Hart
Quoted 3 lines · Richard Purdie
Quoted 2 lines · Darren Hart
Quoted 1 line · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR

happened to be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

set in local.conf then the bb-matrix script would not perform

as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines

intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/scripts/contrib/bb-perf/bb-matrix.sh

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 56

Quoted 8 lines

index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh +1 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and

SSTATE_DIR are set

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 58

Quoted 2 lines
scripts/contrib/bb-perf/bb-matrix.sh +2 -0
+# in local.conf
+sed -ri

's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:] ]*\??=.*)/#\1/' conf/local.conf

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 1 line
scripts/contrib/bb-perf/bb-matrix.sh +1 -0
+

Unless I'm mistaken, you are modifying the users local.conf?

We definitely should *not* be doing that. I would support

documenting

Quoted 1 line
Quoted 1 line
Quoted 1 line

this as a requirement and even printing a warning if any of a set

of

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

variables are found in the bitbake environment.

Note that local.conf is not the only place where these could be

set.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Richard, shouldn't the env setting override anything in

local.conf?

Quoted 4 lines
Quoted 2 lines

No, it will override a ?= or ??= but not a =.

OK, well, a warning if found in local.conf (or site.conf?) is

probably

Quoted 3 lines

the best we can do for now. We can't check bitbake -e since that will report the default which we wouldn't be able to distinguish from an explicit setting.... unless we checked for an explicit assignment?

Might

Quoted 2 lines

be doable.... but a warning should be sufficient for a script in contrib, yes?

Quoted 6 lines

Yes, although I think in the comments, bitbake -e will tell you which kind of operation was used :)

Cheers,

Richard

My suggestion is to test that the values can be set by the script before starting the test run. Something like 'BB_NUMBER_THREADS=1234 PARALLEL_MAKE="-j 1234" bitbake -e core-image-minimal' and then grep for the expected values. If the correct values are not found then just abort with an error message as the script will not be able to do what it is supposed to do.

I would also suggest aborting if SSTATE_DIR does not match "$(pwd)/sstate-cache" since the script would clear a directory other than the one that is actually used.

Finally, if SSTATE_MIRRORS is non-empty I would generate a warning. I would not abort in this case as it can be a useful setup (e.g., I used this to build with a sstate cache mirror that contained the native packages as this halved the build time and I thus could test more combinations over a weekend).

I'll update my patch as per above unless you have other suggestions.

//Peter

#12 lore raw

Re: [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

Quoted 83 lines · Peter Kjellerstedt
Quoted 65 lines

-----Original Message-----
From: Richard Purdie [mailto:[email protected]]
Sent: den 10 september 2013 17:48
To: Darren Hart
Cc: Peter Kjellerstedt; [email protected]
Subject: Re: [OE-core] [PATCH 2/2] bb-matrix: Make sure local.conf does not interfere

Quoted 4 lines · Darren Hart
Quoted 3 lines · Richard Purdie
Quoted 2 lines · Darren Hart
Quoted 1 line · Peter Kjellerstedt

If any of BB_NUMBER_THREADS, PARALLEL_MAKE or SSTATE_DIR

happened to be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

set in local.conf then the bb-matrix script would not perform

as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines

intended.

---
 scripts/contrib/bb-perf/bb-matrix.sh | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/scripts/contrib/bb-perf/bb-matrix.sh

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 56

Quoted 8 lines

index 1064565..d5127e7 100755

scripts/contrib/bb-perf/bb-matrix.sh +1 -0
@@ -53,6 +53,10 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
+# Make sure neither of BB_NUMBER_THREADS, PARALLEL_MAKE and

SSTATE_DIR are set

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 58

Quoted 2 lines
scripts/contrib/bb-perf/bb-matrix.sh +2 -0
+# in local.conf
+sed -ri

's/^([[:space:]]*(BB_NUMBER_THREADS|PARALLEL_MAKE|SSTATE_DIR)[[:space:] ]*\??=.*)/#\1/' conf/local.conf

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

scripts/contrib/bb-perf/bb-matrix.sh if [ $? -ne 0 ]; then · line 59

Quoted 1 line
scripts/contrib/bb-perf/bb-matrix.sh +1 -0
+

Unless I'm mistaken, you are modifying the users local.conf?

We definitely should *not* be doing that. I would support

documenting

Quoted 1 line
Quoted 1 line
Quoted 1 line

this as a requirement and even printing a warning if any of a set

of

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

variables are found in the bitbake environment.

Note that local.conf is not the only place where these could be

set.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Richard, shouldn't the env setting override anything in

local.conf?

Quoted 4 lines
Quoted 2 lines

No, it will override a ?= or ??= but not a =.

OK, well, a warning if found in local.conf (or site.conf?) is

probably

Quoted 3 lines

the best we can do for now. We can't check bitbake -e since that will report the default which we wouldn't be able to distinguish from an explicit setting.... unless we checked for an explicit assignment?

Might

Quoted 2 lines

be doable.... but a warning should be sufficient for a script in contrib, yes?

Quoted 6 lines

Yes, although I think in the comments, bitbake -e will tell you which kind of operation was used :)

Cheers,

Richard

My suggestion is to test that the values can be set by the script before starting the test run. Something like 'BB_NUMBER_THREADS=1234 PARALLEL_MAKE="-j 1234" bitbake -e core-image-minimal' and then grep for the expected values. If the correct values are not found then just abort with an error message as the script will not be able to do what it is supposed to do.

I would also suggest aborting if SSTATE_DIR does not match "$(pwd)/sstate-cache" since the script would clear a directory other than the one that is actually used.

Quoted 8 lines

Finally, if SSTATE_MIRRORS is non-empty I would generate a warning. I would not abort in this case as it can be a useful setup (e.g., I used this to build with a sstate cache mirror that contained the native packages as this halved the build time and I thus could test more combinations over a weekend).

I'll update my patch as per above unless you have other suggestions.

All sound like good approaches to me. I especially like checking the actual runtime value rather than scanning conf files.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel