Skip to content

go-graphviz v0.5.0 - #56

Merged
apostasie merged 1 commit into
mainfrom
claudio/20261007-go-graphviz-v0.5.0
Oct 8, 2026
Merged

apostasie merged 1 commit into
mainfrom
claudio/20261007-go-graphviz-v0.5.0

Conversation

@closer-claudio

@closer-claudio closer-claudio commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Why

go-graphviz v0.5.0 is tagged; dot's 1.2.0 release ships on it.

🛠️ What

  • go.mod/go.sum: github.com/forkcloser/go-graphviz v0.4.0 → v0.5.0; fogleman/gg and golang/freetype leave the module graph with it.
  • v0.5.0 renamed the DOT outputs: graphviz.XDOT is xdot now (layout plus drawing operations) and plain DOT with positions is graphviz.GV. -Tdot keeps its output by mapping to GV; -Txdot is new. Usage and package doc list it.
  • cmd/dot/main_test.go: TestRenderFormats asserts pos= in both DOT forms and _draw_ in xdot only (it checked the digraph prefix only, which is why the first push of this PR passed with -Tdot emitting xdot).
  • CHANGELOG.md 1.2.0 section: engine v0.5.0, date 2026-10-08, link to the v0.5.0 changelog, -Txdot under Added, and what its users see from 0.5.0 under Changed and Fixed.
  • .gitignore: /dot, the binary go build leaves at the root.

🧪 How

  • V: just lint (all but links, sandbox) and just test green. Built binary: -Tdot has 0 _draw_ lines, -Txdot has 4.
  • U: CI on this PR.

@closer-claudio closer-claudio left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 at 8382fb6, for two reasons. The module bump itself is right; what rides with it is not.

🛑 -Tdot now emits xdot. The body says none of the renamed API, FontLoader or XDOT is referenced. cmd/dot/main.go:85 maps "dot" to graphviz.XDOT, and so does the default at main.go:100. In v0.5.0, XDOT is "xdot" (go-graphviz#78, under Breaking in the 0.5.0 changelog); plain DOT is graphviz.GV. Built from this head, printf 'digraph{a->b}' | dot -Tdot writes four _draw_ lines: the default output of the tool changed from DOT to xdot, and dot -Txdot says unknown format. The tests pass because TestFormats checks only that the output starts with digraph, which xdot does too; I flagged exactly this on go-graphviz#78, and Fluffy's note there said the dot bump would assert on _draw_. Fix: "dot" → graphviz.GV at both sites, add "xdot" → graphviz.XDOT (and the usage line), and have the format test require no _draw_ for -Tdot and _draw_ for -Txdot. -Txdot is then an Added entry for 1.2.0.

🛑 A 12 MB binary is committed. The diff adds dot at the repository root: mode 100755, 12,309,106 bytes, a Mach-O arm64 executable (Bin 0 -> 12309106), the go build output of this checkout. It is not on main, and .gitignore does not list it. Remove it from the commit, and add /dot to .gitignore so the next build can't be committed by accident.

🔍 The bump itself:

  • Both go.sum lines for go-graphviz v0.5.0 match sum.golang.org; gg and freetype leave with it, as #81 removed them. go mod tidy -diff is clean; build, vet and the tests pass.
  • The 1.2.0 section's claims trace to the 0.5.0 changelog: 320 MB → 7 MB and 30 → 13 ms for the 40-node PNG ("half the time"), WebP with alpha, absolute image paths, a setter's error failing the render. The date moves to 2026-10-08.
  • One commit, signed, on the current main.

The engine moves to forkcloser/go-graphviz v0.5.0, which drops
fogleman/gg and golang/freetype from the module graph, draws PNG and
JPEG the way Graphviz's Cairo renderer does, and fixes node images
named by an absolute path and WebP images with alpha. v0.5.0 also
names the two DOT outputs apart: graphviz.XDOT is now xdot, the
layout with its drawing operations, and plain DOT with positions is
graphviz.GV. -Tdot keeps emitting the latter, so it maps to GV, and
-Txdot is new. The render test asserts _draw_ in xdot and not in dot;
it used to check the "digraph" prefix only. The 1.2.0 section names
the engine version and what its users see, and its link follows the
tag. A built binary at the repository root is ignored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: closer-claudio <claudio@farcloser.world>
@closer-claudio
closer-claudio force-pushed the claudio/20261007-go-graphviz-v0.5.0 branch from 8382fb6 to f9e7445 Compare October 8, 2026 06:22

@closer-claudio closer-claudio left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ at f9e7445: both 🛑 are closed.

🔍 Checked on a dot built from this head:

  • "dot" maps to graphviz.GV (and is the default), "xdot" to graphviz.XDOT, with the usage line and the package doc naming both. printf 'digraph{a->b}' | dot -Tdot has 3 pos= lines and 0 _draw_; -Txdot has 4 _draw_. TestRenderFormats requires pos= in both forms and _draw_ in xdot alone, so the prefix-only check that let the regression through is gone.
  • No dot file is tracked, and .gitignore gains /dot with a comment saying why.
  • The CHANGELOG adds -Txdot under Added, keeps -Tdot as positions only, and the body no longer claims XDOT was unreferenced.
  • One squashed commit, signed, on the current main; go.mod/go.sum unchanged from my first pass, hashes matching sum.golang.org.

📝 Renovate's #57 is now redundant and, without this code change, wrong; it's @apostasie's to close once this lands.

@apostasie
apostasie enabled auto-merge October 8, 2026 06:24
@apostasie
apostasie merged commit 877fa0d into main Oct 8, 2026
12 checks passed
@apostasie
apostasie deleted the claudio/20261007-go-graphviz-v0.5.0 branch October 8, 2026 06:30
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