1cargo-features = ["named-profiles"] 2 3[package] 4name = "crosvm" 5version = "0.1.0" 6authors = ["The Chromium OS Authors"] 7edition = "2021" 8default-run = "crosvm" 9# b:223855233 10resolver = "1" 11 12[lib] 13path = "src/crosvm.rs" 14 15[[bin]] 16name = "crosvm" 17path = "src/main.rs" 18 19[[bin]] 20name = "crosvm-direct" 21path = "src/main.rs" 22required-features = [ "direct" ] 23 24[profile.release] 25panic = 'abort' 26overflow-checks = true 27 28[profile.release-test] 29inherits = 'release' 30panic = 'unwind' 31 32# Reproduces the options used when building crosvm for Chrome OS. 33[profile.chromeos] 34inherits = "release" 35opt-level = "s" 36 37# Enables LTO to further reduce the size of the binary. 38[profile.lto] 39inherits = "chromeos" 40lto = true 41 42# We currently need to exclude some crates from the workspace to allow 43# these crates to be independently built by portage. These crates will 44# eventually be moved into separate repositories. 45# The only workspace members that need to be explicitly specified here are those 46# that are not dependencies of the crosvm root crate. 47[workspace] 48members = [ 49 "aarch64", 50 "acpi_tables", 51 "arch", 52 "base", 53 "bit_field", 54 "cros_async", 55 "crosvm-fuzz", 56 "crosvm_control", 57 "crosvm_plugin", 58 "devices", 59 "disk", 60 "fuse", 61 "gpu_display", 62 "hypervisor", 63 "integration_tests", 64 "io_uring", 65 "kernel_cmdline", 66 "kernel_loader", 67 "kvm", 68 "kvm_sys", 69 "libcras_stub", 70 "linux_input_sys", 71 "media/libvda", 72 "net_sys", 73 "net_util", 74 "power_monitor", 75 "protos", 76 "qcow_utils", 77 "resources", 78 "rutabaga_gfx", 79 "serde_keyvalue", 80 "system_api_stub", 81 "tpm2", 82 "tpm2-sys", 83 "usb_sys", 84 "usb_util", 85 "vfio_sys", 86 "vhost", 87 "virtio_sys", 88 "vm_control", 89 "vm_memory", 90 "x86_64", 91 "third_party/vmm_vhost", 92] 93exclude = [ 94 "common/assertions", 95 "common/audio_streams", 96 "common/balloon_control", 97 "common/cros-fuzz", 98 "common/cros_async", 99 "common/cros_asyncv2", 100 "common/data_model", 101 "common/io_uring", 102 "common/p9", 103 "common/sync", 104 "common/sys_util", 105 "common/sys_util_core", 106 "common/win_sys_util", 107 "win_util", 108] 109 110[features] 111all-linux = [ 112 # TODO(b/203105868): Enable remaining features on linux builds. 113 "composite-disk", 114 "default", 115 "gdb", 116 "tpm", 117 "virgl_renderer_next", 118 "virgl_renderer", 119 "x", 120 ] 121win64 = [] 122audio = ["devices/audio"] 123audio_cras = ["devices/audio_cras"] 124chromeos = ["base/chromeos", "audio_cras", "devices/chromeos"] 125composite-disk = ["protos/composite-disk", "protobuf", "disk/composite-disk"] 126default = ["audio", "gpu", "usb"] 127default-no-sandbox = [] 128direct = ["devices/direct", "arch/direct", "x86_64/direct"] 129gdb = ["gdbstub", "gdbstub_arch", "arch/gdb", "vm_control/gdb", "x86_64/gdb"] 130gfxstream = ["devices/gfxstream"] 131gpu = ["devices/gpu"] 132libvda = ["devices/libvda"] 133linux-armhf = [ 134 "composite-disk", 135 "default", 136 "gdb", 137 "tpm", 138 ] 139linux-x86_64 = ["all-linux", "plugin"] 140linux-aarch64 = ["all-linux"] 141plugin = ["protos/plugin", "crosvm_plugin", "kvm", "kvm_sys", "protobuf"] 142plugin-render-server = [] 143power-monitor-powerd = ["arch/power-monitor-powerd"] 144slirp = ["devices/slirp"] 145tpm = ["devices/tpm"] 146usb = ["devices/usb"] 147video-decoder = ["devices/video-decoder"] 148video-encoder = ["devices/video-encoder"] 149virgl_renderer = ["devices/virgl_renderer"] 150virgl_renderer_next = ["rutabaga_gfx/virgl_renderer_next"] 151wl-dmabuf = ["devices/minigbm"] 152x = ["devices/x"] 153 154[dependencies] 155anyhow = "1.0.32" 156arch = { path = "arch" } 157assertions = { path = "common/assertions" } 158audio_streams = "*" 159base = { path = "base" } 160bit_field = { path = "bit_field" } 161cfg-if = "1.0.0" 162crosvm_plugin = { path = "crosvm_plugin", optional = true } 163data_model = "*" 164devices = { path = "devices" } 165disk = { path = "disk" } 166enumn = "0.1.0" 167gdbstub = { version = "0.5.0", optional = true } 168gdbstub_arch = { version = "0.1.0", optional = true } 169rutabaga_gfx = { path = "rutabaga_gfx"} 170hypervisor = { path = "hypervisor" } 171kernel_cmdline = { path = "kernel_cmdline" } 172kernel_loader = { path = "kernel_loader" } 173kvm = { path = "kvm", optional = true } 174kvm_sys = { path = "kvm_sys", optional = true } 175libc = "0.2.93" 176libcras = "*" 177minijail = "*" # provided by ebuild 178net_util = { path = "net_util" } 179p9 = "*" 180protobuf = { version = "2.3", optional = true } 181protos = { path = "protos", optional = true } 182remain = "*" 183resources = { path = "resources" } 184scudo = { version = "0.1", optional = true } 185serde_json = "*" 186serde_keyvalue = { path = "serde_keyvalue" } 187sync = { path = "common/sync" } 188tempfile = "3" 189thiserror = { version = "1.0.20" } 190uuid = { version = "0.8.2" } 191vhost = { path = "vhost" } 192vm_control = { path = "vm_control" } 193acpi_tables = { path = "acpi_tables" } 194vm_memory = { path = "vm_memory" } 195 196[target.'cfg(target_arch = "x86_64")'.dependencies] 197x86_64 = { path = "x86_64" } 198 199[target.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'.dependencies] 200aarch64 = { path = "aarch64" } 201 202[dev-dependencies] 203base = { path = "base" } 204lazy_static = "*" 205 206[patch.crates-io] 207assertions = { path = "common/assertions" } 208audio_streams = { path = "common/audio_streams" } 209base = { path = "base" } 210sys_util_core = { path = "common/sys_util_core" } 211cros_async = { path = "cros_async" } 212cros_fuzz = { path = "common/cros-fuzz" } # ignored by ebuild 213data_model = { path = "common/data_model" } 214libcras = { path = "libcras_stub" } # ignored by ebuild 215p9 = { path = "common/p9" } # ignored by ebuild 216sync = { path = "common/sync" } 217sys_util = { path = "common/sys_util" } 218system_api = { path = "system_api_stub" } # ignored by ebuild 219wire_format_derive = { path = "common/p9/wire_format_derive" } # ignored by ebuild 220minijail = { path = "../minijail/rust/minijail" } # ignored by ebuild 221