Repository navigation
build: resolve explicit Qt SDK interfaces for Cargo native builds - #1877
Conversation
72393ad to
a85a82b
Compare
|
Ejected from the merge queue: merge-group Fast Gate failed |
a85a82b to
b720c2f
Compare
|
Merge queue marked this UNMERGEABLE: #1896 and #1875 (ahead in the queue) edit the same graph-count line in native.rs. #1896 already fixes the #1879/#1883 counts, and #1892 (merged) now runs that contract on test/cmocka changes. So I dropped my two count-only commits; this PR no longer touches native.rs. Rebased on 6aec1c3; ./lint and qt_sdk:: (7) pass. |
|
Correction to the comment above: the first push was rejected because the PR was still queued. I dequeued it and the push has now landed (24f5817). I'll requeue it once PR CI is green. |
b720c2f to
24f5817
Compare
Fixture SDKs reproduce the exported CMake targets and binary headers of the obs-studio-libs Qt 6.11.1 Linux, Windows and macOS archives. All six cases fail on todo!() stubs.
) OBS_QT_TARGET_PREFIX and OBS_QT_HOST_PREFIX select the target Qt SDK and its host tools. qt::Sdk evaluates the SDK's exported CMake targets as data for the Cargo target (Core/Gui/Widgets closure, definitions, MSVC options, import libraries, frameworks, rpaths and the Windows DLL runtime path) and validates architecture, Qt 6 version, tool/SDK release and CRT before anything compiles. Cross builds no longer fall back to host pkg-config. The published obs-studio-libs Windows SDK exports alias configurations in AdditionalTargetInfo; only Targets-<config> files are read (RED fixture added in this commit, reproducing the real-SDK failure).
${_IMPORT_PREFIX} substitution produced mixed separators on Windows
(C:\t/lib/Qt6Core.lib), so link arguments, rpaths and PATH prepends did not
match the paths Windows reports. Tests compare normalized paths.
24f5817 to
292599f
Compare
Scope
Fixes #1869 (the next unit of #1332 from the #1868 handoff). CMake remains authoritative; this does not complete #1332.
OBS_QT_TARGET_PREFIXselects the target Qt SDK;OBS_QT_HOST_PREFIXselects the SDK whosemoc/uic/rccrun on the host (libexec/on Unix hosts,bin/*.exeon Windows).OBS_QT_MOC/UIC/RCCstill override per tool. Inputs are read only; nothing mutates the process environment.qt::Sdkreads the SDK's own exported CMake targets as data (CMake is not run) and resolves theQt6::closure of a module: include dirs, definitions, compile options (MSVC-Zc:__cplusplus -permissive- -utf-8,UNICODE,WIN32/WIN64), link artifacts and Qt's exported system libraries/frameworks. Only the generator expressions Qt exports are evaluated; any other fails.qconfig.h, host tool--versionequals the SDK release, configuration/CRT (Windows DEBUG-only SDKs andcrt-staticare rejected, since Rust's MSVC targets link the release CRT; AdditionalTargetInfo aliases are ignored).libQt6*.so+ rpath. Windows:lib/Qt6*.libimport libraries, DLL directory as the graph'sPATHruntime prepend. macOS: framework binaries, Qt's frameworks (deduplicated), rpath to the frameworks' directory. Target rules live insrc/platform/qt_sdk.rs.libobs::add_packageandDependency::packagerouteQt6<Module>packages through the resolver when a target prefix is given.RED → GREEN
obs-tests-appbinary (newqt_sdkmodule, no new executable) againsttodo!()stubs: 6 failed (not yet implemented); the published-SDK case was added with GREEN.Qt6::Core has no RELEASE configuration(Qt'sQt6CoreAdditionalTargetInfo.cmakedeclares alias configurations). The Windows fixture now carries that file; with it and the old scan, the two Windows cases failed; the fix reads onlyQt6<M>Targets-<config>.cmake.qt_sdk::7 passed.End-to-end RED/GREEN in the Linux validation image (
obs-rust-linux-validate), with the prebuiltobs-studio-libsqt6-6.11.1Linux SDK mounted,OBS_QT_TARGET_PREFIXset andPKG_CONFIG_LIBDIRexposing onlycmocka.pc(no Qt visible to pkg-config):git archive origin/master):native_test_graph_generates_qt_metaobjectsandcanonical_remux_queue_runs_unchangedfail:native dependency Qt6Core/Qt6Widgets: pkg-config ... not found.CMAKE_PREFIX_PATH= same SDK). 9 passed total withqt_sdk::.Published SDK resolution (
qt_sdk_resolves_published_sdks, extracted archives viaOBS_QT_TEST_{LINUX,WINDOWS,MACOS}_PREFIX):Validation
./lint: ok. Clippy-D warningsfor obs-build/obs-studio-rust withlibobs-integration: clean.obs-studio-libsreleases.plugins/obs-browsermismatch is excluded.Not covered (reported, not claimed)
Compiling and running against the Windows and macOS SDKs on those hosts (CI's Windows/macOS Rust lanes have no Qt; they run the fixture contracts; follow-up #1878), Windows ARM64 and MinGW Qt, and distribution multiarch layouts as explicit prefixes (they stay on native pkg-config). Remaining #1332 parent work (full application graph, packaging, cache measurements, saved-profile runtime proof, CMake retirement) is untouched.