-
Notifications
You must be signed in to change notification settings - Fork 386
Fix ECC OpenSSL cmake check on Windows #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a Windows-only conditional in the OpenSSL CMake branch that derives the OpenSSL include path, optionally strips semicolon-delimited entries, computes a vcpkg triplet root, and appends a matching vcpkg Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8c73f6b to
0fb1fad
Compare
89b5add to
f815d20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cmake/modules/CompilerOptions.cmake (1)
300-304: Consider more idiomatic CMake list handling.The current approach works but could be simplified using native CMake list operations instead of string matching for semicolons.
Consider this alternative:
- set(_ossl_inc "${OPENSSL_INCLUDE_DIR}") - if(_ossl_inc) - if(_ossl_inc MATCHES ";") - list(GET OPENSSL_INCLUDE_DIR 0 _ossl_inc) - endif() + if(OPENSSL_INCLUDE_DIR) + list(LENGTH OPENSSL_INCLUDE_DIR _ossl_inc_len) + if(_ossl_inc_len GREATER 1) + list(GET OPENSSL_INCLUDE_DIR 0 _ossl_inc) + else() + set(_ossl_inc "${OPENSSL_INCLUDE_DIR}") + endif()This uses
list(LENGTH)which is more explicit about checking for multiple elements in a CMake list.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmake/modules/CompilerOptions.cmake(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: bukka
Repo: softhsm/SoftHSMv2 PR: 815
File: src/lib/SoftHSM.cpp:6543-6546
Timestamp: 2025-09-11T16:54:00.370Z
Learning: SoftHSM PR #815 (pkcs11.h 3.1.0 update, CK_RSA_AES_KEY_WRAP_PARAMS fix): Maintainer bukka prefers to keep scope minimal (header sync and param rename only); broader OAEP parameter enforcement or backend plumbing is out of scope for this PR and should be handled in a follow-up issue.
📚 Learning: 2025-08-18T17:54:37.645Z
Learnt from: antoinelochet
Repo: softhsm/SoftHSMv2 PR: 809
File: m4/acx_openssl_mldsa.m4:10-35
Timestamp: 2025-08-18T17:54:37.645Z
Learning: For OpenSSL feature detection in autoconf macros, prefer functional tests (like EVP_PKEY_CTX_new_from_name) over version number checks, as the functional approach directly tests the actual capability and is more reliable across different OpenSSL builds where features may be backported or disabled.
Applied to files:
cmake/modules/CompilerOptions.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Windows (x64, botan)
🔇 Additional comments (1)
cmake/modules/CompilerOptions.cmake (1)
299-312: The vcpkg directory structure assumption is correct and the fix is sound.vcpkg documentation confirms that OpenSSL runtime DLLs are placed in
<vcpkg-root>/installed/<triplet>/binfor dynamic Windows triplets (x64-windows, x86-windows, etc.). The code correctly extracts the parent directory ofOPENSSL_INCLUDE_DIRand appends/bin, which aligns with vcpkg's layout where include files are in<triplet>/includeand libraries/DLLs are in<triplet>/bin.The fix is safe for non-vcpkg Windows builds because the
if(EXISTS "${_vcpkg_bin}")check prevents PATH modification if the expected directory structure doesn't exist, which would be the case for custom or system OpenSSL installations.
It was incorrectly using wrong include dir for the check so this should fix it.
|
@jschlyter Somehow managed to get Windows (and everything else) green. Windows Botan is a bit slow but not sure how could this be impacted by this change that is just for OpenSSL. So it should be hopefully safe. |
There is currently failure in vcpkg build so this PR is an attempt to try to fix it.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.