[v2] devtools: remove useless files from ABI reference

Message ID 20200524174341.1777973-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] devtools: remove useless files from ABI reference |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Thomas Monjalon May 24, 2020, 5:43 p.m. UTC
  When building an ABI reference with meson, some static libraries
are built and linked in apps. They are useless and take a lot of space.
Those binaries, and other useless files (examples and doc files)
in the share/ directory, are removed after being installed.

In order to save time when building the ABI reference,
the examples (which are not installed anyway) are not compiled.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: find static libraries anywhere it tries hiding from being swept
---
 devtools/test-meson-builds.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

David Marchand May 28, 2020, 1:16 p.m. UTC | #1
On Sun, May 24, 2020 at 7:43 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> When building an ABI reference with meson, some static libraries
> are built and linked in apps. They are useless and take a lot of space.
> Those binaries, and other useless files (examples and doc files)
> in the share/ directory, are removed after being installed.
>
> In order to save time when building the ABI reference,
> the examples (which are not installed anyway) are not compiled.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2: find static libraries anywhere it tries hiding from being swept
> ---
>  devtools/test-meson-builds.sh | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index 18b874fac5..de569a486f 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -140,10 +140,15 @@ build () # <directory> <target compiler> <meson options>
>                         fi
>
>                         rm -rf $abirefdir/build
> -                       config $abirefdir/src $abirefdir/build $*
> +                       config $abirefdir/src $abirefdir/build -Dexamples= $*
>                         compile $abirefdir/build
>                         install_target $abirefdir/build $abirefdir/$targetdir
>                         $srcdir/devtools/gen-abi.sh $abirefdir/$targetdir
> +
> +                       # save disk space by removing static libs and apps
> +                       find $abirefdir/$targetdir/usr/local -name '*.a' -delete

I would prefer -exec rm -f {} as Bruce proposed, because -delete is not posix.
But otherwise, it works and looks good to me.


> +                       rm -rf $abirefdir/$targetdir/usr/local/bin
> +                       rm -rf $abirefdir/$targetdir/usr/local/share
>                 fi
>
>                 install_target $builds_dir/$targetdir \
> --
> 2.26.2
>

With either -delete or -exec rm:
Acked-by: David Marchand <david.marchand@redhat.com>
  
David Marchand July 3, 2020, 9:08 a.m. UTC | #2
On Thu, May 28, 2020 at 3:16 PM David Marchand
<david.marchand@redhat.com> wrote:
> On Sun, May 24, 2020 at 7:43 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > When building an ABI reference with meson, some static libraries
> > are built and linked in apps. They are useless and take a lot of space.
> > Those binaries, and other useless files (examples and doc files)
> > in the share/ directory, are removed after being installed.
> >
> > In order to save time when building the ABI reference,
> > the examples (which are not installed anyway) are not compiled.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 18b874fac5..de569a486f 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -140,10 +140,15 @@  build () # <directory> <target compiler> <meson options>
 			fi
 
 			rm -rf $abirefdir/build
-			config $abirefdir/src $abirefdir/build $*
+			config $abirefdir/src $abirefdir/build -Dexamples= $*
 			compile $abirefdir/build
 			install_target $abirefdir/build $abirefdir/$targetdir
 			$srcdir/devtools/gen-abi.sh $abirefdir/$targetdir
+
+			# save disk space by removing static libs and apps
+			find $abirefdir/$targetdir/usr/local -name '*.a' -delete
+			rm -rf $abirefdir/$targetdir/usr/local/bin
+			rm -rf $abirefdir/$targetdir/usr/local/share
 		fi
 
 		install_target $builds_dir/$targetdir \