Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Rob 馃挌
@robn@social.lol  路  activity timestamp 5 days ago

Trying to make sense of all the relationships described in a big bundle of Makefiles? Don't! Draw them instead!

The #OpenZFS userspace components in the source tree have some fairly complicated interconnections, which I'm slowly working to disentangle. Some complexity is ok, but you want it to be clearly described and labelled. That's what I'm working towards.

It's hard to just open up all the makefiles and draw the connections in your head. It's made more difficult by some libtool quirks that can make surprising things happen when dynamic and static objects are mixed in together.

So, I wrote a little Perl program that scans all the Makefiles and builds up a map of all the interconnections, and then emits a Graphviz DOT file to draw it.

Here's the result! On the left, the linkages on the master branch right now; on the right, the vasty improved version from my cleanup branch (and still lots more to go).

Programs are green, dynamic libs are purple, static libs are orange. The arrow colour is a linkage to an object of that type. That red dashed line on the left is highlighting a place where a static lib is linking to a dynamic lib. This is the trigger for one of those surprising quirks, and it has to go.

I knew it was there from studying the library output, but I couldn't figure out how it was happening. It was worth the time to do this, and now I'm running it over and over as I make changes to peel away the layers.

So yeah, draw pictures. It's fun, and it helps!

Feel free to hack the script for your own ends, if you cbf making your own: https://gist.github.com/robn/7c27c71bdfa773953101de9f60daf0be

Diagram showing dependencies between various OpenZFS executable and library components, after extensive cleanup. Description in the main post. The actual details are hard to describe here but not really relevant.
Diagram showing dependencies between various OpenZFS executable and library components, after extensive cleanup. Description in the main post. The actual details are hard to describe here but not really relevant.
Diagram showing dependencies between various OpenZFS executable and library components, after extensive cleanup. Description in the main post. The actual details are hard to describe here but not really relevant.
Diagram showing dependencies between various OpenZFS executable and library components. Description in the main post. The actual details are hard to describe here but not really relevant.
Diagram showing dependencies between various OpenZFS executable and library components. Description in the main post. The actual details are hard to describe here but not really relevant.
Diagram showing dependencies between various OpenZFS executable and library components. Description in the main post. The actual details are hard to describe here but not really relevant.
  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.1-alpha.8 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login