Skip to contentSkip to conversation

utils/test-pkg: clean output dir for successful builds

PATCH New Thomas De Schampheleire 3 participants 5 messages Feb 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/test-pkg: clean output dir for successful builds

From: Thomas De Schampheleire <[email protected]>

test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure.

Do a 'make clean' for successful builds to save disk space. Note that the logfile and configuration is still retained for inspection.

---
 utils/test-pkg | 4 ++++
 1 file changed, 4 insertions(+)
utils/test-pkg +4 -0
index 1995fa8578..1e40ad7b75 100755
@@ -161,6 +161,10 @@ build_one() {
     if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
         return 3
     fi
+
+    # if we get here, the build was successful.
+    # Clean up the build/host directories to save disk space
+    make O="${dir}" clean >> "${dir}/logfile" 2>&1
 }
 
 help() {
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 utils/test-pkg: clean output dir for successful builds

Quoted 5 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure.

Well, except in the situation where you're iteratively fixing the package and
re-testing with the -p option, no? Then your subsequent attempt would be happy to reuse the build results of all dependencies...

So, I think it's better to make this optional - perhaps with a -k,--keep option
similar to run-tests.

Regards,
Arnout

Quoted 25 lines

Do a 'make clean' for successful builds to save disk space. Note that the logfile and configuration is still retained for inspection.

---
 utils/test-pkg | 4 ++++
 1 file changed, 4 insertions(+)
utils/test-pkg +4 -0
index 1995fa8578..1e40ad7b75 100755
@@ -161,6 +161,10 @@ build_one() {
     if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
         return 3
     fi
+
+    # if we get here, the build was successful.
+    # Clean up the build/host directories to save disk space
+    make O="${dir}" clean >> "${dir}/logfile" 2>&1
 }
 
 help() {
#2 lore raw

PATCH 1/1 utils/test-pkg: clean output dir for successful builds

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 5 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure.

Quoted 6 lines

Well, except in the situation where you're iteratively fixing the package and
re-testing with the -p option, no? Then your subsequent attempt would be happy to reuse the build results of all dependencies...

So, I think it's better to make this optional - perhaps with a -k,--keep option
similar to run-tests.

Agreed!

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 utils/test-pkg: clean output dir for successful builds

In reply to Arnout Vandecappelle
Quoted 15 lines · On Tue, Feb 5, 2019, 17:55 Arnout Vandecappelle <[email protected] wrote:
Quoted 5 lines · Thomas De Schampheleire

From: Thomas De Schampheleire <[email protected]>

test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure.

Well, except in the situation where you're iteratively fixing the package
and
re-testing with the -p option, no? Then your subsequent attempt would be happy
to reuse the build results of all dependencies...

Quoted 4 lines

So, I think it's better to make this optional - perhaps with a -k,--keep
option
similar to run-tests.

While it does not hurt to make it optional, I don't understand your example. If your iteratively 'fixing' a package, then the build fails and we don't clean anyway. Right?

But one could indeed imagine iteratively 'changing' a package where intermediate iterations actually work and you want to keep the result.

/Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190205/aa372ef5/attachment.html>

#4 lore raw

PATCH 1/1 utils/test-pkg: clean output dir for successful builds

Quoted 23 lines · Thomas De Schampheleire

On Tue, Feb 5, 2019, 17:55 Arnout Vandecappelle <[email protected] <mailto:[email protected]> wrote:

On 05/02/2019 17:16, Thomas De Schampheleire wrote:
> From: Thomas De Schampheleire <[email protected] <mailto:[email protected]>>
>
> test-pkg will use gigabytes of space when testing all toolchains. > Nevertheless, you are normally only interested in the actual build / host > tree when there is a build failure.

?Well, except in the situation where you're iteratively fixing the package and re-testing with the -p option, no? Then your subsequent attempt would be happy to reuse the build results of all dependencies...

?So, I think it's better to make this optional - perhaps with a -k,--keep option similar to run-tests.

Quoted 6 lines

While it does not hurt to make it optional, I don't understand your example. If your iteratively 'fixing' a package, then the build fails and we don't clean anyway. Right?

But one could indeed imagine iteratively 'changing' a package where intermediate iterations actually work and you want to keep the result.

You still want to re-test the toolchains that worked before. With -p, a
pkg-dirclean is done before building, which is exactly what you need most of the time.

Of course, if you're updating dependencies, it's not the best workflow.

Regards,
Arnout