Skip to content

refactor: rename dlpack-sys -> dlpack-rs-sys; bump 0.3.3 - #7

Closed
edgarriba wants to merge 11 commits into
mainfrom
rename/dlpack-rs-sys
Closed

edgarriba wants to merge 11 commits into
mainfrom
rename/dlpack-rs-sys

Conversation

@edgarriba

Copy link
Copy Markdown
Member

Unblocks publishing dlpack-rs to crates.io (needed so kornia-rs can depend on a versioned crate instead of a git tag).

Why: the crates.io name dlpack-sys is owned by an unrelated crate, so the sys crate can't publish under it. Rename to dlpack-rs-sys (free). dlpack-rs keeps its name (owned by us on crates.io).

Change: rename sys crate + dir, update the single consumer (src/ffi.rs), bump both to 0.3.3. No API change. Builds default + pyo3; ABI test passes.

After merge — publish (owner):

cargo publish -p dlpack-rs-sys
cargo publish -p dlpack-rs

🤖 Generated with Claude Code

edgarriba and others added 11 commits June 23, 2026 23:49
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rrect GIL SAFETY note

- Rename pyo3_glue::DLPackVersion -> DLPackVariant (all references updated) so that
  downstream crates glob-importing both modules don't see an ambiguous DLPackVersion.
  The C-ABI ffi::DLPackVersion {major, minor} is spec-mandated and unchanged.
- Fix backwards SAFETY comments in capsule_destructor_legacy/_versioned: Python calls
  these WITH the GIL already held; re-acquiring it would deadlock.
- Add doc note on data_ptr() that first element is at data_ptr() + byte_offset().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…afe/pyo3 on top

- Add Cargo workspace with dlpack-sys sub-crate
- dlpack-sys: bindgen generates FFI types from vendor/dlpack/dlpack.h using ModuleConsts enum style
- Replace hand-written src/ffi.rs with `pub use dlpack_sys::*;` re-export
- Adapt src/safe.rs to use DLDeviceType::kDLCPU/kDLCUDA and DLDataTypeCode::kDL* constants (cast to u8)
- Bump version to 0.3.0 in both crates
- CI: add libclang-dev install step to all jobs
- Disable doctests in dlpack-sys (bindgen doc comments contain C++ code blocks)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add stable public const aliases in src/ffi.rs that map to bindgen values
with the correct struct field types, so consumers like kornia-py can use
K_DL_CPU (u32), K_DL_UINT/FLOAT/INT/BOOL (u8), and
DLPACK_FLAG_BITMASK_READ_ONLY/IS_COPIED (u64) without depending on
bindgen-generated names (DLDeviceType::kDLCPU, etc.).
…nd feature (no libclang for default build/release)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…GIL drop); v0.3.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The crates.io name `dlpack-sys` is owned by an unrelated crate (ehsanmok),
so the sys crate can't be published under it — which blocks publishing
`dlpack-rs` (and therefore any downstream crate, e.g. kornia-tensor, that
must resolve a versioned dep instead of a git dep).

Rename the sys crate to `dlpack-rs-sys` (free on crates.io; owned once
published) so `dlpack-rs` — already owned by us on crates.io — can ship with
a real version dependency. `dlpack-rs` keeps its name. Only src/ffi.rs
referenced the sys crate (path `dlpack_sys::` -> `dlpack_rs_sys::`).

Both crates bumped 0.3.2 -> 0.3.3. No API change. Builds default + pyo3;
ABI layout test passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edgarriba

Copy link
Copy Markdown
Member Author

Superseded by the inline approach (#8) — no sys crate to publish.

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.

1 participant