Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,3 @@ jobs:
run: cargo test --workspace --all-targets
- name: Cargo doc test
run: cargo test --doc

# Check formatting with rustfmt
mdbook:
name: test mdBook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
# rustdoc doesn't build dependencies, so it needs to run after `cargo build`,
# but its dependency search gets confused if there are multiple copies of any
# dependency in target/debug/deps, so it needs to run before `cargo test` et al.
# clutter target/debug/deps with multiple copies of things.
- run: cargo clean
- run: cargo build
- name: test mdBook
run: for file in $(find mdbook -name '*.md' | sort); do rustdoc --test $file -L ./target/debug/deps; done
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ members = [
"server/dataflows/random_graph",
"server/dataflows/reachability",
#"tpchlike",
"doop"
"doop",
"mdbook",
]
resolver = "2"

[workspace.package]
edition = "2021"

[workspace.dependencies]
differential-dataflow = { path = "differential-dataflow", default-features = false, version = "0.19.1" }
timely = { version = "0.26", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion differential-dataflow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/TimelyDataflow/differential-dataflow.git"
keywords = ["differential", "dataflow"]
license = "MIT"
readme = "../README.md"
edition="2021"
edition.workspace = true

[dev-dependencies]
rand="0.4"
Expand Down
2 changes: 1 addition & 1 deletion dogsdogsdogs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "differential-dogs3"
version = "0.19.1"
authors = ["Frank McSherry <fmcsherry@me.com>"]
license = "MIT"
edition = "2021"
edition.workspace = true
description = "Advanced join patterns in differential dataflow"

documentation = "https://docs.rs/differential-dogs3"
Expand Down
2 changes: 1 addition & 1 deletion doop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "doop"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion experiments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "experiments"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion interactive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "interactive"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
9 changes: 9 additions & 0 deletions mdbook/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "mdbook"
version = "0.0.0"
edition.workspace = true
publish = false

[dependencies]
differential-dataflow = { path = "../differential-dataflow" }
timely.workspace = true
46 changes: 46 additions & 0 deletions mdbook/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//! Infrastructure to test the mdbook documentation.
//!
//! Generates a module for each Markdown file in the `src/` directory, and includes
//! the contents of each file as a doc comment for that module.

use std::env;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};

/// Recursively finds all Markdown files in the given path and collects their paths into `mds`.
fn find_mds(dir: impl AsRef<Path>, mds: &mut Vec<PathBuf>) -> io::Result<()> {
for entry in fs::read_dir(dir)? {
let path = entry?.path();
if path.is_dir() {
find_mds(path, mds)?;
} else if path.extension().and_then(|s| s.to_str()) == Some("md") {
mds.push(path);
}
}
Ok(())
}

fn main() -> io::Result<()> {
let mut mds = Vec::new();
find_mds("src", &mut mds)?;

let mut lib = String::new();

for md in mds {
let md_path = md.to_str().unwrap();
println!("cargo::rerun-if-changed={md_path}");
let mod_name = md_path.replace(['/', '\\', '-', '.'], "_");
use std::fmt::Write;
writeln!(
&mut lib,
"#[allow(non_snake_case)] #[doc = include_str!(concat!(env!(\"CARGO_MANIFEST_DIR\"), r\"{}{md_path}\"))] mod {mod_name} {{}}",
std::path::MAIN_SEPARATOR,
).unwrap();
}

let dest_path = Path::new(&env::var("OUT_DIR").unwrap()).join("mdbook.rs");
fs::write(&dest_path, lib)?;
println!("cargo::rerun-if-changed=build.rs");
Ok(())
}
2 changes: 2 additions & 0 deletions mdbook/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//! Dummy library file to allow testing the mdbook documentation.
include!(concat!(env!("OUT_DIR"), "/mdbook.rs"));
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "dd_server"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion server/dataflows/degr_dist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "degr_dist"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion server/dataflows/neighborhood/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "neighborhood"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion server/dataflows/random_graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "random_graph"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion server/dataflows/reachability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "reachability"
version = "0.1.0"
authors = ["Frank McSherry <fmcsherry@me.com>"]
edition = "2021"
edition.workspace = true
publish = false

[dependencies]
Expand Down