Skip to content
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

fix graph feature, release v0.0.6 #30

Merged
merged 2 commits into from
Feb 2, 2023
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["orchestra", "metered-channel", "orchestra/proc-macro"]
[workspace.package]
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
version = "0.0.5"
version = "0.0.6"
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/paritytech/orchestra"
2 changes: 1 addition & 1 deletion orchestra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ futures = "0.3"
async-trait = "0.1"
thiserror = "1"
metered = { package = "prioritized-metered-channel", version = "0.2.0", path = "../metered-channel" }
orchestra-proc-macro = { version = "0.0.5", path = "./proc-macro" }
orchestra-proc-macro = { version = "0.0.6", path = "./proc-macro" }
futures-timer = "3.0.2"
pin-project = "1.0"
dyn-clonable = "0.9"
Expand Down
10 changes: 5 additions & 5 deletions orchestra/proc-macro/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ pub(crate) struct ConnectionGraph<'a> {
/// the receiver of the message.
pub(crate) graph: Graph<Ident, Path>,
/// Cycles within the graph
#[cfg_attr(not(feature = "graph"), allow(dead_code))]
#[cfg_attr(not(feature = "dotgraph"), allow(dead_code))]
pub(crate) sccs: Vec<Vec<NodeIndex>>,
/// Messages that are never being sent (and by which subsystem), but are consumed
/// Maps the message `Path` to the subsystem `Ident` represented by `NodeIndex`.
#[cfg_attr(not(feature = "graph"), allow(dead_code))]
#[cfg_attr(not(feature = "dotgraph"), allow(dead_code))]
pub(crate) unsent_messages: HashMap<&'a Path, (&'a Ident, NodeIndex)>,
/// Messages being sent (and by which subsystem), but not consumed by any subsystem
/// Maps the message `Path` to the subsystem `Ident` represented by `NodeIndex`.
#[cfg_attr(not(feature = "graph"), allow(dead_code))]
#[cfg_attr(not(feature = "dotgraph"), allow(dead_code))]
pub(crate) unconsumed_messages: HashMap<&'a Path, Vec<(&'a Ident, NodeIndex)>>,
}

Expand Down Expand Up @@ -180,7 +180,7 @@ impl<'a> ConnectionGraph<'a> {
/// Render a graphviz (aka dot graph) to a file.
///
/// Cycles are annotated with the lower
#[cfg(feature = "graph")]
#[cfg(feature = "dotgraph")]
pub(crate) fn graphviz(self, dest: &mut impl std::io::Write) -> std::io::Result<()> {
use self::graph_helpers::*;
use petgraph::{
Expand Down Expand Up @@ -344,7 +344,7 @@ fn greek_alphabet() -> [char; GREEK_ALPHABET_SIZE] {
alphabet
}

#[cfg(feature = "graph")]
#[cfg(feature = "dotgraph")]
mod graph_helpers {
use super::HashMap;

Expand Down
2 changes: 1 addition & 1 deletion orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub(crate) fn impl_subsystem_types_all(info: &OrchestraInfo) -> Result<TokenStre
}

// Write the graph to file.
#[cfg(feature = "graph")]
#[cfg(feature = "dotgraph")]
{
let path = std::path::PathBuf::from(env!("OUT_DIR"))
.join(orchestra_name.to_string().to_lowercase() + "-subsystem-messaging.dot");
Expand Down