Ensure that every Cargo.toml dependency on a third-party crates.io crate
specifies at least a major version, or a minor version for 0.x crates,
to ensure that if a new major version is published, it cannot cause API
breaks.
The versions are selected to match the ones already in Cargo.lock, so
this should have no functional change, but it will help prevent new "*"
versions from being introduced via copy-and-paste.
For rationale, see the Cargo FAQ:
<https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies>
`minijail`, `audio_streams`, and `cras` are left as "*" for now, since
they have unusual situations (imported from a submodule and/or replaced
at build time with ebuild magic).
BUG=None
TEST=tools/dev_container tools/presubmit
TEST=verify Cargo.lock is unchanged
Change-Id: Ifa18199f812f01d2d10bfb4146b3353c1a76527c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5555656
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The tempfile crate is only used in tests, so it does not need to be in
the main [dependencies] section of any of our first-party crates.
Also fix a couple of [dev_dependencies] instances to the officially
documented [dev-dependencies] name for consistency.
BUG=None
TEST=cargo tree
Change-Id: I1dcb6be10c302baec4e8ebe6f72480f76e4e3760
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5521511
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Initialize the metrics tube and make sure its kept in all forked
children.
BUG=b:332466813
TEST=tast run DUT arc.Boot.vm
Change-Id: Ide7a9e4ba5a3d8a52e69ac65b9aaaefcf21735a6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5400363
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Instead of deserializing from the metrics tube in the generic
MetricsController code, we can directly pass the readable tube to the
vendor RequestHandler implementation. This allows us to shrink the size
of the vendor metrics API by removing RequestHandler.
This change also makes MetricsController use RecvTubes instead of Tubes.
BUG=b:332466813
TEST=./tools/dev_container ./tools/presubmit all
Change-Id: Ia1507d5e1c0cdd346d165c968184e9d2bd70314e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5400362
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Switch the metrics client API from Tube to SendTube for more specific
typing. We're already making downstream breaking vendor changes, so it's
a good time to do this cleanup.
BUG=b:332466813
TEST=./tools/dev_container ./tools/presubmit all
Change-Id: Id870da0298291955496e0fa339142ac379a49d37
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5404371
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Add a metrics_event package instead of relying on metric events provided
out of a vendor/ crate. The new API defines the same events as the
existing vendor API, except it removes any dependencies on downstream
details. To allow downstream projects to define their own events, the
new API adds a vendor metrics_event package to support downstream-only
event types.
BUG=b:332466813
TEST=./tools/dev_container ./tools/presubmit all
Change-Id: I766ad6ca2a0a437bb487e27fb84a4984f66c9770
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5400361
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
The generic/metrics/build.rs script previously added a linker search
path, but the generic module doesn't actually link anything. The
generated proto code is compiled via include!(), so no linker options
are necessary.
This previously included a Windows-style path with backslashes into the
linker options, which did not work on Linux, so it was clearly not used.
BUG=b:286107739
Change-Id: If0139267e845fcacc9e3202a880071c938054783
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5420403
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Introduces a new switch/option on snapshot commands/IPCs that turns on
encryption using the crypto crate.
BUG=b:286345300
TEST=builds upstream; tested end to end downstream.
Change-Id: Ia04074bb23332274d4e6b99eb242c84b0af7a8a9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5371444
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
The generic portion contains only interfaces, but no actual encryption
code. It will be used by an upcoming snapshot encryption option.
BUG=b:286345300
TEST=n/a (intended to always panic)
Change-Id: I54e8d4753a5584ffe7e9f0df5c31636ad34a905d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5350786
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Updates are made to source and documentation.
This more accurately represents the currently supported platforms of
Android/Linux and Windows, without unexpectedly including other
unix-like operating systems.
Command to reproduce:
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -i 's/cfg(unix)/cfg(any(target_os = "android", target_os = "linux"))/g' {}
$ cargo fmt
md files manually updated to fix line lengths.
Renaming `unix` modules to `linux` will be done in a later CL.
Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I42c1bf0abf80b9a0df25551613910293217c7295
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909059
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>