[llvm-branch-commits] [llvm] release/23.x: workflows/release-binaries: Smaller WiX installer on Windows (#219858) (PR #219984)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 31 07:29:19 PDT 2026


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/219984

Backport dee1f43598034a63b3de521032bb894b33152b1c

Requested by: @aganea

>From 9e09ff6f2a033f8bf2846ea312a4712c0110eb40 Mon Sep 17 00:00:00 2001
From: Alexandre Ganea <aganea at havenstudios.com>
Date: Mon, 31 Aug 2026 09:49:53 -0400
Subject: [PATCH] workflows/release-binaries: Smaller WiX installer on Windows
 (#219858)

Reduce WiX installer size by using LZX compression instead of MSZIP
previously. Tested on `release/23.x` at commit
fdf0409c656cc66c61b14d71c831f2b453c13e19 targetting Win64:

- MSZIP: 779 MiB
- LZX: 613 MiB

(cherry picked from commit dee1f43598034a63b3de521032bb894b33152b1c)
---
 llvm/CMakeLists.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 7b8f1b3b3ced9..9340cd6c4501f 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -508,8 +508,14 @@ if(WIN32 AND NOT UNIX)
   endif()
   if(CPACK_GENERATOR STREQUAL "WIX")
     set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_icon.ico")
-    # The WIX installer needs admin privileges unless we use this flag.
-    set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval")
+    # -sval: the WIX installer needs admin privileges unless we use this flag.
+    # -dcl:high: light defaults the cabinet to MSZIP (deflate, 32 KiB window),
+    # which captures almost no redundancy between the payload's binaries.  high
+    # selects LZX with a 21-bit (2 MiB) window instead.  That is the strongest
+    # compression available here: Windows Installer has to be able to read the
+    # cabinet itself, and CAB supports only MSZIP/LZX/Quantum, so an MSI cannot
+    # use LZMA the way the NSIS generator does.
+    set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval" "-dcl:high")
   endif()
 endif()
 include(CPack)



More information about the llvm-branch-commits mailing list