Skip to content

fix: pass correct args to FFI function in haskell - #1135

Merged
Datron merged 1 commit into
mainfrom
fix-legacy-haskell-client
Aug 24, 2026
Merged

fix: pass correct args to FFI function in haskell#1135
Datron merged 1 commit into
mainfrom
fix-legacy-haskell-client

Conversation

@Datron

@Datron Datron commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

wrong order of args are passed to the FFI function

#[no_mangle]
pub extern "C" fn cac_get_resolved_config(
    client: *mut Arc<Client>,
    query: *const c_char,
    filter_keys: *const c_char,
    filter_exclude_prefix: *const c_char,
    merge_strategy: *const c_char,
) -> *const c_char {

But we were sending

c_cac_get_resolved_config clientPtr cContext cStrKeys cMergeStrat cExcludePrefix

leading to a NULL string error if excludePrefix was None

Solution

Reorder args to the FFI function cac_get_resolved_config

Summary by CodeRabbit

  • Bug Fixes
    • Corrected configuration resolution behavior for Haskell clients by ensuring exclusion settings and merge strategy are passed in the proper order.

Signed-off-by: datron <Datron@users.noreply.github.com>
@Datron
Datron requested a review from a team as a code owner August 24, 2026 08:41
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af78d0a7-7919-43cb-b5a0-01740ce14d49

📥 Commits

Reviewing files that changed from the base of the PR and between 6785947 and c8369c8.

📒 Files selected for processing (1)
  • clients/haskell/hs-cac-client/src/Client.hs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The Haskell client now passes the exclusion-prefix pointer before the merge-strategy pointer when it calls the foreign c_cac_get_resolved_config function.

Changes

Haskell client FFI correction

Layer / File(s) Summary
Correct configuration call arguments
clients/haskell/hs-cac-client/src/Client.hs
The foreign function call now passes cExcludePrefix before cMergeStrat.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to c8369

This change corrects the argument order passed to the Haskell FFI function, preventing incorrect handling of the exclude-prefix value. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: avi892nash, ayushjain17

Poem

A rabbit checks the pointer trail,
With carrots packed in a neat array.
Exclusion leads, strategy follows,
The foreign call now clearly knows.
Hop, hop—arguments align!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Haskell FFI argument-order fix, which is the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-legacy-haskell-client

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Datron
Datron added this pull request to the merge queue Aug 24, 2026
Merged via the queue into main with commit cba23b6 Aug 24, 2026
27 of 30 checks passed
@Datron
Datron deleted the fix-legacy-haskell-client branch August 24, 2026 09:15
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.

3 participants