Skip to content

publish-cvcpkg: fix the pycvc-gl opt-in lanes (CUDA -lX11, Windows imgui export) - #531

Merged
transfix merged 4 commits into
masterfrom
fix/publish-optin-lanes
Oct 2, 2026
Merged

transfix merged 4 commits into
masterfrom
fix/publish-optin-lanes

Conversation

@transfix

@transfix transfix commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Fixes the two failures in the publish-cvcpkg.yml opt-in lanes that the dry_run=true windows_pycvc=true publish_cuda=true dispatch exposed (run 36956712529 on master).

1. build-cuda (release): pycvc-gl-cp311-cuda link fails with ld: cannot find -lX11

Cause. cvcGL is a static archive, and since #202 it links X11 by name (target_link_libraries(cvcGL PRIVATE X11)). Its export therefore carries $<LINK_ONLY:X11>, which becomes a bare -lX11 in every consumer. The _pycvc_gl.so link line already had the hermetic $PY/lib/libX11.so, which arrives through VTK's X11::X11, but it also had the bare -lX11 with no -L pointing at the prefix. The CPU Linux lanes only link because the GitHub ubuntu-22.04 image installs libxkbfile-dev, which pulls in libx11-dev, so -lX11 resolves to the image's /usr/lib/x86_64-linux-gnu/libX11.so. That is a non-hermetic accident. The nvidia/cuda container has no system libX11, so the CUDA link fails.

Fix, in two layers:

  • Workflow (takes effect now). The CUDA lane links the published cvcgl, whose export still has the bare -lX11. The pycvc-gl-cuda configure now passes -L$PY/lib through CMAKE_MODULE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS, so the bare -lX11 resolves to the hermetic libX11. There is no apt install.
  • cvcGL export (the root fix). cvcGL now links the X11::X11 imported target, and cvcGLConfig.cmake emits find_dependency(X11) for the static build. The export keeps a relocatable name ($<LINK_ONLY:X11::X11>), so no builder path is baked in. Each consumer resolves that name to its own libX11 through FindX11. VTK's config already runs the same FindX11 pass in every consumer, so this adds no new requirement. After cvcgl is republished, the workflow -L becomes redundant but stays harmless. The CPU lanes build cvcgl from source, so this dry run already exercises the new export there.

2. build (release, 311, windows-2022): pycvc-gl configure fails with non-existent path .../stage-cvcgl/include/imgui

Cause. The cvcpkg imgui bundles for Windows and wasm ship no imguiConfig.cmake, so cvcGL falls back to find_path/find_library. In that branch it exported $<INSTALL_INTERFACE:include/imgui>, a path relative to cvcGL's own prefix, plus a bare imgui link name. Both assume imgui is co-installed next to cvcGL. In this job imgui lives in prefix-imgui-pycvcgl, so configure fails. If configure had passed, the bare imgui.lib still has no /LIBPATH on MSVC and the link would have failed. Linux never hits this because imgui +cvc.3 ships a cmake config there: cvcGL takes the imgui::imgui branch and consumers re-find imgui with find_dependency(imgui CONFIG). This configure was probably failing silently whenever windows_pycvc=true until #523 added the $LASTEXITCODE checks.

Fix. No public inc/cvc/gl/** header includes imgui, so cvcGL itself does not need the install-interface include. Dropping it alone would not be enough, though. The bare imgui still would not link on Windows, and consumers that write ImGui::* themselves (the reason the link is PUBLIC) would lose the include dir. So the config-less branch now exports the same imgui::imgui name as the config branch, and cvcGLConfig.cmake re-creates that target from the consumer's prefix. It uses an imgui package config if one exists, otherwise find_path/find_library on CMAKE_PREFIX_PATH/CMAKE_FIND_ROOT_PATH, with cvcGL's own prefix as the last resort. If imgui cannot be found, it fails with a clear cvcGL_NOT_FOUND_MESSAGE. Split prefixes now resolve, and nothing assumes co-installation.

Verification

  • Local. A standalone cvcGL build against pfx-native-cvc15, forced onto the config-less imgui branch, reproduced the exact non-existent path .../include/imgui error in a split-prefix consumer before the change. After the change:
    • The same consumer configures and links. imgui::imgui resolves to the consumer's own imgui prefix, #include <imgui.h> compiles, and the link line has no bare -lX11; libX11 comes from the hermetic prefix.
    • The config-branch static build exports imgui::imgui plus $<LINK_ONLY:X11::X11> with find_dependency(X11).
    • The shared build exports no X11 and adds no X11 dependency.
    • The not-found case reports the clear message.
    • In-tree links such as cvcgl_smoke now use the absolute hermetic libX11.
  • Branch dry run (36964749286, dry_run=true windows_pycvc=true publish_cuda=true):
    • build-cuda (release): pass. pycvc-cp311-cuda and pycvc-gl-cp311-cuda both build, so failure 1 is fixed.
    • build (release, 311, windows-2022): gets past configure, build and link. The imgui fix works: pycvc-gl configures, links _pycvc_gl.pyd against imgui.lib from the consumer's prefix, and installs. The step now fails later, at cvcpkg pack (see the follow-up below).
    • Linux release 311/312/313 build cvcgl from source with the new X11::X11 / imgui::imgui export, link pycvc-gl against it, and pass. Linux debug, Windows debug, and macos-14 debug and release also pass.
    • arm64 and macos-15-intel fail at libcvc configure with HDF5 not found. These are the allow-failure lanes, and they fail the same way on master.

Follow-up (not in this PR): Windows pycvc packaging layout

With configure fixed, the experimental Windows pycvc step now reaches cvcpkg pack and fails there. The pycvc-cp311 and pycvc-gl-cp311 recipes' package.files list the POSIX layout (lib/python3.11/site-packages/_pycvc*, pycvc.py, pycvc_gl/), but CMake installs to Lib/site-packages/... on Windows. The fix is either per-platform package.files in those recipes, which needs revision bumps, or a Windows install layout that matches the recipes. The two cvcpkg pack lines in that step also lack a $LASTEXITCODE check. The lane is opt-in (windows_pycvc, default false), so the default publish is unaffected.

Recipe revisions are not bumped here. The cvcgl export changes reach the catalog with the next cvcgl publish.

Two consumer-side failures of the installed cvcGL, both surfaced by the
publish-cvcpkg opt-in lanes (windows_pycvc / publish_cuda dry run):

* Config-less imgui (the cvcpkg windows + wasm bundles ship no
  imguiConfig.cmake): the export carried $<INSTALL_INTERFACE:include/imgui>
  relative to cvcGL's OWN prefix plus a bare `imgui` link name. With imgui in
  a different prefix (the windows pycvc-gl step), configure failed:
  'Imported target "cvc::cvcGL" includes non-existent path .../include/imgui'.
  And a bare imgui.lib has no /LIBPATH on MSVC anyway. The export now names
  imgui::imgui (as the config branch already did), and cvcGLConfig.cmake
  re-creates it from the consumer's prefix: an imgui package config if
  present, else find_path/find_library, with cvcGL's prefix as last resort.
  No public cvc/gl header includes imgui; consumers writing ImGui::* still
  get the include dir through imgui::imgui.

* X11 by name ($<LINK_ONLY:X11> -> bare -lX11) only resolved where a system
  libX11.so was on the default linker path. Link X11::X11 instead and emit
  find_dependency(X11) for the static build, so the consumer resolves its
  own (hermetic) libX11; VTK's config already runs that FindX11 pass. The
  export stays free of builder paths.
The CUDA lane links the PUBLISHED static cvcgl, whose export still carries a
bare -lX11. The nvidia/cuda container has no system libX11.so (the GitHub
images get one via libxkbfile-dev -> libx11-dev, which is the only reason the
CPU lanes link), so `ld: cannot find -lX11` despite the hermetic libX11 in
$PY/lib. Put $PY/lib on the module/shared linker search path for that build.
Redundant once cvcgl is republished with the X11::X11 export.

Also update the imgui-export comments to the imgui::imgui scheme.
@transfix
transfix merged commit e12b46c into master Oct 2, 2026
13 checks passed
transfix added a commit that referenced this pull request Oct 2, 2026
@transfix
transfix deleted the fix/publish-optin-lanes 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