crosvm: switch to upstream tempfile crate

Use the crates.io implementation of tempfile instead of our own version.

Our reimplementation is kept in the tree for now in case of dependencies
outside of the crosvm tree; it can be removed later once those are fully
switched over to the crates.io implementation.

BUG=b:199204746
TEST=emerge-hatch crosvm

Change-Id: I07d3404239302ab9a17f4ddc82a9479b256e4eb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3209839
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2021-09-22 13:10:11 -07:00 committed by Commit Bot
parent ce6cf4efe2
commit 7fd815ed22
13 changed files with 88 additions and 19 deletions

79
Cargo.lock generated
View file

@ -265,7 +265,7 @@ dependencies = [
"fuse",
"kernel_loader",
"libc",
"rand",
"rand 0.6.5",
"tempfile",
"usb_util",
"vm_memory",
@ -835,6 +835,12 @@ dependencies = [
"thiserror",
]
[[package]]
name = "ppv-lite86"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "proc-macro2"
version = "1.0.26"
@ -917,9 +923,9 @@ checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
dependencies = [
"autocfg 0.1.2",
"libc",
"rand_chacha",
"rand_chacha 0.1.1",
"rand_core 0.4.0",
"rand_hc",
"rand_hc 0.1.0",
"rand_isaac",
"rand_jitter",
"rand_os",
@ -928,6 +934,18 @@ dependencies = [
"winapi",
]
[[package]]
name = "rand"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
dependencies = [
"libc",
"rand_chacha 0.3.1",
"rand_core 0.6.3",
"rand_hc 0.3.1",
]
[[package]]
name = "rand_chacha"
version = "0.1.1"
@ -938,6 +956,16 @@ dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core 0.6.3",
]
[[package]]
name = "rand_core"
version = "0.3.1"
@ -953,6 +981,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
[[package]]
name = "rand_core"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
version = "0.1.0"
@ -962,6 +999,15 @@ dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "rand_hc"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
dependencies = [
"rand_core 0.6.3",
]
[[package]]
name = "rand_isaac"
version = "0.1.1"
@ -1024,6 +1070,15 @@ dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "redox_syscall"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
dependencies = [
"bitflags",
]
[[package]]
name = "remain"
version = "0.2.1"
@ -1035,6 +1090,15 @@ dependencies = [
"syn",
]
[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
"winapi",
]
[[package]]
name = "resources"
version = "0.1.0"
@ -1146,9 +1210,16 @@ version = "0.1.0"
[[package]]
name = "tempfile"
version = "3.0.7"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
dependencies = [
"cfg-if 1.0.0",
"libc",
"rand 0.8.4",
"redox_syscall",
"remove_dir_all",
"winapi",
]
[[package]]

View file

@ -97,7 +97,7 @@ remain = "*"
resources = { path = "resources" }
serde_json = "*"
sync = { path = "sync" }
tempfile = "*"
tempfile = "3"
thiserror = { version = "1.0.20" }
vhost = { path = "vhost" }
vm_control = { path = "vm_control" }
@ -125,7 +125,6 @@ p9 = { path = "common/p9" } # ignored by ebuild
sync = { path = "sync" }
sys_util = { path = "sys_util" }
system_api = { path = "system_api_stub" } # ignored by ebuild
tempfile = { path = "tempfile" }
wire_format_derive = { path = "common/p9/wire_format_derive" } # ignored by ebuild
minijail = { path = "third_party/minijail/rust/minijail" } # ignored by ebuild
vmm_vhost = { path = "third_party/vmm_vhost", features = ["vhost-user-master", "vhost-user-slave"] } # ignored by ebuild
vmm_vhost = { path = "third_party/vmm_vhost", features = ["vhost-user-master", "vhost-user-slave"] } # ignored by ebuild

View file

@ -123,8 +123,8 @@ For faster iteration time, you can directly invoke some of these steps directly:
To only run x86 tests: `./ci/[aarch64_]builder --vm ./run_tests`.
To run a simple test (e.g. the tempfile crate) that does not need the vm:
`./ci/[aarch64_]builder cargo test -p tempfile`.
To run a simple test (e.g. the enumn crate) that does not need the vm:
`./ci/[aarch64_]builder cargo test -p enumn`.
Or run a single test (e.g. kvm_sys) inside the vm:
`./ci/[aarch64*]builder --vm cargo test -p kvm_sys`.

View file

@ -6,4 +6,4 @@ edition = "2018"
[dependencies]
data_model = { path = "../data_model" }
tempfile = { path = "../tempfile" }
tempfile = "3"

View file

@ -29,6 +29,6 @@ features = ["alloc"]
futures = { version = "*", features = ["executor"] }
futures-executor = { version = "0.3", features = ["thread-pool"] }
futures-util = "0.3"
tempfile = { path = "../tempfile" } # provided by ebuild
tempfile = "3"
[workspace]

View file

@ -73,4 +73,4 @@ features = ["std"]
default-features = false
[dev-dependencies]
tempfile = { path = "../tempfile" }
tempfile = "3"

View file

@ -17,7 +17,7 @@ crc32fast = { version = "1.2.1", optional = true }
libc = "*"
protobuf = { version = "2.3", optional = true }
remain = "*"
tempfile = "*"
tempfile = "3"
thiserror = "*"
uuid = { version = "0.8.2", features = ["v4"], optional = true }
cros_async = { path = "../cros_async" }

View file

@ -14,7 +14,7 @@ kernel_loader = { path = "../kernel_loader" }
libc = "*"
rand = "0.6"
base = { path = "../base" }
tempfile = { path = "../tempfile" }
tempfile = "3"
usb_util = { path = "../usb_util" }
vm_memory = { path = "../vm_memory" }

View file

@ -5,7 +5,7 @@ authors = ["The Chromium OS Authors"]
edition = "2018"
[dev-dependencies]
tempfile = { path = "../tempfile" }
tempfile = "3"
crosvm = { path = ".." }
arch = { path = "../arch" }
base = "*"

View file

@ -13,6 +13,6 @@ sys_util = { path = "../sys_util" } # provided by ebuild
thiserror = "1"
[dev-dependencies]
tempfile = { path = "../tempfile" } # provided by ebuild
tempfile = "3"
[workspace]

View file

@ -12,4 +12,4 @@ thiserror = "*"
vm_memory = { path = "../vm_memory" }
[dev-dependencies]
tempfile = "*"
tempfile = "3"

View file

@ -59,7 +59,6 @@ CRATE_REQUIREMENTS: Dict[str, List[Requirements]] = {
"sync": [],
"sys_util": [Requirements.SINGLE_THREADED, Requirements.PRIVILEGED],
"poll_token_derive": [],
"tempfile": [],
"tpm2-sys": [],
"tpm2": [],
"usb_sys": [],

View file

@ -14,7 +14,7 @@ thiserror = "*"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
sync = { path = "../sync" } # provided by ebuild
tempfile = { path = "../tempfile" } # provided by ebuild
tempfile = "3"
[target.'cfg(target_os = "android")'.dependencies]
android_log-sys = "0.2"