devtools: remove useless files from ABI reference
PATCH 1/1 devtools: remove useless files from ABI reference
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.
--- devtools/test-meson-builds.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +6 -1
@@ -141,10 +141,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 + rm $abirefdir/$targetdir/usr/local/lib/*.a + rm -rf $abirefdir/$targetdir/usr/local/bin + rm -rf $abirefdir/$targetdir/usr/local/share fi install_target $builds_dir/$targetdir \
Signature · 1 line
2.26.0
Quoted 20 lines · Thomas Monjalon
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 <[email protected]>--- devtools/test-meson-builds.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)devtools/test-meson-builds.sh +0
-0@@ -141,10 +141,15 @@ build () # <directory> <target compiler> <meson options> fi
devtools/test-meson-builds.sh build () # <directory> <target compiler> <meson options> · line 150
Quoted 10 lines
devtools/test-meson-builds.sh +4
-1rm -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 + rm $abirefdir/$targetdir/usr/local/lib/*.a
The install directory for libraries is not lib/ in all cases. This breaks the ABI generation for gcc-shared:
DESTDIR=/home/dmarchan/abi/v20.02/build-gcc-shared ninja -C /home/dmarchan/abi/v20.02/build install >/dev/null
rm: cannot remove '/home/dmarchan/abi/v20.02/build-gcc-shared/usr/local/lib/*.a': No such file or directory
$ ls ~/abi/v20.02/build-gcc-shared/usr/local/ bin include lib64 share
Signature · 1 line
David Marchand
21/04/2020 09:49, David Marchand:
Quoted 6 lines · Thomas Monjalon
Quoted 1 line
+ rm $abirefdir/$targetdir/usr/local/lib/*.a
The install directory for libraries is not
lib/in all cases. This breaks the ABI generation for gcc-shared:
Quoted 8 lines
DESTDIR=/home/dmarchan/abi/v20.02/build-gcc-shared ninja -C
/home/dmarchan/abi/v20.02/buildinstall >/dev/null
rm: cannot remove '/home/dmarchan/abi/v20.02/build-gcc-shared/usr/local/lib/*.a': No such file or directory$ ls ~/abi/v20.02/build-gcc-shared/usr/local/ bin include lib64 share
Is it enough to change lib to lib* ?
Quoted 14 lines · Thomas Monjalon
21/04/2020 09:49, David Marchand:
Quoted 12 lines · Thomas Monjalon
Quoted 1 line
+ rm $abirefdir/$targetdir/usr/local/lib/*.a
The install directory for libraries is not
lib/in all cases. This breaks the ABI generation for gcc-shared:DESTDIR=/home/dmarchan/abi/v20.02/build-gcc-shared ninja -C
/home/dmarchan/abi/v20.02/buildinstall >/dev/null
rm: cannot remove '/home/dmarchan/abi/v20.02/build-gcc-shared/usr/local/lib/*.a': No such file or directory
Quoted 4 lines
Quoted 2 lines
$ ls ~/abi/v20.02/build-gcc-shared/usr/local/ bin include lib64 shareIs it enough to change lib to lib* ?
I can see only lib/ or lib64/ so ok for me.
Signature · 1 line
David Marchand
Quoted 15 lines · David Marchand
Quoted 14 lines · Thomas Monjalon
21/04/2020 09:49, David Marchand:
Quoted 12 lines · Thomas Monjalon
Quoted 1 line
+ rm $abirefdir/$targetdir/usr/local/lib/*.a
The install directory for libraries is not
lib/in all cases. This breaks the ABI generation for gcc-shared:DESTDIR=/home/dmarchan/abi/v20.02/build-gcc-shared ninja -C
/home/dmarchan/abi/v20.02/buildinstall >/dev/null
rm: cannot remove '/home/dmarchan/abi/v20.02/build-gcc-shared/usr/local/lib/*.a': No such file or directory
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
$ ls ~/abi/v20.02/build-gcc-shared/usr/local/ bin include lib64 shareIs it enough to change lib to lib* ?
I can see only
lib/or lib64/ so ok for me.
If it's using lib, then the .a files could be in /lib/x86_64-linux-gnu/, rather than in lib directly. Therefore I think it's better to use find or similar to remove the .a files from /usr/local/:
find /usr/local -name 'librte*.a' -exec rm -f {}
PATCH v2 1/1 devtools: remove useless files from ABI reference
In reply to Thomas MonjalonWhen 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.
---
v2: find static libraries anywhere it tries hiding from being swept
--- devtools/test-meson-builds.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +6 -1
@@ -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 \
Signature · 1 line
2.26.2
Quoted 22 lines · Thomas Monjalon
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 <[email protected]>---
v2: find static libraries anywhere it tries hiding from being swept--- devtools/test-meson-builds.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)devtools/test-meson-builds.sh +0
-0@@ -140,10 +140,15 @@ build () # <directory> <target compiler> <meson options> fi
devtools/test-meson-builds.sh build () # <directory> <target compiler> <meson options> · line 149
Quoted 10 lines
devtools/test-meson-builds.sh +4
-1rm -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.
Quoted 8 lines
devtools/test-meson-builds.sh +2
-1+ 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:
Signature · 1 line
David Marchand
David Marchand
AppliedQuoted 7 lines · David Marchand
Quoted 6 lines · Thomas Monjalon
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.
Quoted 5 lines
Quoted 4 lines
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 <[email protected]>Acked-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand