mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-17 05:31:16 +08:00
17 lines
613 B
Bash
Executable File
17 lines
613 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
BINARY="$PROJECT_ROOT/target/debug/openshell-vm"
|
|
|
|
cargo build --package openshell-vm --bin openshell-vm --quiet
|
|
|
|
# On macOS, codesign with the hypervisor entitlement so libkrun can use
|
|
# Apple's Hypervisor.framework. Re-sign after every build.
|
|
ENTITLEMENTS="$PROJECT_ROOT/crates/openshell-vm/entitlements.plist"
|
|
if [[ "$(uname)" == "Darwin" ]] && [[ -f "$ENTITLEMENTS" ]]; then
|
|
codesign --entitlements "$ENTITLEMENTS" --force -s - "$BINARY" 2>/dev/null
|
|
fi
|
|
exec "$BINARY" "$@"
|