-
Notifications
You must be signed in to change notification settings - Fork 83
Update rust-vmm-ci to start using cargo-all-features, and drop downstream test definitions. #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@roypat love this! About CI issue, I guess the doc issue is pre-existing and we see it just because we have the new test in the CI, right? About the |
Ah no wait, it seems it's related to
|
Ah, heh, seems like the official build on docs.rs is actually failing for the very same reason (https://docs.rs/crate/vhost/0.14.0/builds/2193201). Let me look into whether there's some Cargo.toml stuff that specifically configures
Yeah, a bit further up it says
so in this case, its |
0b51e91
to
8ed4403
Compare
eb9c470
to
b871d2d
Compare
Some crates, such as vhost, use compile_error!() to indicate that mutually exclusive feature have been specified. This leads to problems when running cargo doc --all-features, which will inevitably trigger these conditions and then lead to documentation not building (for this reason, the vhost documentation currently fails to build on docs.rs for example). Add a custom cfg that gets passed via RUSTFLAGS in the cargo doc CI step on whose absense these compile_error!() macros can be gated, so that they dont cause issues when building documentation in CI See also rust-vmm/vhost#326 Signed-off-by: Patrick Roy <[email protected]>
Some crates, such as vhost, use compile_error!() to indicate that mutually exclusive feature have been specified. This leads to problems when running cargo doc --all-features, which will inevitably trigger these conditions and then lead to documentation not building (for this reason, the vhost documentation currently fails to build on docs.rs for example). Add a custom cfg that gets passed via RUSTFLAGS in the cargo doc CI step on whose absense these compile_error!() macros can be gated, so that they dont cause issues when building documentation in CI A custom cfg is needed because cargo doc does not pass `--cfg doc` down to dependencies. See also rust-vmm/vhost#326 Signed-off-by: Patrick Roy <[email protected]>
Some crates, such as vhost, use compile_error!() to indicate that mutually exclusive feature have been specified. This leads to problems when running cargo doc --all-features, which will inevitably trigger these conditions and then lead to documentation not building (for this reason, the vhost documentation currently fails to build on docs.rs for example). Add a custom cfg that gets passed via RUSTFLAGS in the cargo doc CI step on whose absense these compile_error!() macros can be gated, so that they dont cause issues when building documentation in CI A custom cfg is needed because cargo doc does not pass `--cfg doc` down to dependencies. See also rust-vmm/vhost#326 Signed-off-by: Patrick Roy <[email protected]>
Some crates, such as vhost, use compile_error!() to indicate that mutually exclusive feature have been specified. This leads to problems when running cargo doc --all-features, which will inevitably trigger these conditions and then lead to documentation not building (for this reason, the vhost documentation currently fails to build on docs.rs for example). Add a custom cfg that gets passed via RUSTFLAGS in the cargo doc CI step on whose absense these compile_error!() macros can be gated, so that they dont cause issues when building documentation in CI A custom cfg is needed because cargo doc does not pass `--cfg doc` down to dependencies. See also rust-vmm/vhost#326 Signed-off-by: Patrick Roy <[email protected]>
443c900
to
02cae1b
Compare
@roypat thanks! LGTM, but I'd move f22cc23 on top and add also a changelog line for it, WDYT ? BTW we didn't fix https://docs.rs/crate/vhost/0.14.0/builds/2193201 right? (we should do in another PR, but not sure how) |
Ack
We did actually! That's what the |
02cae1b
to
8d0ade3
Compare
Yep, but it doesn't work for deps as before, no? I tried
but again, I don't know how to fix it in a clean way and IMHO it's outside of this PR |
Yes, just doing
oh oops, yes, can do that too haha, sorry |
8d0ade3
to
61469b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I hope I'm not too picky :-)
I left a comment and I'd ask you to add "vhost: " prefix on 61c6152 and 9e1611b and move both of them before the rust-vmm-ci update. IMO the "vhost: " prefix it's useful in a workspace during bisection, backporting, etc. to understand better which crate is affected.
By using ioctl_with_ref() instead of ioctl_with_mut_ref(), we attempted to mutate through an immutable reference, so rustc was well within its rights to assume that `vring_state` does not change across the ioctl call, and hence optimize the return value of the function to simply be the value that `vring_state.num` was initialized to (which is 0). Signed-off-by: Patrick Roy <[email protected]>
Signed-off-by: Patrick Roy <[email protected]>
pick up the commit that introduces cargo-all-features. Signed-off-by: Patrick Roy <[email protected]>
Set it up so that it does not try to combine the xen and postcopy features, and also ignore the test-only test_utils feature. Signed-off-by: Patrick Roy <[email protected]>
Now that rust-vmm-ci uses cargo-all-features, we can deal with the incompatiblity of the xen and postcopy features by simply marking them as incompatible in Cargo.toml, instead of needing to define separate CI steps. note: this commit currently symlinks rust-vmm-ci-tests.json to rust-vmm-ci/.buildkite/test_descriptions.json, and removes all tests from custom-tests.json. This is to illustrate that the new setup works without changes to the buildkite pipeline. Once that is confirmed, the pipeline should be updated to just use the rust-vmm-ci test generaiton routine, and the entire .buildkite directory can be removed. Signed-off-by: Patrick Roy <[email protected]>
Introduce a dummy feature to hack around `cargo doc --all-features` always hitting the compile_error!(...) in vhost/src/lib.rs about incompatible features. This is happening because when documenting vhost-user-backend, cargo does not pass --cfg doc to dependencies, meaning the cfg(not(doc)) attribute that is supposed to eliminate this compile_error!() invokation when building docs does not actually trigger. Hence cargo doc fails. Introduce a custom cfg, which we tell docs.rs to set during documentation build, which disables the compile_error!(). Our CI also sets this flag for the rustdoc step (via an ugly `sed` in the pipeline definition). This cfg is also set by rust-vmm-ci for the cargo doc step. Note that we need both cfg(not(doc)) and cfg(not(RUTSDOC_disable_feature_compat_errors)), because lib.rs gets processed twice, onces by rustc (where the --cfg is passed via RUSTFLAGS), and once by rustdoc itself, where RUSTFLAGS are ignored, and instead the cfg(doc) macro comes into play (but rustdoc is only ran on the crate for which we are actually generating docs, not the dependencies). Signed-off-by: Patrick Roy <[email protected]>
Instruct the docs.rs documentation builder to pass --cfg RUTSDOC_disable_feature_compat_errors in RUSTFLAGS when building documentation, so that builds dont fail because of compile_error!() and incompatible features [1]. [1]: https://docs.rs/crate/vhost/0.14.0/builds/2193201 Signed-off-by: Patrick Roy <[email protected]>
61469b7
to
1f6aafb
Compare
done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roypat thanks for the patience and the work!
Just a note for maintainers, when we will merge this PR we will need to update buildkite pipeline, see d3cfd78
note: this commit currently symlinks rust-vmm-ci-tests.json to
rust-vmm-ci/.buildkite/test_descriptions.json, and removes all tests
from custom-tests.json. This is to illustrate that the new setup works
without changes to the buildkite pipeline. Once that is confirmed, the
pipeline should be updated to just use the rust-vmm-ci test generaiton
routine, and the entire .buildkite directory can be removed.
Summary of the PR
With rust-vmm-ci now using cargo-all-features, all the custom test definitions for dealing with the incompatibility of the xen and postcopy features can be removed in favor of simply declaring that combination of features incompatible in Cargo.toml
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.