Skip to content

feat: vendor dlpack as dmlc/dlpack submodule; regenerate bindings; 0.3.4 - #9

Merged
edgarriba merged 1 commit into
mainfrom
feat/dlpack-submodule
Jul 6, 2026
Merged

edgarriba merged 1 commit into
mainfrom
feat/dlpack-submodule

Conversation

@edgarriba

Copy link
Copy Markdown
Member

Makes vendor/dlpack a submodule of dmlc/dlpack and drives src/bindings.rs from it — while staying crates.io-publishable (no libclang for consumers).

Pinned: submodule at commit 77aafa4d (dmlc/dlpack main; the kDLTPU/kDLTPUHost commit). Regenerated bindings are byte-identical to the committed bindings.rs → zero functional change.

Design (keeps it publishable):

  • bindings.rs stays committed (default build needs no libclang); the bindgen feature regenerates it from the submodule, enforced by the regenerate-check CI job (now checks out submodules).
  • Cargo.toml include whitelist ships only crate sources + dlpack.h (+ LICENSEs), not dmlc's docs/tests. Header is shipped so the bindgen feature also works from a crates.io checkout.

Verified: builds default/pyo3/bindgen, tests, clippy, fmt, cargo publish --dry-run (12 crate files).

Bump 0.3.3 → 0.3.4. After merge: dispatch release.yml to publish. (Note: 0.3.3 stays the version kornia-rs's in-flight rc.2 depends on; identical bindings, so no rush to re-pin.)

🤖 Generated with Claude Code

Replace the copied `vendor/dlpack/dlpack.h` with a git submodule of
https://github.com/dmlc/dlpack, pinned to commit 77aafa4d (main; adds
kDLTPU/kDLTPUHost). `src/bindings.rs` regenerated from the submodule is
byte-identical to the committed file — no functional change.

- vendor/dlpack: vendored header -> dmlc/dlpack submodule (+ .gitmodules)
- build.rs: header path -> vendor/dlpack/include/dlpack/dlpack.h
- Cargo.toml: `include` whitelist so the published crate ships only the crate
  sources + the header (+ LICENSEs), not dmlc's docs/tests/apps. The header
  is shipped so the opt-in `bindgen` feature also works from a crates.io
  checkout. Default builds still use the committed bindings (no libclang).
- ci.yml regenerate-check: checkout with submodules: recursive.
- bump 0.3.3 -> 0.3.4.

Verified: default build + tests, `--features pyo3`, `--features bindgen`
regenerates identical bindings, clippy, and `cargo publish --dry-run`
(12 crate files, header present).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edgarriba
edgarriba merged commit 4ceb9f9 into main Jul 6, 2026
14 checks passed
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