Repository navigation
fix(release): self-contained SDK archives on all platforms, proved by a consumer smoke test; build tools from cvcpkg - #587
Merged
Conversation
…rove it The release.yml header promised self-contained SDK archives, but the Linux stage step still copied Boost/HDF5/GSL/log4cplus from apt's dirs, which the job no longer installs (v3.5.0's tarballs shipped libcvc plus the runner's fftw3 and nothing else). macOS static copied a partial set of .a files from the cvcpkg prefix. No platform shipped the deps' CMake configs that cvcConfig.cmake find_dependency()s. Bundling (Linux shared + static, macOS shared + static): - .github/scripts/sdk-bundle-deps.sh copies the cvcpkg prefix libcvc was built against into the SDK and `cvcpkg uninstall`s the 11 bundles the release build never links (gRPC stack, OpenSSL, OpenBLAS, GSL, levmar, log4cplus, libyaml), which is about half the prefix. Bundling is per whole cvcpkg bundle, not per file: a shipped package config only loads if every file its export set names is present (hdf5-targets.cmake FATAL_ERRORs on a missing bin/h5diff), so an ldd closure alone cannot ship working configs. - Shared libcvc gets $ORIGIN (patchelf) / @loader_path (install_name_tool + ad-hoc re-sign); cvcpkg's own libraries already carry them. dylibbundler is gone. - .github/scripts/sdk-check-closure.sh walks what libcvc.so/.dylib loads and fails the stage step on anything outside the SDK or the base system. Verification: a new sdk-smoke job extracts each Release archive on a fresh runner and builds and runs a find_package(cvc CONFIG) consumer with only the archive on CMAKE_PREFIX_PATH (.github/scripts/sdk-smoke-test.sh). It fails if any package config, linked library or loaded library came from outside the archive. The release job requires it to pass. Config fix the smoke test needs: a STATIC cvc exports its PRIVATE imported-target links as $<LINK_ONLY:yaml-cpp::yaml-cpp> etc. (also ftxui, nlohmann_json_schema_validator, CURL, gRPC/protobuf), and cvcConfig.cmake never found those packages, so every static consumer failed at generate time. src/cvc/CMakeLists.txt now records them and cvcConfig.cmake.in find_dependency()s them for a static cvc only. Build tools come from cvcpkg too: .github/actions/cvcpkg-build-tools installs cmake, ninja, pkg-config and patchelf into their own prefix and puts only those on PATH. The apt and Homebrew steps are gone from every lane. Workarounds for cvcpkg's cmake bundles: Linux uses the static build (the shared one has a builder-absolute RUNPATH). On macOS, cvcpkg's curl and openssl are installed next to cmake and cmake gets an rpath to them, because the bundle neither declares curl nor has a usable rpath. Still outside cvcpkg: the compiler (runner image) and the CUDA toolkit (NVIDIA's installer). Linux SDK consumers need the toolkit, because the public headers include <cuda_runtime.h> under CVC_USING_CUDA. Windows archives are unchanged apart from cmake/pkg-config coming from cvcpkg; they still lack the deps' CMake configs and are not smoke-tested.
… dry run The first dry run (37839885257) failed both shared Linux lanes, the shared macOS stage check and both static smoke legs. Each failure was a real problem: - cvcpkg's cmake ran from the tools prefix, and CMake adds its own install prefix to every find_package/find_library search. libcvc's find_package(CURL) found the tools' static libcurl.a and linked it without OpenSSL (undefined SSL_*/X509_* in libcvc.so), and the Linux static smoke leg flagged the same libcurl.a on its link line. cvcpkg-build-tools now copies cmake (plus its share/cmake-X.Y) into a clean tree that holds nothing but the tools, so cmake's own prefix is empty. On Windows that also stops curl.exe/openssl.exe shadowing the runner's. - cvcConfig.cmake appended ImageMagick's codec-delegate closure with unrestricted find_library for every consumer. On macOS that put Homebrew's libbrotlidec on the link line and loaded it at run time (macOS static smoke leg). It is only needed for a static MagickCore (wasm), so it is now gated on that. - sdk-check-closure.sh required an @loader_path rpath on every macOS dylib with @rpath loads. dyld resolves @rpath through the whole load chain, so only libcvc itself needs one. Windows, now bundled and smoke-tested like Linux/macOS: - sdk-bundle-deps.sh now runs `cvcpkg install` on every bundle in the build prefix's lockfile except the unused ones, each pinned to its lockfile version (served from the download cache). It replaces copy + `cvcpkg uninstall`, which cannot read the Windows bundles: they are zip files named .tar.zst. It then fails if the SDK's bundles drift from the build's. cmake and ninja join the unused list. The Windows SDK deps shrink from 1.5 GB to 506 MB. - The Windows stage step calls the bash scripts through Git Bash. The closure check reads PE imports with a small python reader (pe_imports.py; the runner has no objdump) and requires the MSVC runtime to ship in bin/. - That check is what found the missing DLL: cvc.dll imports libomp140.x86_64.dll (built with -openmp:llvm), but InstallRequiredSystemLibraries only knows vcomp140.dll, so no Windows SDK ever shipped it. CMakeLists.txt now installs it from the MSVC redist. - sdk-smoke gains windows-2022 legs: VS generator, PATH cut to the SDK's bin/ plus the Windows directories, and the consumer lists its own loaded modules. Smoke checks tightened: link-line paths outside the SDK must be toolchain paths (compiler, platform SDK, CUDA) or, on Linux, base-system libraries by name. Loaded libraries outside the SDK must be base-system libraries. /usr/lib is no longer allowed wholesale. Diagnostic: the Windows "static" lane has been producing cvc.dll. configure now prints cvc's library type so the next run shows why.
…rpath workaround cvcpkg republished cmake as 3.31.7+cvc.8 (cy-pca/cvcpkg#143): RUNPATH $ORIGIN/../lib on Linux, LC_RPATH @executable_path/../lib on macOS, and curl plus openssl declared as runtime dependencies. So cvcpkg-build-tools no longer needs to: - install the Linux tools --link static to dodge the builder-absolute RUNPATH of the shared cmake (+cvc.6); - install curl and openssl next to cmake on macOS, add an absolute LC_RPATH to cmake/ctest/cpack and re-sign them. Both platforms install the shared tools. The copies in $RUNNER_TEMP/cvcpkg-tools find their libraries in that tree's lib/, which holds only the versioned runtime names (libcurl.so.4.8.0, libssl.3.dylib, ...), so find_library() still finds nothing there. The step now fails if a tool loads a library the tree ships from anywhere else (dyld's fallback search can quietly take /usr/lib/libcurl.4.dylib). On Linux this moves pkg-config from 0.29.2 (the only static build) to pkgconf 3.0.4, the version the macOS jobs already use.
…40 install - PowerShell does not expand a variable inside an unquoted -DNAME=$var argument. The Windows Configure step passed the literal text $shared, which CMake reads as true, so the -static lane has always built and shipped a shared cvc.dll (dry run 37845766765 printed "cvc is a SHARED_LIBRARY (BUILD_SHARED_LIBS=$shared)"). Quote BUILD_SHARED_LIBS and CVC_USING_XMLRPC. - Remove the libomp140 install rule added in the previous commit, and correct the comment it sat under. MSVC's LLVM OpenMP runtime (libomp140.<arch>.dll, needed by cvc built with -openmp:llvm) is not in the VS redist, and Microsoft documents it as not redistributable, so it cannot be installed. The Windows SDK still fails the closure check on it; how cvc should get its OpenMP runtime on Windows is being decided separately.
cvc built by MSVC with -openmp:llvm imports libomp140.x86_64.dll, which Microsoft does not allow redistributing, so the Windows SDK cannot ship it. Until cvc links cvcpkg's LLVM libomp instead (that needs a Windows build of cvcpkg's openmp recipe), this one DLL is an explicit, temporary exception: - sdk-check-closure.sh reports libomp140 as a warning rather than an error. Every other MSVC runtime DLL must still ship in bin/. - sdk-smoke-test.sh's Windows run puts Visual Studio's libomp140 directory on PATH and accepts only that file from outside the SDK and Windows; it is listed as TEMP, everything else is checked as before. - The release.yml header documents the exception. Until then, Windows SDK consumers need Visual Studio on the host, as every Windows release so far has required.
transfix
force-pushed
the
fix/release-sdk-self-contained
branch
from
October 9, 2026 16:51
ec5c340 to
f9d262e
Compare
… loads The first dry run failed every macOS job with cmake loads /usr/lib/libcurl.4.dylib, not the tree's lib/libcurl.4.dylib cmake did load the tree's libcurl through @rpath; the system frameworks it links (CoreServices, SystemConfiguration) also load the OS's copy by absolute path, and the check rejected any copy outside the tree. On macOS, check what matters instead: each @rpath load of the tool, and of the tree libraries it pulls in (libcurl -> libssl, libcrypto), resolves into the tree. A missed @rpath load, which dyld's fallback search turns into the OS copy, still fails. Linux keeps the ldd check, where no second copy is loaded.
The first truly static Windows build (dry run 37963500243, now that the
-static lane really passes BUILD_SHARED_LIBS=OFF) failed linking cvc-cli:
LINK : fatal error LNK1149: output filename matches input filename
'D:\a\libcvc\libcvc\build\lib\Release\cvc.lib'
Linked against a static libcvc, the executable exports symbols, so MSVC writes
an import library for it named after OUTPUT_NAME (cvc) in
CMAKE_ARCHIVE_OUTPUT_DIRECTORY, which is the static cvc.lib it is linking.
Set ARCHIVE_OUTPUT_NAME to cvc-cli. Only Windows import libraries are named by
it; the installed cvc / cvc.exe is unchanged.
The static Windows smoke leg (dry run 37970829003) failed at generate time:
The link interface of target "cvc::cvc" contains:
PkgConfig::_im_dep_bzip2
but the target was not found.
On the raw-libs FindImageMagick path, the pkg-config probe linked each codec
delegate (bzip2, libjpeg, libwebp*, libsharpyuv, libtiff-4, libxml-2.0, liblzma,
lerc) to cvc PRIVATE. That stays inside a shared cvc.dll, but a STATIC cvc
exports private links as $<LINK_ONLY:...>, so all eleven build-local
PkgConfig::_im_dep_* targets ended up in cvcTargets.cmake.
Hang them off the synthesised ImageMagick::MagickCore instead, as the
find_library fallback right below already does. It is an imported (build-local)
target, cvc's export names only ImageMagick::MagickCore, and cvcConfig.cmake.in
rebuilds it for the consumer. The plain PRIVATE link remains only for the
last-ditch case where no MagickCore library was found.
libcvc builds nothing with vcpkg, but one bundle in its Windows closure is a repackaged vcpkg build: cvcpkg's gmp 6.3.0+cvc.1 for windows (the current gmp recipe, cvc.9, builds natively but was never republished for Windows). It carries vcpkg's port helpers (share/vcpkg-cmake, share/vcpkg-cmake-get-vars, share/vcpkg-make) and its SBOM files (share/gmp/vcpkg.spdx.json, vcpkg_abi_info.txt). The old Windows staging copied only .lib/.dll/headers, so these never shipped; bundling whole bundles put them in the Windows SDK. sdk-bundle-deps.sh now removes them and then fails if any vcpkg-named file is left in an SDK, so another vcpkg-built bundle cannot slip in unnoticed. The real fix, a native Windows gmp built from cvcpkg's current recipe, is being done in cvcpkg. (-mindepth 1 keeps both finds off the SDK directory itself. Without it an SDK root whose own name matched would be deleted, as a scratch test showed.)
The vcpkg strip in 3110461 covered gmp only, because the scan that found gmp only read zip-format bundles. Windows mpfr 4.2.1+cvc.1 is a .tar.zst and is a vcpkg build too: 116 vcpkg-named files and a 41-file debug/ tree. Both bundles also install vcpkg's debug/ layout at the prefix root (debug/bin/*.dll, debug/lib/*.lib, debug/lib/pkgconfig/*.pc), which the Windows SDK shipped: libcvc-3.5.0-windows-x86_64-release-static.zip in dry run 38094266881 held debug/bin/gmp-10.dll, mpfr-6.dll, etc. A Release SDK has no use for it, so drop debug/ as well. A full scan of all 37 Windows bundles, reading both zip and tar.zst, finds vcpkg traces in gmp and mpfr only. Native Windows builds of both are being done in cvcpkg.
transfix
added a commit
that referenced
this pull request
Oct 12, 2026
…ption MSVC builds of cvc compile with -openmp:llvm (voxels.cpp needs OpenMP 3.0), so cvc.dll imported libomp140.x86_64.dll, which Microsoft does not allow redistributing. #587 shipped the Windows SDK with that as a documented, temporary exception. This removes it: - cvc links LLVM's own libomp from cvcpkg's `openmp` bundle (Windows build in cy-pca/cvcpkg#146): lib/libomp-llvm.lib by full path, plus /NODEFAULTLIB:libomp.lib and libompd.lib, through a build-local imported target LLVMOpenMP::omp. cvc.dll then imports libomp.dll, which the SDK ships from that bundle. Without the bundle, cvc still builds, falls back to libomp140 and warns at configure time. - A STATIC cvc exports $<LINK_ONLY:LLVMOpenMP::omp>; cvcConfig.cmake.in recreates it from the package's lib/libomp-llvm.lib, so static consumers bind LLVM's libomp too. - The recipe adds `openmp` and `mingw-w64-runtime` as Windows runtime deps. The latter supplies libmcfgthread-2.dll, which cvcpkg's native Windows mpfr (cy-pca/cvcpkg#156) needs. - sdk-check-closure.sh now fails any SDK whose cvc imports libomp140, instead of warning. sdk-smoke-test.sh's Windows run no longer adds Visual Studio's libomp140 to PATH: the SDK's bin/ and the Windows directories only. The release.yml header and the top-level CMakeLists.txt comment are updated.
transfix
added a commit
that referenced
this pull request
Oct 12, 2026
…ption (#607) MSVC builds of cvc compile with -openmp:llvm (voxels.cpp needs OpenMP 3.0), so cvc.dll imported libomp140.x86_64.dll, which Microsoft does not allow redistributing. #587 shipped the Windows SDK with that as a documented, temporary exception. This removes it: - cvc links LLVM's own libomp from cvcpkg's `openmp` bundle (Windows build in cy-pca/cvcpkg#146): lib/libomp-llvm.lib by full path, plus /NODEFAULTLIB:libomp.lib and libompd.lib, through a build-local imported target LLVMOpenMP::omp. cvc.dll then imports libomp.dll, which the SDK ships from that bundle. Without the bundle, cvc still builds, falls back to libomp140 and warns at configure time. - A STATIC cvc exports $<LINK_ONLY:LLVMOpenMP::omp>; cvcConfig.cmake.in recreates it from the package's lib/libomp-llvm.lib, so static consumers bind LLVM's libomp too. - The recipe adds `openmp` and `mingw-w64-runtime` as Windows runtime deps. The latter supplies libmcfgthread-2.dll, which cvcpkg's native Windows mpfr (cy-pca/cvcpkg#156) needs. - sdk-check-closure.sh now fails any SDK whose cvc imports libomp140, instead of warning. sdk-smoke-test.sh's Windows run no longer adds Visual Studio's libomp140 to PATH: the SDK's bin/ and the Windows directories only. The release.yml header and the top-level CMakeLists.txt comment are updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #585 (merged).
Problem
release.yml's header promises self-contained SDK archives. They are not.libboost_*,libhdf5*,libgsl*andliblog4cplus*plus headers from apt's dirs. The job no longer installs any of those. The v3.5.0 tarball holdslibcvc.so*,libxmlrpc.aand the runner's preinstalledlibfftw3*, which libcvc no longer even links.*.afiles the shared cvcpkg prefix happens to have. That is a partial set with no Boost thread/filesystem and no dylibs, even though a static libcvc links its deps as shared libraries.cvcConfig.cmakefind_dependency()s.What every archive bundles now (Linux, macOS, Windows; shared and static)
Each archive is libcvc's install tree plus every cvcpkg bundle libcvc uses, as whole bundles: libraries, headers,
lib/cmake,lib/pkgconfig, and the tools some configs reference.sdk-bundle-deps.shrunscvcpkg installon every bundle in the build prefix's lockfile. Each bundle is pinned to the version libcvc was built against, so cvcpkg serves it from the download cache. It skips the bundles the release build never links:cvcpkg still pulls in anything a kept bundle requires; on Windows that brings back openssl (needed by curl) plus cmake and ninja. The script then fails if the SDK's bundles drift from the build's. Deps come to 343 MB on Linux, and 506 MB instead of 1.5 GB on Windows.
Why whole bundles rather than an ldd closure. A shipped package config only loads if every file its export set names exists.
hdf5-targets.cmakeFATAL_ERRORs on a missingbin/h5difforlib/libhdf5.a. Boost's per-component configs silently drop any variant whose library is gone.Why pinned install rather than copy +
cvcpkg uninstall.uninstallcannot read the Windows bundles: they are zip files named.tar.zst.installhandles them;uninstall's tar reader crashes.Runtime lookup.
$ORIGIN.@loader_path, plus an ad-hoc re-sign. dylibbundler is gone.cvc.dllinbin/, with the MSVC runtime.Packaging-time check.
sdk-check-closure.shwalks everything the shared libcvc loads. It reads ELF NEEDED entries, Mach-O load commands, or PE imports; the PE imports come from a smallpe_imports.py, since the Windows runner has no objdump. It fails the stage step on anything outside the SDK or the base system. On Windows it also fails if the MSVC runtime isn't shipped inbin/.Verified, not assumed:
sdk-smokeA new job takes each of the 6 Release archives onto a fresh runner (ubuntu, macos, windows-2022). It configures, builds and runs a
find_package(cvc CONFIG)consumer with only the extracted archive onCMAKE_PREFIX_PATH(sdk-smoke-test.sh):LD_LIBRARY_PATHorDYLD_*is set;bin/plus the Windows directories.Runner images ship libraries of their own, so it also fails if any of these came from outside the archive:
The release job now requires every leg to pass.
Fixes the checks found
The first dry run (37839885257) caught each of these:
yaml-cpp::yaml-cpp,ftxui::*,nlohmann_json_schema_validator::validator,CURL::libcurl; gRPC/protobuf when enabled) as$<LINK_ONLY:...>.cvcConfig.cmakenever found those packages.src/cvc/CMakeLists.txtnow records them and the configfind_dependency()s them, for a static cvc only.cvcConfig.cmakeappended the codec delegates with unrestrictedfind_libraryfor every consumer. The macOS static smoke leg linked and loaded Homebrew'slibbrotlidecthat way. The closure is now applied only for a staticMagickCore(wasm), the only case that needs it.-staticarchive always shipped a DLL. PowerShell passed-DBUILD_SHARED_LIBS=$sharedto cmake as the literal text$shared, which CMake reads as true; configure printedBUILD_SHARED_LIBS=$shared. The Windows Configure step now quotes its-Darguments, so-staticbuilds a real staticcvc.lib.cvcleaked build-local targets into its export, twice.cvc-cli's import library over the staticcvc.lib(LNK1149). It's now namedcvc-cli.PkgConfig::_im_dep_*targets tocvcPRIVATE, and a static library exports PRIVATE links. They now hang off the build-localImageMagick::MagickCore.cvc.dllneeds a DLL nobody may ship. The new Windows closure check found thatcvc.dllimportslibomp140.x86_64.dll, which no Windows SDK has ever contained; see "Still outside cvcpkg".Build tools from cvcpkg
.github/actions/cvcpkg-build-toolsinstalls cmake, ninja and pkg-config (plus patchelf on Linux) from cvcpkg, and every apt and Homebrew step is gone.cmake has to be copied into a clean tree holding only the tools. CMake searches its own install prefix for packages, and run from the cvcpkg tools prefix it handed libcvc that prefix's static
libcurl.a. In the first dry run that produced undefined OpenSSL symbols inlibcvc.so.cvcpkg has since republished cmake as relocatable (
3.31.7+cvc.8, cy-pca/cvcpkg#143), so the Linux-static and macOS-rpath workarounds are gone (7e6278b, from the cmake-relocation session).Still outside cvcpkg
<cuda_runtime.h>underCVC_USING_CUDA. The Linux and Windows smoke legs install it for that reason.-openmp:llvm, whose runtimelibomp140.x86_64.dllMicrosoft documents as not redistributable, so the SDK cannot ship it. Any machine that loads the Windows SDK's cvc still needs Visual Studio's copy, as every Windows release so far has.sdk-check-closure.shreports this one DLL as a warning. The Windows smoke run adds Visual Studio's copy to PATH and accepts nothing else from outside the archive. The fix is to link cvc to LLVM's redistributable libomp from cvcpkg, which first needs a Windows build of cvcpkg'sopenmprecipe (follow-up).Validation
Dry runs via
gh workflow run release.yml --ref fix/release-sdk-self-contained:dbdfb7e4) found the CURL contamination, the macOS rpath over-check and the two static-smoke leaks.3bd396cd):sdk-smokelegs passed: shared and static each configured, built and ran a consumer with every config, link input and loaded library in the archive or the base system;libomp140, and the release gate refused accordingly.884906d7, on master after fix(release): unblock tag releases -- release/shared deps for every lane, Debug best-effort #585, plus relocatable cmake, the real Windows static build, thecvc-cliimport-library fix and thelibomp140interim):sdk-smokelegs passed: Linux shared/static, macOS shared/static and Windows shared;PkgConfig::_im_dep_bzip2: the static export carried 11 ImageMagick codec targets. Fixed in5184ce65.5184ce65): fully green. All 10 build lanes passed, all 6sdk-smokelegs passed (Linux, macOS and Windows, shared and static), and the release job's "Check artifact set" passed.6b5c734a, also strips vcpkg leftovers, including vcpkg'sdebug/tree, from the SDKs): fully green. All 10 build lanes passed, all 6sdk-smokelegs passed, and the release gate passed. Both Windows archives contain 0 vcpkg files and nodebug/tree. (38094266881 on3110461cwas cancelled as superseded.)Earlier dry runs 37961531550 and 37963500243 were cancelled as superseded: the head moved on while their macOS jobs waited for runners.
No release, tag or existing run was created, edited or deleted.
Follow-ups noticed
cvcpkg uninstallcan't read the zip-format Windows bundles;libboost_iostreamsloads Homebrew zstd, and its Linuxlibboost_localeneeds the build host's ICU 70;openmprecipe, link cvc to itslibomp.dll(with/NODEFAULTLIB:libomp.lib), and remove thelibomp140interim.gmp 6.3.0+cvc.1andmpfr 4.2.1+cvc.1are repackaged vcpkg builds, the only two of the 37 bundles in libcvc's Windows closure. The current native recipes were never republished for Windows. This PR strips their vcpkg files (share/vcpkg-*,vcpkg*SBOMs) and vcpkg'sdebug/tree, and fails if any vcpkg file reaches an SDK. Native Windows rebuilds of both are in progress in cvcpkg.voxels.h/cuda_utils.hprivate would remove the toolkit requirement for consumers.