Skip to content

Commit

Permalink
Switch our source tarball compression to zstd
Browse files Browse the repository at this point in the history
zstd --long --ultra -22 produces significantly smaller files than xz, so
start switching to that.
  • Loading branch information
geraldcombs authored and johnthacker committed Nov 23, 2024
1 parent fd6004f commit fc4bb73
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ Source Package:
- WIRESHARK_VERSION=$(< wireshark_version.txt)
- cp -v doc/release-notes.html ../release-notes-${WIRESHARK_VERSION}.html
- cp -v doc/release-notes.txt ../release-notes-${WIRESHARK_VERSION}.txt
- cd ..
- zstdcat --threads=0 wireshark-${WIRESHARK_VERSION}.tar.zst | xz --threads=0 > wireshark-${WIRESHARK_VERSION}.tar.xz
after_script:
# - ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
- if [ "$CI_JOB_STATUS" != "success" ]; then exit 0 ; fi
Expand Down
9 changes: 4 additions & 5 deletions doc/release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ See the “New and Updated Features” section below for more details.

The following features are either new or have been significantly updated since version 4.4.0:

// * The Windows installers now ship with Npcap 1.79.
// They previously shipped with Npcap 1.78.
* The Windows installers now ship with Npcap 1.80.
They previously shipped with Npcap 1.79.

* Source packages are now compressed using zstd.

//* The Windows installers now ship with Qt 6.5.2.
// They previously shipped with Qt 6.2.3.
Expand Down Expand Up @@ -96,9 +98,6 @@ The following features are either new or have been significantly updated since v
`require`, so that `require("bit")` and `require("rex_pcre2")` statements
in Lua dissectors, while usually superfluous, behave as expected. wsbuglink:20213[]

* The Windows installers now ship with Npcap 1.80.
They previously shipped with Npcap 1.79.

// === Removed Features and Support


Expand Down
4 changes: 2 additions & 2 deletions doc/wsdg_src/wsdg_sources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1168,11 +1168,11 @@ For example, if your packaging system links to or downloads the
source tarball and you want to download from 1.na.dl.wireshark.org,
use

https://1.na.dl.wireshark.org/download/src/all-versions/wireshark-{wireshark-version}.tar.xz
https://1.na.dl.wireshark.org/download/src/all-versions/wireshark-{wireshark-version}.tar.zst

instead of

https://1.na.dl.wireshark.org/download/src/wireshark-{wireshark-version}.tar.xz
https://1.na.dl.wireshark.org/download/src/wireshark-{wireshark-version}.tar.zst

[discrete]
===== Staying Current
Expand Down
4 changes: 2 additions & 2 deletions packaging/rpm/wireshark.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Version: @RPM_VERSION@
Release: 1%{?dist}
License: GPLv2+
Group: Applications/Internet
Source: https://www.wireshark.org/download/src/%{name}-%{package_version}.tar.xz
Source: https://www.wireshark.org/download/src/%{name}-%{package_version}.tar.zst
# Or this URL for automated builds:
#Source: https://www.wireshark.org/download/automated/src/%%{name}-%%{package_version}.tar.xz
#Source: https://www.wireshark.org/download/automated/src/%%{name}-%%{package_version}.tar.zst
URL: https://www.wireshark.org/
Packager: Gerald Combs <gerald[AT]wireshark.org>

Expand Down
13 changes: 5 additions & 8 deletions packaging/source/git-export-release.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if test -n "${1-}"; then
PROJECT_VERSION="$1"
fi

TARBALL="${DESTDIR}/wireshark-${PROJECT_VERSION}.tar.xz"
TARBALL="${DESTDIR}/wireshark-${PROJECT_VERSION}.tar.zst"

# A tarball produced by 'git archive' will have the $Format string
# substituted due to the use of 'export-subst' in .gitattributes.
Expand All @@ -52,7 +52,7 @@ if [[ $COMMIT != \$F* ]] ; then
if [[ -f "$TARBALL" ]] ; then
# git get-tar-commit-id works outside a git repo, as it
# only reads the first 1024 bytes of the tar extended header.
if [[ $(git get-tar-commit-id < <(xzcat "$TARBALL")) == "$COMMIT" ]] ; then
if [[ $(git get-tar-commit-id < <(zstdcat "$TARBALL")) == "$COMMIT" ]] ; then
echo "$TARBALL commit ID matches $COMMIT."
else
# Allow people to make changes to a downloaded source tarball
Expand All @@ -65,7 +65,7 @@ if [[ $COMMIT != \$F* ]] ; then
echo ""
echo "The build system cannot produce a source tarball outside of a git repository."
echo "If you are trying to build an RPM package from source extracted from a tarball,"
echo "copy it (i.e., wireshark-${PROJECT_VERSION}.tar.xz) to"
echo "copy it (i.e., wireshark-${PROJECT_VERSION}.tar.zst) to"
echo "$DESTDIR"
echo "and run the build command again."

Expand All @@ -84,7 +84,7 @@ fi

if [ -f "$TARBALL" ] ; then
printf "Found %s\\n" "$TARBALL"
if TARBALL_ID=$(git get-tar-commit-id < <(xzcat "$TARBALL")) && COMMIT_ID=$(git rev-parse --verify "$COMMIT") ; then
if TARBALL_ID=$(git get-tar-commit-id < <(zstdcat "$TARBALL")) && COMMIT_ID=$(git rev-parse --verify "$COMMIT") ; then
if [[ $TARBALL_ID == "$COMMIT_ID" ]] ; then
echo "$TARBALL commit ID matches $COMMIT."
exit 0
Expand All @@ -94,7 +94,4 @@ fi

echo "Creating $TARBALL from $COMMIT"

XZ_OPTS=
echo . | xz --threads=0 > /dev/null 2>&1 && XZ_OPTS=--threads=0

git archive --prefix="wireshark-${PROJECT_VERSION}/" "$COMMIT" | xz $XZ_OPTS > "$TARBALL"
git archive --prefix="wireshark-${PROJECT_VERSION}/" "$COMMIT" | zstd --threads=0 --long --ultra -22 > "$TARBALL"

0 comments on commit fc4bb73

Please sign in to comment.