aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

DocGen dependency diagram generator has unresolved `dot` dependency

Open alnoki opened this issue 3 years ago • 2 comments

(econia) econia % aptos move document --include-dep-diagram 
Compiling, may take a little while to download git dependencies...
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING Econia
error: The Graphviz tool "dot" is not available. No such file or directory (os error 2)
  ┌─ <unknown>:1:1
  │
1 │ <unknown>
  │ ^^^^^^^^^

{
  "Error": "Unexpected error: documentation generation failed"
}

alnoki avatar Nov 15 '22 22:11 alnoki

@wrwg @alinush @davidiw @gregnazario

alnoki avatar Nov 15 '22 22:11 alnoki

@junkil-park who build this feature a while ago.

I think the user is responsible for installing this, but the error message could be nice.

wrwg avatar Nov 15 '22 22:11 wrwg

This should be added to the dev_setup.sh script for the prover. @junkil-park can you ensure it's there?

gregnazario avatar Dec 21 '22 06:12 gregnazario

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Feb 05 '23 02:02 github-actions[bot]

Did this get resolved @junkil-park ?

gregnazario avatar Feb 05 '23 10:02 gregnazario

The command to install the graphviz dot has been included in the prover_setup.sh script: https://github.com/aptos-labs/aptos-core/blob/main/developer-docs-site/static/scripts/prover_setup.sh#L352

junkil-park avatar Mar 17 '23 09:03 junkil-park

And, here is a PR to add graphviz to dev_setup.sh in aptos_core: https://github.com/aptos-labs/aptos-core/pull/7237

junkil-park avatar Mar 17 '23 09:03 junkil-park

@junkil-park After brew installing graphviz I'm pleased to report that the command from the issue description now runs.

I see that the generated forward- and backward-dependency SVG diagrams are only at the module level, though: is there anyway to get function dependencies inside of a module (example)?

alnoki avatar Mar 21 '23 19:03 alnoki

@alnoki , thank you. Move's docgen can generate and incorporate the function call diagrams. For example, https://github.com/aptos-labs/aptos-core/blob/doc-with-diagrams/aptos-move/framework/aptos-framework/doc/account.md#function-rotate_authentication_key_internal. However, Aptos CLI does not expose the feature to users currently. I will work on this next. Before doing that, I would like to hear your ideas/feedback. I will contact to you via email.

junkil-park avatar Mar 22 '23 22:03 junkil-park

@alnoki , thank you. Move's docgen can generate and incorporate the function call diagrams. For example, https://github.com/aptos-labs/aptos-core/blob/doc-with-diagrams/aptos-move/framework/aptos-framework/doc/account.md#function-rotate_authentication_key_internal. However, Aptos CLI does not expose the feature to users currently. I will work on this next. Before doing that, I would like to hear your ideas/feedback. I will contact to you via email.

Sounds good, thanks! Do these function diagrams also include calls to other modules? e.g. another_module::a_called_function?

alnoki avatar Mar 23 '23 17:03 alnoki

@alnoki, yes, it does. In this diagram, different boxes represent different modules: https://raw.githubusercontent.com/aptos-labs/aptos-core/doc-with-diagrams/aptos-move/framework/aptos-framework/doc/img/account_rotate_authentication_key_internal_forward_call_graph.svg

junkil-park avatar Mar 23 '23 22:03 junkil-park

@alnoki, yes, it does. In this diagram, different boxes represent different modules: https://raw.githubusercontent.com/aptos-labs/aptos-core/doc-with-diagrams/aptos-move/framework/aptos-framework/doc/img/account_rotate_authentication_key_internal_forward_call_graph.svg

@junkil-park awesome, thanks!

alnoki avatar Mar 23 '23 22:03 alnoki