Skip to content

Commit 3c7120d

Browse files
committed
XZ package compression
This reduces the size of the package file by about a third. On a machine with many CPU cores, it reduces the elapsed time to perform the compression also by about a third.
1 parent 0202e0f commit 3c7120d

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
### Changed
1414
- Updated multilib to use LLVM multilib.yaml 1.0 (#250).
1515
- `*.cfg` files for library variant selection removed in favor of multilib
16-
- The macOS package is now a .dmg instead of .tar.gz.
16+
- The macOS package is now a `.dmg` instead of `.tar.gz`.
17+
- Linux packages are now in `tar.xz` format instead of `tar.gz`.
1718

1819
### Removed
1920

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ set(CPACK_ARCHIVE_COMPONENT_INSTALL TRUE)
313313
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
314314
# When extracting the files put them in an ArmCompiler-.../ directory.
315315
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY TRUE)
316+
# Compress package in parallel.
317+
set(CPACK_THREADS 0 CACHE STRING "")
318+
316319

317320
if(CMAKE_OSX_ARCHITECTURES)
318321
# For universal binaries don't include architecture in the package name.
@@ -1248,8 +1251,8 @@ elseif(CMAKE_OSX_ARCHITECTURES)
12481251
set(cpack_generator DragNDrop)
12491252
set(package_filename_extension ".dmg")
12501253
else()
1251-
set(cpack_generator TGZ)
1252-
set(package_filename_extension ".tar.gz")
1254+
set(cpack_generator TXZ)
1255+
set(package_filename_extension ".tar.xz")
12531256
endif()
12541257
# CPACK_PACKAGE_FILE_NAME may refer to the source package so use this variable instead.
12551258
set(binary_package_name ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME})

cmake/copy_target_libraries.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
def main():
1919
parser = argparse.ArgumentParser(description=__doc__)
2020
parser.add_argument(
21-
"--distribution-tgz",
21+
"--distribution-file",
2222
required=True,
2323
help="""Copy from this LLVM Embedded Toolchain for Arm distribution
24-
tar.gz file. This is a glob to make things easier on Windows.""",
24+
tarfile. This is a glob to make things easier on Windows.""",
2525
)
2626
parser.add_argument(
2727
"--build-dir",
@@ -33,11 +33,11 @@ def main():
3333
# Find the distribution. This is a glob because scripts may not
3434
# know the version number and we can't rely on the Windows shell to
3535
# do it.
36-
for distribution_tgz in glob.glob(args.distribution_tgz):
36+
for distribution_file in glob.glob(args.distribution_file):
3737
break
3838
else:
3939
raise RuntimeError(
40-
f"Distribution glob '{args.distribution_tgz}' not found"
40+
f"Distribution glob '{args.distribution_file}' not found"
4141
)
4242

4343
lib_dir = os.path.join(args.build_dir, "llvm", "lib")
@@ -52,7 +52,7 @@ def main():
5252
dir=args.build_dir,
5353
) as tmp:
5454
# Extract the distribution package.
55-
with tarfile.open(distribution_tgz) as tf:
55+
with tarfile.open(distribution_file) as tf:
5656
tf.extractall(tmp)
5757

5858
# Find the clang-runtimes directory in the extracted package

docs/building-from-source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ninja check-llvm-toolchain
6969

7070
### Packaging the toolchain
7171

72-
After building, create a zip or tar.gz file as appropriate for the platform:
72+
After building, create a zip or tar.xz file as appropriate for the platform:
7373
```
7474
ninja package-llvm-toolchain
7575
```

0 commit comments

Comments
 (0)