Skip to content

cmake: also rewrite assimp's stale windows z.lib to ZLIB::ZLIB - #715

Merged
transfix merged 2 commits into
masterfrom
fix/assimp-windows-zlib-export
Oct 19, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/assimp-windows-zlib-export

Conversation

@transfix

@transfix transfix commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

package-windows is red on master, and the Windows recipe lane is red on every open PR. Both fail on an absolute path into the Windows builder's sandbox:

  • recipe / windows-2022 / Release: ninja: error: 'C:/Users/tfx/cvcpkg-builder/cvcpkg-job-assimp-in48sza4/cvcpkg-prefix-assimp-phowce8c/lib/z.lib', needed by 'bin/cvc.dll', missing
  • package-windows / libcvc-release: nvlink fatal : Could not open input file '.../lib/z.lib' (the CUDA device link)

The path comes from assimp's exported INTERFACE_LINK_LIBRARIES. libcvc already rewrites assimp's stale zlib entry to ZLIB::ZLIB (#158), but it matched only libz.* and zlib.*. The republished Windows assimp names zlib's import library z.lib, so the entry slipped through. #704, #707 and #710 passed these lanes before the republish.

The fix also matches a path ending in /z.lib or \z.lib, through to the end of its list entry, because the export wraps it as $<LINK_ONLY:…/lib/z.lib>. The first push stopped at z.lib and left ZLIB::ZLIB>, which configure rejected; this version consumes the wrapper. I checked the pattern with cmake -P against all three zlib forms, with both slash styles, bare and inside $<LINK_ONLY:>. Each becomes ZLIB::ZLIB, and zstd.lib, libzstd.a and bz2.lib are left alone.

The second commit gives cvcConfig.cmake, which every consumer of libcvc loads, the same pattern. Once libcvc itself linked, the Windows recipe lane failed one step later, in its consumer smoke test: LNK1181: cannot open input file …\lib\z.lib in smoke.vcxproj. That config re-finds assimp for consumers and had its own copy of the old pattern. I checked the configured template's pattern with cmake -P too.

Not verified locally: there's no Windows here, so this PR's Windows lanes are the test. The real fix is a relocatable assimp export (the libcvc-deps follow-up the CMake comment names). This keeps libcvc building until then.

The defensive rewrite of assimp's exported zlib link matched libz.* and
zlib.*, but an assimp republished on the windows builder exports
$<LINK_ONLY:.../cvcpkg-prefix-assimp-*/lib/z.lib> (zlib's CMake names its
windows import library z.lib). Neither pattern matched, so the builder-absolute
path survived into cvc.dll's link: `ninja: error: ...lib/z.lib, needed by
bin/cvc.dll, missing` in the windows recipe lane and `nvlink fatal: Could not
open input file ...lib/z.lib` in package-windows (red on master since the
republish). Match a path ending in /z.lib or \z.lib too, through to the end of
its list entry so a $<LINK_ONLY:...> wrapper does not leave a stray '>'.
@transfix
transfix force-pushed the fix/assimp-windows-zlib-export branch from d521251 to 4990578 Compare October 19, 2026 06:06
With the build-side rewrite fixed, the windows recipe lane got as far as its
consumer smoke test and failed there: `LNK1181: cannot open input file
...cvcpkg-prefix-assimp-*\lib\z.lib` in smoke.vcxproj. cvcConfig.cmake re-finds
assimp for every consumer and carries its own copy of the stale-zlib rewrite,
with the old libz/zlib-only pattern. Give it the same pattern as
src/cvc/CMakeLists.txt.
@transfix
transfix merged commit 9397cc1 into master Oct 19, 2026
19 of 20 checks passed
@transfix
transfix deleted the fix/assimp-windows-zlib-export branch October 29, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant