You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: RSTUDIO_USE_SYSTEM_DEPENDENCIES / RSTUDIO_USE_SYSTEM_ZLIB still builds vendored rstudio-zlib #19245
On Windows, configuring with RSTUDIO_USE_SYSTEM_DEPENDENCIES=ON (or RSTUDIO_USE_SYSTEM_ZLIB=ON) can't succeed. zlib is taken from find_package, but the build still creates the vendored rstudio-zlib target from the fetched sources, which don't exist on that path.
In src/cpp/ext/CMakeLists.txt:
On the system path, fetch() calls find_package and never sets ZLIB_SOURCE_DIR/ZLIB_BINARY_DIR (L190).
The if(WIN32 AND ZLIB_ENABLED) block (L560-L571) runs regardless of where zlib came from. It calls configure_file("${ZLIB_SOURCE_DIR}/zconf.h.cmakein" ...), which becomes /zconf.h.cmakein, so configure fails there.
The vendored target is also linked unconditionally on WIN32:
A fix would skip the rstudio-zlib block when zlib comes from the system, and link ZLIB::ZLIB in those three places instead. The block that forces libgit2's ZLIB_* cache variables (L444) is already skipped on the system path, so libgit2 would pick up the same system zlib.
Found by reading the code while reviewing #19239, which fixes RSTUDIO_USE_SYSTEM_DEPENDENCIES for the other dependencies; not yet reproduced on a Windows machine. Default Windows builds (no system dependencies) are not affected.
Fixed by #19239, merged on November 2, 2026. The system-zlib path now aliases rstudio-zlib to ZLIB::ZLIB and skips creation of the vendored library.
Verified against main at 11a39a3 using a focused harness that extracts the dependency helpers and zlib setup from the production CMake code and exercises the Windows CMake branches on macOS:
RSTUDIO_USE_SYSTEM_ZLIB=ON: configuration, compilation, and compression/decompression round trips passed using each of the three consumer link statements (rstudio-core, rstudio-core-tests, and rstudio-core-synctex).
RSTUDIO_USE_SYSTEM_DEPENDENCIES=ON: the same checks passed.
Default vendored selection and RSTUDIO_USE_SYSTEM_DEPENDENCIES=ON with RSTUDIO_USE_SYSTEM_ZLIB=OFF: configuration passed, with the vendored static target and generated zconf.h present.
This was a focused CMake smoke check, not a full RStudio build or native Windows validation.
Activity
Narrow the system-dependencies NEWS entry to what changed
Fix `RSTUDIO_USE_SYSTEM_DEPENDENCIES` (#19239)
kevinushey commentedon Nov 5, 2026
Fixed by #19239, merged on November 2, 2026. The system-zlib path now aliases rstudio-zlib to ZLIB::ZLIB and skips creation of the vendored library.
Verified against main at 11a39a3 using a focused harness that extracts the dependency helpers and zlib setup from the production CMake code and exercises the Windows CMake branches on macOS:
This was a focused CMake smoke check, not a full RStudio build or native Windows validation.