cross-compilation requires additional configuration that depends
heavily on the host platform. Unfortunately cargo cannot be
configured on a per host platform basis so this has to be done
manually.
Most developers are just using native compilation (and using
the containers for everything else). So we can slim our
install-deps scripts a bit.
To verify the updated install scripts, this change includes
containers to simulate a fresh developer workstation that
can be used to verify out of the box workflows.
BUG=b:262829206
BUG=b:265995780
BUG=b:265842137
TEST=tools/contrib/minimal_container/test-all.sh and CQ
Change-Id: I0e803d0224306e5351728e2c80fcbcd8260d029d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4179290
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Instead of configuring which crates to --exclude in
test_config.py, we can use conditional compilation to
exclude code that is not supported on windows.
This allows more fine-grained control and also allows
us to use plain cargo for building without complicated
configuration and exclusions.
BUG=b:265829867
TEST=cargo test --lib --bins --workspace
--target=x86_64-pc-windows-gnu
--features=all-mingw64
Change-Id: I8422c3f08053bc27d9896b220876a56bd25543d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4165868
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Disallow code emitting warnings in run_tests instead of
.cargo/config.toml.
There are three places where we can specify "-Dwarnings":
(1). rustflags in .cargo/config.toml
(2). flags in health-check
(3). RUSTFLAGS environment variable used in run_tests
(1) was the place where we had -Dwarnings, but this affects downstream
projects that use cargo. So, it can cause an unexpected build error when
unsupported combinations of feature flags are used in the downstream
project. So, we want to force "-Dwarnings" only in the upstream CI.
(2) is a place we already have the flag. However, the health-check script
only runs on x86_64 platform in our CI.
So, we choose (3) in this CL so we can force "-Dwarnings" only for fixed
sets of features used in the upstream CI. Also, this can support all of
platforms in the upstream CI.
BUG=b:181763000
TEST=CQ
Change-Id: Iceededcc51e19d6781758e7fd7d5a2d7941d9ebc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014329
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Prior to this CL, clippy warnings needless_doctest_main and
blocks_in_if_conditions were suppressed. It turns out they have no
violations, as removing them and running cargo clippy produces no
warning. This CL removes those suppressions.
BUG=b:157245930, chromium:908640
Test=cargo clippy
Change-Id: I82f82bf2fdb7740f45e7187a9b2710fb7dc2ca04
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015559
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Clarissa Garvey <clarissagarvey@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Fixes a couple of files that were missing them.
BUG=b:242605601
TEST=./tools/health-check --fix
Change-Id: I620d6a939cb824e014002152584aacfc5dfdf7e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3835648
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Two new clippy fixes are affecting us, but will be easy to fix in
a follow-up.
Fixed the dev-container so we can create a new version with the new
toolchain.
BUG=b:210037151
TEST=Kokoro
Change-Id: I9ac4d84aff72b1ee5219d6dab0a88667ca6c5951
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3328954
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
There were not too many cases here. This fixes:
- comparison_chain
- wrong_self_convention
- upper_case_acronyms
- from_over_into
- let-and-return
The collapsible_if check is moved to the permanently
allowed checks. The cases we do have improve
readability or semantics.
BUG=chromium:908640
TEST=Kokoro
Change-Id: I6e905d08e2a87aa0862d4d1cf5ff57b60e95fa7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278776
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This applies the same clippy config to rust_analyzer
as well.
BUG=b:193893457
TEST=./tools/clippy and VSCode show the same linter results
Change-Id: I5deec4a24d71fec4692ed708664130f46c1311b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278773
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Building crates in common/ will try to access the file, but won't
be allowed to read it with CROS_WORKON_SUBTREE set.
BUG=b:195126527
TEST=./tools/run_tests --target=vm:aarch64
Change-Id: Ic455ca6c3102dd363daf70468e5d89003d10bb4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3254042
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Abhishek Bhardwaj <abhishekbh@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
The new runner makes use of the simplified crosvm build and greatly
improves execution speed by gathering test binaries from cargo output
and executes them directly in parallel.
This allows all of our tests to execute in ~5 seconds when run locally.
The new test runner also makes use of the new testvm tools to make it
easy to switch between testing on the host, in a VM or via SSH on a
remote device.
See ./tools/run_tests --help for usage instructions.
To allow more iterative testing with the same test targets, this CL
includes a set_test_target script to write env vars that instruct cargo
to build for the target arch and run on the test target.
Note: The test runner can build for armhf, but we need build file fixed
to allow armhf to build successfully.
BUG=b:199951064
TEST=Inside ./tools/dev_container:
./tools/run_tests --target=host
./tools/run_tests --target=vm:aarch64
./tools/run_tests --aarch=armhf --build-only
./tools/set_test_target vm:aarch64 && source .envrc
cargo test
Change-Id: I60291fa726fb2298f62d1f032e55ed6e7ab1c4ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3221779
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>