Skip to content

Conversation

@ryanolson
Copy link
Contributor

  • Use built-in compiler types in wrapper.h instead of system headers (stdbool.h, stddef.h, stdint.h) to fix bindgen failures on systems where libclang cannot locate standard headers

  • Add check_nixl_available() to detect if NIXL library is installed by checking pkg-config and common library paths for libnixl.so

  • Fallback to stub API when NIXL is not found, with clear warning: "NIXL library not found, building with stub API"

This allows the Rust bindings to build successfully on systems without NIXL installed, enabling development and testing of Rust code that depends on nixl-sys without requiring the full NIXL installation.

- Use built-in compiler types in wrapper.h instead of system headers
  (stdbool.h, stddef.h, stdint.h) to fix bindgen failures on systems
  where libclang cannot locate standard headers

- Add check_nixl_available() to detect if NIXL library is installed
  by checking pkg-config and common library paths for libnixl.so

- Fallback to stub API when NIXL is not found, with clear warning:
  "NIXL library not found, building with stub API"

This allows the Rust bindings to build successfully on systems without
NIXL installed, enabling development and testing of Rust code that
depends on nixl-sys without requiring the full NIXL installation.

Signed-off-by: Ryan Olson <[email protected]>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 12, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@roiedanino
Copy link
Contributor

/build

let arch = get_arch();

// Check various possible library locations
let possible_paths = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the check for availability use the same set of paths that would be sent to the linker? We're missing 2 of the 5 right now. And maybe use the same function for both so they are always aligned

    // Add all possible library paths
    println!("cargo:rustc-link-search=native={}", nixl_lib_path);
    println!("cargo:rustc-link-search=native={}", nixl_root_path);
    println!("cargo:rustc-link-search=native={}/lib", nixl_root_path);
    println!("cargo:rustc-link-search=native={}/lib64", nixl_root_path);
    println!("cargo:rustc-link-search=native={}/lib/x86_64-linux-gnu", nixl_root_path);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants