Skip to content

Fix Windows CI: PowerShell quoting and CURL fallback - #10

Merged
makr-code merged 3 commits into
mainfrom
copilot/fix-ci-configure-errors
Nov 10, 2025
Merged

makr-code merged 3 commits into
mainfrom
copilot/fix-ci-configure-errors

Conversation

Copilot AI commented Nov 10, 2025 •

Copy link
Copy Markdown
Contributor

Windows CI failed during CMake configure due to PowerShell misinterpreting the -DCMAKE_TOOLCHAIN_FILE argument and find_package(CURL CONFIG REQUIRED) failing when no config-mode package exists.

Changes

CMakeLists.txt

  • Replace unconditional config-mode CURL lookup with fallback chain:
    find_package(CURL CONFIG QUIET)
    if(NOT CURL_FOUND)
        find_package(CURL REQUIRED)  # Module mode
    endif()
  • Create CURL::libcurl imported target when module-mode provides only variables:
    if(CURL_FOUND AND NOT TARGET CURL::libcurl AND DEFINED CURL_LIBRARIES)
        add_library(CURL::libcurl UNKNOWN IMPORTED)
        set_target_properties(CURL::libcurl PROPERTIES
            IMPORTED_LOCATION "${CURL_LIBRARIES}"
            INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
        )
    endif()

.github/workflows/fast-smoke.yml

  • Fix PowerShell parsing of CMAKE_TOOLCHAIN_FILE:
    $toolchain = "$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake"
    cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
      -DCMAKE_TOOLCHAIN_FILE="$toolchain" `
      -DCMAKE_BUILD_TYPE=Release
  • Changed line continuation to backtick (PowerShell syntax vs bash backslash)
  • Quoted variable to prevent token splitting

Ref: dc610f4

Original prompt

Problem: The Windows CI job failed during CMake configure because find_package(CURL CONFIG REQUIRED) failed and PowerShell mis-parsed the -DCMAKE_TOOLCHAIN_FILE argument (error: "The term '-DCMAKE_TOOLCHAIN_FILE=$env:' is not recognized..."). We need a small, targeted fix to make CI resilient and ensure the toolchain file is passed correctly in the Windows workflow.

Changes to implement (2 files):

  1. CMakeLists.txt (ref: dc610f4)
  • Replace the line that unconditionally calls find_package(CURL CONFIG REQUIRED) with a defensive fallback that first attempts config-mode quietly, and if that fails falls back to module mode. Also add a short compatibility snippet that creates an imported target CURL::libcurl when only module-mode variables are available so the rest of the CMake (which expects CURL::libcurl) continues to work.

Patch to apply (replace the existing find_package call around line 20):

Prefer config-mode (vcpkg/system packages that export a CURLConfig.cmake), but fall back to module mode

find_package(CURL CONFIG QUIET)
if(NOT CURL_FOUND)
# Module mode provides CURL_FOUND, CURL_LIBRARIES, CURL_INCLUDE_DIRS
find_package(CURL REQUIRED)
endif()

Provide a consistent target name expected elsewhere in the project

if(CURL_FOUND AND NOT TARGET CURL::libcurl AND DEFINED CURL_LIBRARIES)
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LOCATION "${CURL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
)
endif()

Rationale: Some vcpkg/system installations do not provide a config-file package for CURL but CMake's built-in FindCURL can still locate the library. Creating an imported target ensures later target-based linking (CURL::libcurl) works regardless of how curl was found.

  1. .github/workflows/fast-smoke.yml (ref: dc610f4)
  • Fix the Configure (VS 2022 + vcpkg) step which runs in pwsh. The current command in the workflow uses an inline $env:GITHUB_WORKSPACE path inside an unquoted cmake argument which PowerShell can misinterpret across backslashes. Replace the run step with a pwsh-safe version that constructs a quoted variable for the toolchain path and passes it to cmake.

Replace the existing step:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
-DCMAKE_TOOLCHAIN_FILE=$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake
-DCMAKE_BUILD_TYPE=Release

With this pwsh-friendly block:
$toolchain = "$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake"
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE="$toolchain"
-DCMAKE_BUILD_TYPE=Release

Rationale: Using a PowerShell variable and quoting it avoids parsing issues where PowerShell attempts to treat parts of the argument as its own tokens (resulting in the '-DCMAKE_TOOLCHAIN_FILE=$env:' message), and keeps the command readable.

Optional recommendation (not required for the PR): ensure curl is present in vcpkg manifest or explicitly install the vcpkg manifest deps in the Windows job. If needed later, we can add a step to run & $env:GITHUB_WORKSPACE\vcpkg\vcpkg.exe install --triplet x64-windows after bootstrapping vcpkg.

Please create a branch, apply the two edits, and open a pull request against main. Commit messages should be:

  • "ci: fix Windows workflow quoting for vcpkg toolchain"
  • "cmake: fallback to module FindCURL and provide CURL::libcurl imported target"

Please include links to the changed files using the provided ref: use ref dc610f4 when referencing existing content.

This pull request was created as a result of the following prompt from Copilot chat.

Problem: The Windows CI job failed during CMake configure because find_package(CURL CONFIG REQUIRED) failed and PowerShell mis-parsed the -DCMAKE_TOOLCHAIN_FILE argument (error: "The term '-DCMAKE_TOOLCHAIN_FILE=$env:' is not recognized..."). We need a small, targeted fix to make CI resilient and ensure the toolchain file is passed correctly in the Windows workflow.

Changes to implement (2 files):

  1. CMakeLists.txt (ref: dc610f4)
  • Replace the line that unconditionally calls find_package(CURL CONFIG REQUIRED) with a defensive fallback that first attempts config-mode quietly, and if that fails falls back to module mode. Also add a short compatibility snippet that creates an imported target CURL::libcurl when only module-mode variables are available so the rest of the CMake (which expects CURL::libcurl) continues to work.

Patch to apply (replace the existing find_package call around line 20):

Prefer config-mode (vcpkg/system packages that export a CURLConfig.cmake), but fall back to module mode

find_package(CURL CONFIG QUIET)
if(NOT CURL_FOUND)
# Module mode provides CURL_FOUND, CURL_LIBRARIES, CURL_INCLUDE_DIRS
find_package(CURL REQUIRED)
endif()

Provide a consistent target name expected elsewhere in the project

if(CURL_FOUND AND NOT TARGET CURL::libcurl AND DEFINED CURL_LIBRARIES)
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LOCATION "${CURL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
)
endif()

Rationale: Some vcpkg/system installations do not provide a config-file package for CURL but CMake's built-in FindCURL can still locate the library. Creating an imported target ensures later target-based linking (CURL::libcurl) works regardless of how curl was found.

  1. .github/workflows/fast-smoke.yml (ref: dc610f4)
  • Fix the Configure (VS 2022 + vcpkg) step which runs in pwsh. The current command in the workflow uses an inline $env:GITHUB_WORKSPACE path inside an unquoted cmake argument which PowerShell can misinterpret across backslashes. Replace the run step with a pwsh-safe version that constructs a quoted variable for the toolchain path and passes it to cmake.

Replace the existing step:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
-DCMAKE_TOOLCHAIN_FILE=$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake
-DCMAKE_BUILD_TYPE=Release

With this pwsh-friendly block:
$toolchain = "$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake"
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE="$toolchain"
-DCMAKE_BUILD_TYPE=Release

Rationale: Using a PowerShell variable and quoting it avoids parsing issues where PowerShell attempts to treat parts of the argument as its own tokens (resulting in the '-DCMAKE_TOOLCHAIN_FILE=$env:' message), and keeps the command readable.

Optional recommendation (not required for the PR): ensure curl is present in vcpkg manifest or explicitly install the vcpkg manifest deps in the Windows job. If needed later, we can add a step to run & $env:GITHUB_WORKSPACE\vcpkg\vcpkg.exe install --triplet x64-windows after bootstrapping vcpkg.

Please create a branch, apply the two edits, and open a pull request against main. Commit messages should be:

  • "ci: fix Windows workflow quoting for vcpkg toolchain"
  • "cmake: fallback to module FindCURL and provide CURL::libcurl imported target"

Please include links to the changed files using the provided ref: use ref dc610f4 when referencing existing content.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix CMake configuration errors in Windows CI job Fix Windows CI: PowerShell quoting and CURL fallback Nov 10, 2025
Copilot AI requested a review from makr-code November 10, 2025 13:07
@makr-code
makr-code marked this pull request as ready for review November 10, 2025 13:21
@makr-code
makr-code merged commit d7c9fb4 into main Nov 10, 2025
@makr-code
makr-code deleted the copilot/fix-ci-configure-errors branch November 30, 2025 11:50
makr-code added a commit that referenced this pull request Dec 6, 2025
Fix Windows CI: PowerShell quoting and CURL fallback
Copilot AI added a commit that referenced this pull request Jan 3, 2026
Issue #9 - Configuration error logging:
- Add specific exception catching for YAML and JSON parsing errors
- Log detailed error messages with exception details
- Add file open failure logging
- Better debugging for configuration issues

Issue #10 - Defensive nullptr checks:
- Add null check after transaction creation in TransactionManager
- Throw exception if MVCC transaction creation fails
- Existing code already has good checks for GetBaseDB(), weak_ptr::lock()

Issue #11 - Static cast usage:
- Documented in new coding standards
- Added guidelines for safe type conversions
- Existing casts are safe (size comparisons, dimension checks)

Issue #12 - Code style consistency:
- Created comprehensive CODING_STANDARDS.md
- Defined logging level usage (ERROR, WARN, INFO, DEBUG)
- Memory management guidelines (RAII, smart pointers)
- Thread safety patterns (atomics, mutexes)
- Signal handler safety requirements
- Error handling best practices

Co-authored-by: makr-code <[email protected]>
Copilot AI added a commit that referenced this pull request Jan 11, 2026
makr-code added a commit that referenced this pull request Jan 11, 2026
…icies, and gap issue templates (Phase 1-2 Complete) (#351)

* Initial plan

* Add documentation TODO verification tools and framework

Co-authored-by: makr-code <[email protected]>

* Add Phase 1 final report with comprehensive analysis results

Co-authored-by: makr-code <[email protected]>

* Add quick reference card for verification tools

Co-authored-by: makr-code <[email protected]>

* Add Phase 2 progress report with manual verification of priority items

Co-authored-by: makr-code <[email protected]>

* Create security policy documents (encryption strategy, ISP, key management)

Co-authored-by: makr-code <[email protected]>

* Add documentation update task issue template (009)

Co-authored-by: makr-code <[email protected]>

* Add Phase 2 completion summary - milestone achieved, ready for Phase 3

Co-authored-by: makr-code <[email protected]>

* Add GitHub issue templates for identified gaps (Issues #10-13)

Co-authored-by: makr-code <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: makr-code <[email protected]>
@makr-code makr-code added this to the Phase 3: Integration & Testing milestone Feb 21, 2026
@makr-code makr-code added this to the v1.0.2 milestone Mar 11, 2026
@makr-code makr-code mentioned this pull request Mar 12, 2026
5 tasks
Copilot AI added a commit that referenced this pull request Mar 12, 2026
- Add include/auth/secure_memory.h with SecureString and SecureBuffer<T>:
  * mlock()/VirtualLock() per allocation to prevent OS paging to disk
  * OPENSSL_cleanse() on destruction to zero memory before free
  * Copyable with fresh locked allocation per copy
  * No implicit conversion to std::string/vector (prevents serialization leaks)

- Replace std::string client_key_password with SecureString in JWKSSecurityConfig::Config
- Add explicit OPENSSL_cleanse in JWKSSecureFetcher::Impl destructor

- Replace std::vector<uint8_t> master_key with SecureBuffer<uint8_t> in TOTPSecretEncryption::Config
- Change deriveKey() to return SecureBuffer<uint8_t> (auto-zeroed on scope exit)
- Change rotateKey() to accept const SecureBuffer<uint8_t>&
- Add explicit OPENSSL_cleanse in TOTPSecretEncryption::Impl destructor

- Add JWTKeyRotationManager::~JWTKeyRotationManager() that zeroes kid strings
  via OPENSSL_cleanse before map destruction

Closes: #10 (Secure Memory for Key Material in jwks_security.cpp)

Co-authored-by: makr-code <[email protected]>
makr-code added a commit that referenced this pull request Mar 12, 2026
…erial

feat(auth): Secure memory for key material — v1.2.0 (#10)
makr-code added a commit that referenced this pull request Apr 15, 2026
…ktivieren (§1.4 Maßnahme #10) (#4653)

* Initial plan

* feat(benchmarks): Nightly-Presets für Benchmark-Sweeps Module 2..33 aktivieren (Maßnahme #10)

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/9c2ba072-9ecf-447c-9b8f-33a3832551e2

Co-authored-by: makr-code <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: makr-code <[email protected]>
Copilot AI added a commit that referenced this pull request Jun 3, 2026
… data race fixed, 149 false positives validated
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.

2 participants