Repository navigation
publish-cvcpkg: fix the pycvc-gl opt-in lanes (CUDA -lX11, Windows imgui export) - #531
Merged
Merged
Conversation
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.
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.
Fixes the two failures in the
publish-cvcpkg.ymlopt-in lanes that thedry_run=true windows_pycvc=true publish_cuda=truedispatch exposed (run 36956712529 on master).1.
build-cuda (release): pycvc-gl-cp311-cuda link fails withld: cannot find -lX11Cause. 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-lX11in every consumer. The_pycvc_gl.solink line already had the hermetic$PY/lib/libX11.so, which arrives through VTK'sX11::X11, but it also had the bare-lX11with no-Lpointing at the prefix. The CPU Linux lanes only link because the GitHububuntu-22.04image installslibxkbfile-dev, which pulls inlibx11-dev, so-lX11resolves to the image's/usr/lib/x86_64-linux-gnu/libX11.so. That is a non-hermetic accident. Thenvidia/cudacontainer has no system libX11, so the CUDA link fails.Fix, in two layers:
-lX11. The pycvc-gl-cuda configure now passes-L$PY/libthroughCMAKE_MODULE_LINKER_FLAGSandCMAKE_SHARED_LINKER_FLAGS, so the bare-lX11resolves to the hermetic libX11. There is no apt install.X11::X11imported target, andcvcGLConfig.cmakeemitsfind_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-Lbecomes 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 withnon-existent path .../stage-cvcgl/include/imguiCause. The cvcpkg imgui bundles for Windows and wasm ship no
imguiConfig.cmake, so cvcGL falls back tofind_path/find_library. In that branch it exported$<INSTALL_INTERFACE:include/imgui>, a path relative to cvcGL's own prefix, plus a bareimguilink name. Both assume imgui is co-installed next to cvcGL. In this job imgui lives inprefix-imgui-pycvcgl, so configure fails. If configure had passed, the bareimgui.libstill has no/LIBPATHon MSVC and the link would have failed. Linux never hits this because imgui+cvc.3ships a cmake config there: cvcGL takes theimgui::imguibranch and consumers re-find imgui withfind_dependency(imgui CONFIG). This configure was probably failing silently wheneverwindows_pycvc=trueuntil #523 added the$LASTEXITCODEchecks.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 bareimguistill would not link on Windows, and consumers that writeImGui::*themselves (the reason the link isPUBLIC) would lose the include dir. So the config-less branch now exports the sameimgui::imguiname as the config branch, andcvcGLConfig.cmakere-creates that target from the consumer's prefix. It uses an imgui package config if one exists, otherwisefind_path/find_libraryonCMAKE_PREFIX_PATH/CMAKE_FIND_ROOT_PATH, with cvcGL's own prefix as the last resort. If imgui cannot be found, it fails with a clearcvcGL_NOT_FOUND_MESSAGE. Split prefixes now resolve, and nothing assumes co-installation.Verification
pfx-native-cvc15, forced onto the config-less imgui branch, reproduced the exactnon-existent path .../include/imguierror in a split-prefix consumer before the change. After the change:imgui::imguiresolves 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.imgui::imguiplus$<LINK_ONLY:X11::X11>withfind_dependency(X11).cvcgl_smokenow use the absolute hermetic libX11.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.pydagainstimgui.libfrom the consumer's prefix, and installs. The step now fails later, atcvcpkg pack(see the follow-up below).X11::X11/imgui::imguiexport, link pycvc-gl against it, and pass. Linux debug, Windows debug, and macos-14 debug and release also pass.Follow-up (not in this PR): Windows pycvc packaging layout
With configure fixed, the experimental Windows pycvc step now reaches
cvcpkg packand fails there. Thepycvc-cp311andpycvc-gl-cp311recipes'package.fileslist the POSIX layout (lib/python3.11/site-packages/_pycvc*,pycvc.py,pycvc_gl/), but CMake installs toLib/site-packages/...on Windows. The fix is either per-platformpackage.filesin those recipes, which needs revision bumps, or a Windows install layout that matches the recipes. The twocvcpkg packlines in that step also lack a$LASTEXITCODEcheck. The lane is opt-in (windows_pycvc, defaultfalse), so the default publish is unaffected.Recipe revisions are not bumped here. The cvcgl export changes reach the catalog with the next cvcgl publish.