Repository navigation
refactor: inline dlpack-sys into dlpack-rs (single publishable crate, 0.3.3) - #8
Merged
Merged
Conversation
Fold the `dlpack-sys` crate (bindgen bindings + vendored dlpack.h + build.rs)
into `dlpack-rs` as a private `sys` module. DLPack is header-only (the FFI is
pure structs/consts + fn-pointer types, no native linkage), so no `links`/
sys crate is needed.
Motivation: publishing `dlpack-rs` to crates.io required its `dlpack-sys`
path dep to be a published, versioned crate — but the `dlpack-sys` name is
owned by an unrelated crate. Inlining removes the dependency entirely, so
`dlpack-rs` (which we own on crates.io) publishes as a single self-contained
crate. `cargo publish --dry-run` passes.
- src/sys.rs: `include!("bindings.rs")` + ABI layout test (was dlpack-sys/lib.rs)
- src/ffi.rs: re-export `crate::sys::*` instead of the `dlpack_sys` crate
- build.rs + vendor/ + bindings.rs moved to crate root; `bindgen` opt-in feature
- [lib] doctest = false (bindgen C doc comments carry fenced blocks)
- delete dlpack-sys/; bump 0.3.2 -> 0.3.3. No public API change.
Builds default + pyo3; tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… workflow - regenerate-check: cargo build --features bindgen (was -p dlpack-sys); diff src/bindings.rs (was dlpack-sys/src/bindings.rs) after the inline. - add release.yml: workflow_dispatch, guarded by typing 'publish', runs cargo publish for dlpack-rs using the repo's CARGO_REGISTRY_TOKEN secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #7. No sys crate to publish — fold
dlpack-sysintodlpack-rsas a privatesysmodule.Why: publishing
dlpack-rsto crates.io needs itsdlpack-syspath dep to be a published versioned crate, but thedlpack-sysname is squatted. DLPack is header-only (structs/consts + fn-pointer types, zero native linkage), so the sys split buys nothing — inline it anddlpack-rs(which we own on crates.io) publishes as one self-contained crate.src/sys.rs:include!("bindings.rs")+ ABI test;src/ffi.rsre-exportscrate::sys::*build.rs+vendor/+bindings.rsat crate root;bindgenstays an opt-in feature (default uses committed bindings, no libclang)[lib] doctest = false; deletedlpack-sys/; bump 0.3.2 → 0.3.3; no public API changeVerified: builds default +
pyo3, tests pass,cargo publish --dry-runsucceeds (19 files, single crate).After merge — one publish (owner):
🤖 Generated with Claude Code