Skip to main content

Module cargo_env

Module cargo_env 

Source
Expand description

Shared Cargo metadata, AppContext, NvSdkRoot, target-directory, and artifact build helpers.

Re-exports§

pub use app_context::is_nv_sdk_root;
pub use app_context::resolve_app_and_optional_sdk;
pub use app_context::resolve_app_and_sdk;
pub use app_context::resolve_sdk_root;
pub use app_context::AppContext;
pub use app_context::AppSelector;
pub use app_context::NvSdkRoot;
pub use artifact::build_artifact;
pub use artifact::build_artifact_with_rustc_args;
pub use artifact::build_artifact_with_siblings;
pub use artifact::build_package_cdylib;
pub use artifact::build_package_cdylib_in;
pub use artifact::build_workspace_bin_in;
pub use artifact::parse_cdylib_artifact_from_json;
pub use artifact::run_cargo_json_command;
pub use artifact::ArtifactKind;
pub use artifact::BuildArtifactSpec;
pub use artifact::BuiltCdylib;

Modules§

app_context
AppContext & NvSdkRoot resolution for nv build / nv run / nv dev.
artifact
Cargo build/rustc invocation and --message-format=json-render-diagnostics artifact extraction.
sdk
Packaged SDK manifest (sdk-manifest.json), read-only cache path resolution, and SHA-256 verified prebuilt artifact resolution (libnv_runtime, nv-skia-shell, NvRuntime.xcframework, nv_accessibility_windows, Android jniLibs).

Structs§

CargoMetadata
Parsed subset of cargo metadata --format-version 1 (with or without --no-deps).
CargoPackageInfo
Package metadata relevant to nv (cdylib / bin targets, features, [package.metadata.nativeview]).

Functions§

absolutize_path
absolutize_path_from
dylib_filename
Platform-specific dynamic library filename for a Rust library crate name (foo_bar).
dylib_path_in
Expected compiled cdylib path under target_dir/<profile>/ (used for pure path helpers).
exe_filename
Platform-specific executable filename for a Cargo binary name.
find_package
Finds a package in meta by name (preferring workspace members when duplicate names exist).
find_workspace_root
Resolves the enclosing Cargo workspace root.
host_target_triple
Returns the active rustc host target triple (cached once per process).
load_cargo_metadata
Runs cargo metadata --no-deps --format-version 1.
load_full_cargo_metadata_in
Runs full cargo metadata --format-version 1 in cwd, optionally filtered to filter_platform.
parse_cargo_metadata
Parses cargo metadata --format-version 1 JSON output (both --no-deps and full graphs).
parse_cargo_target_dir
Extracts target_directory from cargo metadata --format-version 1 JSON output.
preserve_relative_cargo_target_dir
preserve_relative_cargo_target_dir_from
Preserves Cargo’s cwd-relative CARGO_TARGET_DIR semantics when spawning a Cargo subprocess in a different working directory.
profile_dir_name
Cargo profile directory name ("release" or "debug").
resolve_cargo_target_dir_or_fallback
Resolves the active Cargo target directory, falling back cleanly when outside a workspace.
resolve_target_dir_with_env
Pure target-directory resolver:
select_cdylib_package
Selects the target cdylib package from meta given optional --package and --manifest-path.
workspace_root_from_meta
Resolves the enclosing Cargo workspace root using preloaded metadata when available.