boxmot.native._common
Build helpers for native trackers and the standalone native ReID encoder.
set_build_status_fn
Register a callback used to report native build progress.
The callback is typically a WorkflowDetailCallback whose __call__
routes a status message into an active Rich workflow panel. When set,
:func:run_build_step streams CMake output into the panel instead of
printing it to stdout (which would corrupt the Rich Live region).
Pass None to clear the registration.
get_build_status_fn
Return the currently registered build status callback, if any.
run_build_step
Run a CMake build subcommand, routing output through status_fn.
When status_fn is callable (or registered via
:func:set_build_status_fn), captures stdout/stderr line-by-line and
forwards each line to the callback so it appears inside the active Rich
workflow panel. When no callback is active, falls back to the legacy
behaviour of streaming output to the terminal.
package_native_root
Return the boxmot/native directory inside the installed package.
repo_root
Return the repository root.
Only valid for editable / source checkouts. Wheels installed via pip will typically not have a meaningful repo root above the package, so callers must treat the returned path as best-effort.
tracker_source_dir
Directory containing the C++ sources for a given native tracker.
Native C++ sources live at boxmot/native/cpp/trackers/<name>.
The path is the same whether the package is imported from a source
checkout or an installed wheel.
native_component_source_dir
Return the CMake source directory for a low-level native component.
tracker_build_dir
Out-of-tree CMake build directory used by editable / dev installs.
Located at <repo>/build/native/<name>. Wheels never write here.
installed_library_candidates
Where scikit-build-core places the shared library inside the wheel.
The build configuration installs the shared library beside the C++ source directory so it ships with the package and is loadable without re-running CMake at runtime.
build_library_candidates
Editable-install fallback locations for the shared library.
library_filename
Return the C-API shared library filename for a tracker on the current OS.
Convention: <tracker>_capi with the platform's shared-library suffix.
candidate_libraries
Installed-then-built search paths for the C-API shared library.
build_native_target
build_native_target(
*,
tracker_name: str,
display_name: str,
target: str,
candidates: list[Path],
force_rebuild: bool,
not_found_message: str,
build_lock: Lock,
) -> Path
Configure and build a single CMake target for a native tracker.
Packaged artifacts installed beside their sources are trusted as immutable.
Editable-build artifacts are reused only when their recorded source/CMake
fingerprint matches the current tree. Raises RuntimeError on
configure/build failure or if the expected artifact is still missing.