Commit Graph

98 Commits

Author SHA1 Message Date
Rob Bradford
ca96ff601b build: Migrate from DockerHub to ghcr
It is necessary to transition away from DockerHub as the small
organisation plan in being EOLed.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-03-15 22:41:23 +00:00
Bo Chen
85962099c7 build: Update development container and release action to Rust 1.67
This latest stable Rust toolchain can help reduce the final binary size
around ~300k when comparing with building with Rust 1.62. Specifically,
the binary size now is 3.3M (previously 3.6M) with default feature, and
4.0M (previously 4.2M) with "kvm+mshv" feature (e.g. our release action
build) .

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-03-01 15:16:23 +00:00
Rob Bradford
7ceb126184 github: Build examples as well as tests in quality workflow
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-02-16 09:59:14 -08:00
Rob Bradford
8b9da4e286 build: Bump MSRV to 1.62
Needed for #[derive(Default)] on enums which is now clippy checked in
1.68.

Fixes: #5140

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-26 13:05:23 +00:00
Rob Bradford
f6c058da56 .github: Don't try and create releases for created branches
Dependabot will create a branch on the repo for it's updates this
triggers the release action (because it's the same event as a tag) which
will then fail leading to dependabot PRs not being automerged. Instead
only run the release check test on PRs or tag creation.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-20 09:58:53 +00:00
Rob Bradford
6e9172bf6f .github: Re-order release steps to ensure binaries are available
Since we run "cargo clean" before running the aarch64 build we need to
create the release and upload the x86-64 assets before the clean.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-14 12:12:11 +00:00
Rob Bradford
547230bb77 .github: Clean source tree before cross building release assets
This address issues with leaking symbols into the cross build.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-13 16:44:59 +00:00
Rob Bradford
ef7e177df2 .github: Run release style builds on all PRs
Adjust the release workflow to move the conditional check on the tag
creation into the steps that create the release/upload the assets.

This allows us to ensure we're always in a releaseable state.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-13 14:38:15 +00:00
Rob Bradford
a1c6ef8385 .github: Add musl variants to quality (clippy) checks
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-07 17:50:48 +00:00
Rob Bradford
c37dadcc9a .github: Enable "guest_debug" clippy on aarch64
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-05 17:23:52 +00:00
Rob Bradford
7fd2022e8e .github: Ensure target used for clippy tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-01 17:02:30 +00:00
Rob Bradford
1b6dd597b2 .github: Remove build testing for aarch64 with guest_debug feature
See: #4964

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-01 17:02:30 +00:00
Henry Wang
1ff0191b30 github,Cargo.toml: Strip release binaries using toolchain
From Rust 1.59, the cargo command is now able to strip a binary [1].
This can be enabled in Cargo.toml by adding a `strip = "true"` to
the `[profile.release]` section.

Adding such binary stripping support in Cargo.toml of the project,
also change the stripping process in the release workflow to the one
using toolchain, so that the AArch64 release binaries can also
be stripped.

Fixes: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/4916

[1] https://doc.rust-lang.org/beta/cargo/reference/profiles.html#strip

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-11-21 13:39:29 +00:00
Muminul Islam
bfeab9f69f .github: do release build with both KVM and MSHV enabled
Fixes: #4678

Currently release build is done on kvm feature only,
that makes live upgrade test on MSHV failing since
it does not find /dev/kvm. As Cloud-Hypervisor
supports both kvm and mshv in a single binary we should
make the release build with both KVM/MSHV feature enabled.
That way live upgrade test does not fail on MSHV.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2022-11-18 19:15:25 +00:00
Wei Liu
3ca6c29e28 github: do not allow undocumented unsafe blocks
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-11-18 12:50:01 +00:00
Rob Bradford
06eb82d239 build: Consolidate "gdb" build feature into "guest_debug"
This simplifies the CI process but also logical with the existing
functionality under "guest_debug" (dumping guest memory).

Fixes: #4679

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-27 14:30:57 +01:00
Rob Bradford
b2d1dd65f3 build: Remove "fwdebug" and "common" feature flags
This simplifes the buld and checks with very little overhead and the
fwdebug device is I/O port device on 0x402 that can be used by edk2 as a
very simple character device.

See: #4679

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-26 10:16:33 -07:00
Rob Bradford
36e26f004c .github: Consolidate quality checks into single worklow
Combine aarch64 and x86-64 checks into one workflow

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-26 16:52:42 +01:00
Rob Bradford
c98bd2fd4a .github: Add clippy check of tracing feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-22 18:09:31 +01:00
Sebastien Boeuf
1849ffff31 vmm: Remove "amx" feature gate
Given the AMX x86 feature has been made available since kernel v5.17,
and given we don't have any test validating this feature, there's no
need to keep it behing a Rust feature gate.

Fixes #3996

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-09-16 15:03:31 +01:00
Rob Bradford
616ec530a8 .github: workflows: Fail on intermediate steps for commit checks
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-30 21:40:31 +01:00
Rob Bradford
850c0c8319 .github: workflows: Fix per commit buildability check
Fetch the whole git repository (not just the specific commit) and use
the github context instead of hardcoded branch.

Unfortunately now that we process the list of revisions correctly it
shows that the checks don't work on aarch64 due to cross limitations so
this has been removed.

Fixes: #4523

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-30 21:40:31 +01:00
Rob Bradford
c59b5e18a8 .github: Move per-commit check (using --tests) to quality checks
This removes the requirement for the tests (dev-dependencies) to build
with all supported toolchains including the MSRV.

See: #4318

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-11 13:18:33 +01:00
Wei Liu
5aaa647639 .github: build MSHV and KVM at the same time
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-07-22 12:50:12 +01:00
Rob Bradford
5dfc49c9fa build: Update development container to Rust 1.62
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-05 11:50:46 +01:00
Rob Bradford
4ddc6ffd73 .github: Add missing clippy check with "guest_debug" feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-08 11:40:56 +01:00
Yi Wang
6ab93a08ec build: Add GitHub action to build test guest_debug feature
Add guest_debug feature test for github workflows.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
2022-05-30 13:41:40 +02:00
Rob Bradford
ebaea6fe0f .github: Use 1.60 toolchain consistently in release process
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-25 23:56:51 +02:00
Rob Bradford
ffd1411e7c build: Bump minimum Rust version to 1.60
Some dependencies (e.g. pnet 0.30.0) require it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-24 16:02:08 +01:00
Rob Bradford
02358d3091 Revert ".github: Fix Rust version for release to 1.58"
This reverts commit 6a099257e8.

It is now clear that pinning the toolchain for cross compilation is not
necessary since we only use it for building to aarch64:

https://github.com/rust-lang/rust/issues/95926#issue-1199547707

"This problem doesn't currently show up when cross-compiling from x86_64
to aarch64, since aarch64 doesn't use static-pie by default, but
enabling PIE with -C relocation-model=pie triggers the same bug and
makes the resulting binaries segfault."

Fixes: #3962

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-23 16:38:27 +01:00
Wei Liu
babece08c6 github: use --locked in cargo invocations
Cargo comes with a --locked option that makes sure Cargo.lock is not
changed.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-04-19 13:44:24 +01:00
Rob Bradford
cd2b167b33 .github: Use correct toolchain version for release builds
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-13 10:21:05 -07:00
Rob Bradford
a63d526423 .github: Test building of tests on each commit
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-13 13:54:06 +01:00
Rob Bradford
735457f0e1 .github: Run clippy checks over tests on aarch64
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-13 13:54:06 +01:00
Rob Bradford
6a099257e8 .github: Fix Rust version for release to 1.58
Unfortunately Rust 1.59 produces binaries that segfault when compiled
with musl-gcc wrappers. Which is exactly how we produce out aarch64 and
musl binaries for the release.

See: https://github.com/rust-lang/rust/issues/95926

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-11 22:53:34 +01:00
Wei Liu
7d7bfb2034 build: migrate to Rust 2021 edition
Rust 2021 edition has a few improvements over the 2018 edition. Migrate
the project to 2021 edition by following recommended migration steps.
Luckily, the code itself doesn't require fixing.

Bump MSRV to 1.56 as it is required by the 2021 edition. Also fix the
clap build dependency to make Cloud Hypervisor build again.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-04-11 09:51:12 +01:00
Rob Bradford
3c9e97ce00 .github: Add build testing of "gdb" build feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-28 09:18:29 -07:00
Rob Bradford
a9fdaa6734 .github: Simplify feature testing in workflows
This includes the removal of testing without the "acpi" feature. The
command have been reordered to reduce the amount of recompilation
required.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-28 09:18:29 -07:00
William Douglas
c8d07f66d1 build: Add amx workflows
With the addition of the amx feature, add a new build workflow to
enable the feature and a clippy quality check.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-03-25 14:11:54 -07:00
Rob Bradford
55a4803a4a .github: Avoid excessive rebase & rebuilds from dependabot
Reduce the number of open pull requests dependabot will create to avoid
excessive rebase and rebuilds of PRs. This avoids a situation with a 2nd
PR being rebased after a 1st is merged resulting in a wasteful rebuild.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-08 15:16:12 +00:00
Rob Bradford
e2e070ad8a github: Install missing musl tools
Needed since:

commit 0ab4097606
Author: Bo Chen <chen.bo@intel.com>
Date:   Thu Feb 10 18:29:53 2022 -0800

    test_infra: Enable cross-build for "musl" and "aarch64" targets

    With enabling the `vendered-openssl` feature, we can now cross-build the
    `test_infra` crate for  "musl" and "aarch64" targets. In this way, we
    can remove the `test_infra` crate from the "exclude" list, so that this
    crate can be checked and processed by "cargo clippy" and "cargo fmt".

    More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

    As 'musl-gcc' is required, this commit also installs the `musl-tools`
    package for our "build" github action on the musl target [1].

    [1] https://github.com/actions-rs/toolchain/issues/102

    Signed-off-by: Bo Chen <chen.bo@intel.com>

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-03 15:38:36 +00:00
Rob Bradford
8846409eab github: Build against minimum supported version
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-23 12:35:47 +00:00
Rob Bradford
8c19d526cd github: Use tag derived from date for docker image
This will allow easier transitioning between versions of the container.
A later PR will update the CI to use this new tag.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-18 11:45:40 +00:00
Bo Chen
0ab4097606 test_infra: Enable cross-build for "musl" and "aarch64" targets
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] https://github.com/actions-rs/toolchain/issues/102

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
c2f133990d github: Remove use of "integration_tests" feature gate
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-10 10:29:07 +01:00
Rob Bradford
58d3d4c34e build: Include static ch-remote binary in release
Fixes: #3425

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-12-07 11:17:29 +01:00
Rob Bradford
589dc77354 build: Add GitHub action to build test TDX feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-11-18 07:03:13 -08:00
Sebastien Boeuf
e6e58e6d66 docs: Replace Cloud-Hypervisor with Cloud Hypervisor syntax
The proper way to refer to the project is "Cloud Hypervisor" without the
hyphen in the middle. On the other hand, if one refers to the binary
name, it is "cloud-hypervisor".

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-11-15 17:27:23 +01:00
William Douglas
1c2ab3e771 workflow: Add vendored source release content
Create a source archive with vendored sources as part of the release
workflow. This is to enable building the release offline for distros.

Note: The use of realpath and CARGO_HOME are to work around a cargo
vendor bug: https://github.com/rust-lang/cargo/issues/8443.

Signed-off-by: William Douglas <william.douglas@intel.com>
2021-10-26 16:17:38 +01:00
Rob Bradford
bd51f3069c build: Exclude dependabot from DCO check workflow
PRs from dependabot are failing to meet the check from DCO as the
Signed-Off-By is now a GitHub support email address.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-10-21 10:57:09 +02:00