Skip to content

Fix macOS build by gating io_uring to Linux and adding platform fallbacks#779

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-benchmarks-on-mac
Draft

Fix macOS build by gating io_uring to Linux and adding platform fallbacks#779
Copilot wants to merge 3 commits intomainfrom
copilot/fix-benchmarks-on-mac

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

io_uring is Linux-specific but was compiled on all non-Windows platforms via cfg(not(windows)), breaking macOS builds.

Changes

Platform detection

  • diskann-platform/src/lib.rs: Replace cfg(not(windows)) with cfg(target_os = "linux")
  • diskann-platform/src/linux/ssd_io_context.rs: Gate IOContext and io_uring imports behind cfg(target_os = "linux")

Disk I/O fallback

  • diskann-disk/src/utils/aligned_file_reader/aligned_file_reader_factory.rs: Use StorageProviderAlignedFileReader for macOS (pure Rust, no OS-specific APIs)

CI coverage

  • .github/workflows/ci.yml: Add macos-latest to test matrices + dedicated test-benchmark-macos job
// Before: macOS incorrectly treated as Linux
#[cfg(not(windows))]
pub mod linux;

// After: explicit OS targeting
#[cfg(target_os = "linux")]
pub mod linux;

macOS now uses the portable StorageProviderAlignedFileReader instead of Linux-specific io_uring-based I/O.

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] benchmarks don't run on mac</issue_title>
<issue_description>## Expected Behavior
The following cmd should run on out of the box on mac

cargo run --release --package diskann-benchmark -- run --input-file ./diskann-benchmark/example/async.json --output-file output.json 

Actual Behavior

It looked for io_uring and failed

Example Code

Please see How to create a Minimal, Reproducible example for some guidance on creating the best possible example of the problem

Dataset Description

Please tell us about the shape and datatype of your data, (e.g. 128 dimensions, 12.3 billion points, floats)

  • Dimensions:
  • Number of Points:
  • Data type:

Error

   Compiling diskann-benchmark-core v0.46.0 (/Users/harsha/repos/DiskANN/diskann-benchmark-core)
error[E0432]: unresolved import `io_uring`
 --> diskann-platform/src/linux/ssd_io_context.rs:8:5
  |
8 | use io_uring::IoUring;
  |     ^^^^^^^^ use of unresolved module or unlinked crate `io_uring`
  |
  = help: if you wanted to use a crate named `io_uring`, use `cargo add io_uring` to add it to your `Cargo.toml`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `diskann-platform` (lib) due to 1 previous error

Your Environment

  • Operating system (macOS Tahoe 26.1)
  • DiskANN version (0.46.0)

</issue_description>

Comments on the Issue (you are @copilot in this section)


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

Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix benchmarks not running on Mac Fix macOS compilation by properly gating io_uring to Linux Feb 16, 2026
Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
Copilot AI changed the title Fix macOS compilation by properly gating io_uring to Linux Fix macOS build by gating io_uring to Linux only Feb 16, 2026
Copilot AI changed the title Fix macOS build by gating io_uring to Linux only Fix macOS build by gating io_uring to Linux and adding platform fallbacks Feb 16, 2026
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.

[BUG] benchmarks don't run on mac

2 participants