Skip to content

fix(tensorrt): fail fast when tensorrt-link is enabled until shim lands#7

Merged
cognect merged 3 commits into
mainfrom
fix/tensorrt-link-dead-guard
May 9, 2026
Merged

fix(tensorrt): fail fast when tensorrt-link is enabled until shim lands#7
cognect merged 3 commits into
mainfrom
fix/tensorrt-link-dead-guard

Conversation

@cognect

@cognect cognect commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The tensorrt-link feature on atomr-accel-tensorrt (and its atomr-accel-py passthrough) emits link directives for atomr_trt_* C-ABI shim symbols declared in crates/atomr-accel-tensorrt/src/sys.rs:170-277, but the C++ source defining them (nvinfer_shim.cpp) has not been committed. Enabling the feature today produces an opaque undefined reference linker error and there is no workaround a consumer can apply (see tensorrt-link feature emits link directives for symbols that have no source file #6).
  • This PR converts that silent breakage into a clear compile_error! in crates/atomr-accel-tensorrt/src/lib.rs pointing at tensorrt-link feature emits link directives for symbols that have no source file #6, short-circuits crates/atomr-accel-tensorrt/build.rs so users with the feature on but no libnvinfer don't see the now-misleading set LIBNVINFER_PATH panic, and annotates the Cargo manifests + user-facing docs (features-matrix, gpu-testing, SKILL) so downstream readers understand the disabled state.
  • Scope is intentionally minimal: the feature stays in the manifest, all #[cfg(feature = "tensorrt-link")] call sites in actor.rs / engine.rs / runtime.rs / onnx.rs / plugin.rs are untouched, and the build.rs probe helpers are kept under #[allow(dead_code)]. Re-enabling the link path in the shim PR is removing the compile_error! and the no-op short-circuit in build.rs.

Refs #6 — keep open so the issue closes when the shim itself lands, not when this guard merges.

Test plan

  • cargo check -p atomr-accel-tensorrt (default features) — passes
  • cargo check -p atomr-accel-tensorrt --features tensorrt-link — fails with the new compile_error! referencing tensorrt-link feature emits link directives for symbols that have no source file #6
  • cargo check -p atomr-accel-py --features tensorrt-link — same compile_error! propagates through the passthrough
  • cargo check --workspace — green
  • cargo test -p atomr-accel-tensorrt --lib — all 10 unit tests pass

🤖 Generated with Claude Code

cognect and others added 3 commits May 9, 2026 09:23
The `tensorrt-link` feature emits link directives for the `atomr_trt_*`
C-ABI shim symbols declared in `sys.rs`, but the C++ source defining
them (`nvinfer_shim.cpp`) has not been committed. Any consumer enabling
the feature today hit an opaque "undefined reference" linker error
against libnvinfer with no actionable signal.

Until the shim lands (tracked in #6), gate the feature with a
`compile_error!` in `lib.rs` that names the issue, short-circuit
`build.rs` to skip the now-misleading libnvinfer probe panic, and
update Cargo manifests + docs (features-matrix, gpu-testing, SKILL)
to point at #6 so downstream consumers reading the surface understand
the disabled state. The probe helpers and `#[cfg]` call sites are
preserved so re-enabling the feature in the shim PR is a one-line
change.

Refs #6

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sibling atomr workspace was bumped to 0.7.0; this updates the path
deps to match. No code changes — pin refresh only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Patch release covering the tensorrt-link guard (#7) — the feature now
fails fast with a `compile_error!` pointing at #6 instead of an opaque
linker error against libnvinfer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cognect cognect merged commit 027894e into main May 9, 2026
1 of 15 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