Conversation
Windows dependency packages put import libraries in lib and runtime DLLs in bin. Some CMake consumers treated runtime DLLs as linker inputs or failed to search sibling bin directories when collecting runtime dependencies. This caused Rust tests to request libcurl.lib instead of libcurl_imp.lib and rejected otherwise valid shared installations. Use TARGET_LINKER_FILE for Rust linker inputs, model dynamic libcheck with separate IMPORTED_IMPLIB and IMPORTED_LOCATION properties, and search sibling bin directories when collecting runtime DLLs. Keep PCRE2 in module mode, derive package architectures for non-Visual Studio generators, and rerun Rust builds when library variables change. Clean x64 and ARM64 Windows builds completed successfully. The x64 build completed all 394 targets and all six CTest groups. It then generated ZIP and MSI packages. The ARM64 build produced an AA64 clamscan.exe and generated ZIP and MSI packages. CLAM-3051
val-ms
force-pushed
the
cmake-fixups
branch
from
September 10, 2026 01:04
fc253e1 to
4ac180f
Compare
val-ms
marked this pull request as ready for review
September 10, 2026 01:05
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
.liband.dlllocationsbindirectories when collecting runtime DLLsProblem
Windows dependency packages conventionally install import libraries under
liband runtime DLLs underbin. Some of ClamAV's CMake wiring usedTARGET_FILEwhere a linker input was required and searched only one side of that layout while collecting runtime dependencies.With Curl's exported shared target,
TARGET_FILEsuppliedbin/libcurl.dlltolibclamav_rust/build.rs. The build script converted that filename into a request forlibcurl.lib, but the actual import library islib/libcurl_imp.lib. The resulting Rust test link failed withLNK1181.Dynamic libcheck installations had a related issue: the existing fallback target represented
checkDynamic.libas an unknown imported target and did not model or validate the corresponding runtime DLL.Solution
Use
TARGET_LINKER_FILEfor the dependency paths passed to Rust. Represent a manually discovered dynamic libcheck target asSHARED IMPORTED, withIMPORTED_IMPLIBpointing to the.libfile andIMPORTED_LOCATIONpointing to the DLL. Runtime dependency collection now checks both target runtime directories and the siblingbindirectories derived from linker-file locations.The patch also keeps PCRE2 in module mode alongside LibXml2, supplies a package-architecture fallback for generators that do not define
CMAKE_VS_PLATFORM_NAME, and declares the Rust build script's library environment dependencies.Validation
git diff --checkpassesbinlib/checkDynamic.libandbin/checkDynamic.dllseparatelyclamscan.exereports machine typeAA64ARM64 tests were compiled but not executed because validation ran on an x64 Windows host.
CLAM-3051