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

🚸 Improve error message for cyclic flows #595

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Aug 8, 2024

The error trace given is something like:

/.../include/flow/graph_builder.hpp:150:27: fatal error: static assertion failed due to requirement 'built.has_value()': Topological so
rt failed: cycle in flow
  150 |             static_assert(built.has_value(),
      |                           ^~~~~~~~~~~~~~~~~
/.../include/flow/graph_builder.hpp:155:39: note: in instantiation of member function 'flow::graph_builder<flow::impl>::built_flow<cib:
:initialized<(anonymous namespace)::CyclicFlowConfig, (anonymous namespace)::TestFlowAlpha>>::built' requested here
  155 |         constexpr static auto run() { built()(); }
      |                                       ^
/.../include/flow/graph_builder.hpp:160:53: note: in instantiation of member function 'flow::graph_builder<flow::impl>::built_flow<cib:
:initialized<(anonymous namespace)::CyclicFlowConfig, (anonymous namespace)::TestFlowAlpha>>::run' requested here
  160 |         constexpr auto operator()() const -> void { run(); }
      |                                                     ^
/.../test/flow/fail/cyclic_flow.cpp:22:33: note: in instantiation of member function 'flow::graph_builder<flow::impl>::built_flow<cib::
initialized<(anonymous namespace)::CyclicFlowConfig, (anonymous namespace)::TestFlowAlpha>>::operator()' requested here
   22 |     nexus.service<TestFlowAlpha>();
      |                                 ^

So the flow that fails (TestFlowAlpha) is in the output just after the static_assert message.

@elbeno elbeno force-pushed the flow-graph-cycle branch from 847a6e4 to 6365d39 Compare August 8, 2024 22:45
@elbeno elbeno enabled auto-merge August 9, 2024 17:29
@elbeno elbeno merged commit 5b8cb6e into intel:main Aug 12, 2024
22 checks passed
@elbeno elbeno deleted the flow-graph-cycle branch August 12, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants