← Back to Pull requests

fix(cmake): export external flatcc runtime dependencies #963

Open
bmehta001 opened this pull request with 278 lines diff across 5 files
View on GitHub
bmehta001 bmehta001 commented on Oct 15, 2026 17:57 UTC
Author

Problem

With NANOARROW_IPC=ON and an external flatcc runtime, the exported static IPC target contains $<LINK_ONLY:flatccrt>, but the package does not define that target for its consumers. Standalone consumers therefore depend on incidental caller-defined targets or linker search paths. This affects build-tree exports as well as installed packages.

The vcpkg port currently compensates on Windows by replacing this dependency with a Release-only library path; Unix consumers are left with the bare library name. A source-level fix lets package maintainers remove that workaround when updating nanoarrow.

Related to #922. This addresses exported dependency metadata, separately from #949's build-time static/shared runtime discovery.

Changes

  • Give external runtime targets the actual name nanoarrow::flatccrt, rather than an alias of an unqualified imported target. CMake resolves imported aliases back to the underlying name when exporting them.

  • Preserve the existing vendored runtime export by adding its corresponding build-tree alias, and consistently use the namespaced target in IPC libraries and tests.

  • Resolve external Release/Debug runtime libraries during package discovery, using the package prefix, configured external locations, and consumer prefix paths. Report a normal package-not-found result when the runtime is unavailable.

  • Add a dependency-free regression driver and Windows/Linux/macOS CI coverage. It builds a real flatcc runtime from the existing vendored sources, then compiles and runs actual package consumers.

  • Document installed-package consumption and explicit runtime overrides.
  • Validation

    Windows (Visual Studio 2026 / MSVC 19.51) and Linux (WSL / GCC 13.3):

  • 24 IPC consumer executions passed per platform: external root, separate include/library directories, and vendored runtime; Debug and Release; build-tree and relocated installed packages; caller-defined flatccrt declared both before and after package discovery.

  • All three Debug build modes also passed with nanoarrow's default extra warnings enabled.

  • Additional Debug/Release consumers passed with flatcc in a separate relocated prefix. Assertions checked the selected configuration-specific runtime path.

  • Missing-runtime package discovery returned the expected failure, including with find_package(... QUIET).

  • Core-only Debug/Release consumers passed without creating or requiring a flatcc target.

  • The same regression driver on unmodified upstream failed with flatccrt-NOTFOUND, demonstrating that the test detects the original export defect.
  • Regression entry point, from the repository root:

    python ci/scripts/test_cmake_package.py --build-dir build/package-tests
    

    On Windows the local run explicitly selected CMAKE_GENERATOR=Visual Studio 18 2026.

    CMake formatting (0.6.13), Black (22.3.0), Flake8 (7.1.1), isort (5.12.0), codespell, workflow YAML parsing, and git diff --check passed. No runtime tests in these selections were skipped or excluded. Native macOS was not available locally; the added CI job covers it.

    AI assistance: GitHub Copilot assisted with implementation and regression coverage.

    Diff: 278 lines (+269 / -9) across 5 files Reviewer: None requested Review duration: 69951m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 278 lines diff across 5 files
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.45 · 1 substantive comment(s)
    0.45
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    59%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.337
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    2 items
    codecov-commenter codecov-commenter commented on Oct 15, 2026 19:00 UTC
    Contributor

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 78.24%. Comparing base (ea215b0) to head (b84a944).

    <details><summary>Additional details and impacted files</summary>

    @@           Coverage Diff           @@
    ##             main     #963   +/-   ##
    =======================================
      Coverage   78.24%   78.24%           
    =======================================
      Files         106      106           
      Lines       16867    16867           
      Branches     1993     1993           
    =======================================
      Hits        13198    13198           
      Misses       2437     2437           
      Partials     1232     1232           
    

    </details>

    :umbrella: View full report in Codecov by Harness.
    :loudspeaker: Have feedback on the report? Share it here.
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    Reviewers
    None requested
    Assignees
    bmehta001 bmehta001
    Labels
    risk: low confidence: 59.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 61.5% (MEDIUM) · Higher = larger blast radius
    61.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 59.6% · Lower = rushed or shallow review
    59.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.9% · Safe to merge
    24.9%