Skip to contentSkip to conversation

build: change dist target to use xz

PATCH In review Brad Smith 3 participants 6 messages Aug 2, 2012 – Jan 9, 2013 Kbuild

lore
Share & tools
lore

Brad Smith

author
#0 lore raw

PATCH 1/1 build: change dist target to use xz

If a compression format other than gzip is used we might as well move to xz instead of bzip2.

11.0M qemu-1.1.1-1.tar.gz
9.2M qemu-1.1.1-1.tar.bz2
7.3M qemu-1.1.1-1.tar.xz

---
 Makefile             |    6 +++---
 scripts/make-release |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
Makefile +3 -3
index 621cb86..9fbaa0e 100644
@@ -234,10 +234,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
scripts/make-release +1 -1
index 196c755..2237afd 100755
@@ -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}
Signature · 7 lines
1.7.6


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
author
#1 lore raw
Quoted 2 lines · Brad Smith

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

Makefile +3 -3
index a7ac04b..9073a86 100644
@@ -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
scripts/make-release +1 -1
index 196c755..2237afd 100755
@@ -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}
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#2 lore raw
Quoted 3 lines · Brad Smith
Quoted 2 lines · Brad Smith

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).

scripts/make-release git checkout "v${version}" · line 23

Quoted 7 lines

+++ b/scripts/make-release

scripts/make-release +1 -1
@@ -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:

Quoted 4 lines
Quoted 4 lines

# 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).
Quoted 8 lines
Quoted 8 lines

# $ 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).

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
author
#3 lore raw
Quoted 8 lines · Eric Blake
Quoted 3 lines · Brad Smith
Quoted 2 lines · Brad Smith

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).

Quoted 9 lines

Review git checkout "v${version}" · line 23

Quoted 7 lines

+++ b/scripts/make-release

(quoted diff) +1 -1
@@ -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?

No. There isn't much of a difference between 8e and 9 with QEMU's tar archive..

8175644 qemu-1.3.0.tar.xz_8e
8164188 qemu-1.3.0.tar.xz_9

Quoted 17 lines

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

Quoted 4 lines
Quoted 4 lines

# 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).
Quoted 8 lines
Quoted 8 lines

# $ 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

Quoted 4 lines

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).

It is already using a GNU tar-ism with the j vs J flags and IMO GNU tar 1.22 at almost 4 years old has been around more than long enough.

Makefile +3 -3
index a7ac04b..9073a86 100644
@@ -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
scripts/make-release +1 -1
index 196c755..9b70650 100755
@@ -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=-8e tar cfJ ${destination}.tar.xz ${destination}
 rm -rf ${destination}
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
author
#4 lore raw
Quoted 9 lines · Brad Smith
Quoted 8 lines · Eric Blake
Quoted 3 lines · Brad Smith
Quoted 2 lines · Brad Smith

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).

Quoted 9 lines
Quoted 9 lines

scripts/make-release git checkout "v${version}" · line 23

Quoted 7 lines

+++ b/scripts/make-release

scripts/make-release +1 -1
@@ -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?

ping.

Quoted 61 lines

No. There isn't much of a difference between 8e and 9 with QEMU's tar archive..

8175644 qemu-1.3.0.tar.xz_8e
8164188 qemu-1.3.0.tar.xz_9

Quoted 17 lines

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

Quoted 4 lines
Quoted 4 lines

# 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).
Quoted 8 lines
Quoted 8 lines

# $ 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

Quoted 4 lines

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).

It is already using a GNU tar-ism with the j vs J flags and IMO GNU tar 1.22 at almost 4 years old has been around more than long enough.

Makefile +3 -3
index a7ac04b..9073a86 100644
@@ -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
scripts/make-release +1 -1
index 196c755..9b70650 100755
@@ -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=-8e tar cfJ ${destination}.tar.xz ${destination}
 rm -rf ${destination}
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#5 lore raw
In reply to Brad Smith
Quoted 2 lines · Brad Smith

If a compression format other than gzip is used we might as well move to xz instead of bzip2.

xz support was introduced in tar only in 2009. We only expose one source tarball and I don't think relying on something so new is a good idea.

Regards,

Anthoyn Liguori

Quoted 47 lines

11.0M qemu-1.1.1-1.tar.gz
9.2M qemu-1.1.1-1.tar.bz2
7.3M qemu-1.1.1-1.tar.xz

---
 Makefile             |    6 +++---
 scripts/make-release |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
Makefile +3 -3
index 621cb86..9fbaa0e 100644
@@ -234,10 +234,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
scripts/make-release +1 -1
index 196c755..2237afd 100755
@@ -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}
Signature · 7 lines
1.7.6


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.