Patchwork build: change dist target to use xz

login
register
mail settings
Submitter Brad
Date Jan. 5, 2013, 12:28 a.m.
Message ID <20130105002806.GC11220@rox.home.comstyle.com>
Download mbox | patch
Permalink /patch/209579/
State New
Headers show

Comments

Brad - Jan. 5, 2013, 12:28 a.m.
On Thu, Aug 02, 2012 at 06:08:15AM -0400, Brad Smith wrote:
> If a compression format other than gzip is used we might
> as well move to xz instead of bzip2.

11.8M qemu-1.3.0.tar.gz
9.8M  qemu-1.3.0.tar.bz2
7.8M  qemu-1.3.0.tar.xz
Eric Blake - Jan. 5, 2013, 12:41 a.m.
On 01/04/2013 05:28 PM, Brad Smith wrote:
> On Thu, Aug 02, 2012 at 06:08:15AM -0400, Brad Smith wrote:
>> If a compression format other than gzip is used we might
>> as well move to xz instead of bzip2.

Agreed, many projects are dropping bzip2 as irrelevant (slower than the
more-widely-available gz, compresses worse than newcomer xz).

> +++ b/scripts/make-release
> @@ -20,5 +20,5 @@ git checkout "v${version}"
>  git submodule update --init
>  rm -rf .git roms/*/.git
>  popd
> -tar cfj ${destination}.tar.bz2 ${destination}
> +XZ_OPT=-9 tar cfJ ${destination}.tar.xz ${destination}

Do we really need -9?  For example, coreutils did an interesting
benchmark in its cfg.mk file, and chose to use -8e instead of -9 as a
result:

>> # Comparing tarball sizes compressed using different xz presets, we see that
>> # an -8e-compressed tarball is only 9KiB larger than the -9e-compressed one.
>> # Using -8e is preferred, since that lets the decompression process use half
>> # the memory (32MiB rather than 64MiB).
>> # $ for i in {7,8,9}{e,}; do \
>> #     (n=$(xz -$i < coreutils-8.15*.tar|wc -c);echo $n $i) & done |sort -nr
>> # 5129388 7
>> # 5036524 7e
>> # 5017476 8
>> # 5010604 9
>> # 4923016 8e
>> # 4914152 9e

Also, your use of tar cfJ assumes relatively new GNU tar; it won't work
on other systems (but this is a pre-existing non-portability, and may be
irrelevant, if you are willing to require that the only people likely to
make a release tarball are using appropriate tools).

Patch

diff --git a/Makefile b/Makefile
index a7ac04b..9073a86 100644
--- a/Makefile
+++ b/Makefile
@@ -251,10 +251,10 @@  clean:
 
 VERSION ?= $(shell cat VERSION)
 
-dist: qemu-$(VERSION).tar.bz2
+dist: qemu-$(VERSION).tar.xz
 
-qemu-%.tar.bz2:
-	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
+qemu-%.tar.xz:
+	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.xz,%,$@)"
 
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
diff --git a/scripts/make-release b/scripts/make-release
index 196c755..2237afd 100755
--- a/scripts/make-release
+++ b/scripts/make-release
@@ -20,5 +20,5 @@  git checkout "v${version}"
 git submodule update --init
 rm -rf .git roms/*/.git
 popd
-tar cfj ${destination}.tar.bz2 ${destination}
+XZ_OPT=-9 tar cfJ ${destination}.tar.xz ${destination}
 rm -rf ${destination}