Skip to content
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

Go/Core Refactor: Move FFI to a Dedicated Folder for Reusability #3372

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

barshaul
Copy link
Collaborator

@barshaul barshaul commented Mar 16, 2025

This PR relocates the FFI interface from the Go folder to a dedicated ffi folder, making it reusable for other language wrappers.

Currently, the FFI C-Rust implementation is located under the Go folder since it has only been used for Go. However, as we expand support for additional wrappers, such as the C# and Python Sync clients, which will communicate via FFI instead of UDS, we need to move the logic out of the Go folder to improve reusability and maintainability.

Issue link

This Pull Request is linked to issue (URL): #3373

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Sorry, something went wrong.

@barshaul barshaul force-pushed the ffi_ipc branch 2 times, most recently from 7c71bda to 45daae4 Compare March 16, 2025 16:05
@barshaul barshaul changed the title Go/Core Refactore: Move FFI to a dedicated folder to be reusable for other wrappers Go/Core Refactor: Move FFI to a Dedicated Folder for Reusability Mar 16, 2025
@barshaul barshaul marked this pull request as ready for review March 17, 2025 12:44
@barshaul barshaul requested a review from a team as a code owner March 17, 2025 12:44
ffi/.gitignore Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesx-improving please verify go CD pipeline that it still commit header file

ffi/src/lib.rs Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lib actively uses protobuf, while C# client - doesn't.
So I see two variants there

  1. We will be having 2 FFI interfaces
  2. Rework golang bindings to avoid using protobuf

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up some code comments which refer to golang

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If 2 isn't possible, put protobuf functions under a feature flag. Please do it in the C# implementation.

working-directory: ffi
run: |
cargo build --release
- name: Generate the C header file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed for go client only and does not test the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it isn't go-specific, it can be used in other FFI wrappers as well (C++ for example)

Signed-off-by: barshaul <[email protected]>
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.

None yet

3 participants