-
Notifications
You must be signed in to change notification settings - Fork 92
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
Crater should read the same metadata as docs.rs for doc runs #532
Comments
To be clear - the feature request is to read |
It wouldn't be too hard to separate this out of https://github.com/rust-lang/docs.rs/blob/master/src/docbuilder/metadata.rs as a library. Not sure where it should live though - maybe under |
I'd simply create a pub struct Metadata {
// Private fields
}
impl Metadata {
pub fn discover_from_crate_root(root: &Path) -> Result<Self, Error> {}
pub fn parse(manifest: &str) -> Result<Self, Error> {}
pub fn cargo_args(&self) -> Vec<String> {
// --features, --no-default-features, --all-features
// *NOT* --target
}
pub fn environment_variables(&self) -> Vec<(String, String)> {
// RUSTFLAGS, RUSTDOCFLAGS, DOCS_RS=1
}
pub fn default_target(&self) -> &str {}
pub fn additional_targets(&self) -> Vec<&str> {}
} Crater would then depend on the crate, and take into account everything but the targets. |
Looks great! I think |
Why wouldn't crater read the default target? e.g. winapi is an empty crate when compiled for Linux. |
Because try builds don't have additional targets unless you mess with the CI config. |
Docs.rs needs to have owned strings for |
|
|
[WIP] Read docs.rs metadata when running rustdoc Closes #532 <details><summary>Outdated errors</summary> I'm having trouble running the test suite, so I haven't yet added a test. My idea was to have a crate that only builds successfully when you read the metadata, but I'm not sure if that would work with the way the test suite is set up. Current errors: ``` $ cargo test minicrater -- single_thread_small --ignored --test-threads 1 [2020-09-05T02:02:04Z INFO rustwide::cmd] running `Command { std: "/home/joshua/src/rust/crater/work/cargo-home/bin/cargo" "+stable" "install" "lazy_static", kill_on_drop: false }` [2020-09-05T02:02:04Z INFO rustwide::cmd] [stderr] Updating crates.io index [2020-09-05T02:02:04Z INFO rustwide::cmd] [stderr] error: specified package `lazy_static v1.4.0` has no binaries [2020-09-05T02:02:04Z ERROR crater::utils] Permission denied (os error 13) [2020-09-05T02:02:04Z ERROR crater::utils] note: run with `RUST_BACKTRACE=1` to display a backtrace. [2020-09-05T02:02:04Z INFO crater] command failed ', /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/assert_cmd-0.10.1/src/assert.rs:154:13 ``` </details> Before merging, I need to publish the `docsrs-metadata` package to crates.io so crater doesn't depend on a git version. r? `@pietroalbini` help
[WIP] Read docs.rs metadata when running rustdoc Closes #532 <details><summary>Outdated errors</summary> I'm having trouble running the test suite, so I haven't yet added a test. My idea was to have a crate that only builds successfully when you read the metadata, but I'm not sure if that would work with the way the test suite is set up. Current errors: ``` $ cargo test minicrater -- single_thread_small --ignored --test-threads 1 [2020-09-05T02:02:04Z INFO rustwide::cmd] running `Command { std: "/home/joshua/src/rust/crater/work/cargo-home/bin/cargo" "+stable" "install" "lazy_static", kill_on_drop: false }` [2020-09-05T02:02:04Z INFO rustwide::cmd] [stderr] Updating crates.io index [2020-09-05T02:02:04Z INFO rustwide::cmd] [stderr] error: specified package `lazy_static v1.4.0` has no binaries [2020-09-05T02:02:04Z ERROR crater::utils] Permission denied (os error 13) [2020-09-05T02:02:04Z ERROR crater::utils] note: run with `RUST_BACKTRACE=1` to display a backtrace. [2020-09-05T02:02:04Z INFO crater] command failed ', /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/assert_cmd-0.10.1/src/assert.rs:154:13 ``` </details> Before merging, I need to publish the `docsrs-metadata` package to crates.io so crater doesn't depend on a git version. r? `@pietroalbini` help
Add a mode for reading docs.rs metadata when running rustdoc Closes #532 Before merging, I need to publish the `docsrs-metadata` package to crates.io so crater doesn't depend on a git version.
There was a regression in rust-lang/rust#73566 not caught because crater didn't pass the same
--feature docs
as docs.rs. It would be great if crater added those features so we could catch regressions early instead of after they land.rust-lang/rust#73566 (comment)
The text was updated successfully, but these errors were encountered: