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

d2 freezes immediately when rendering diagram, after upgrade to v0.6.7 #2140

Open
mradamcox opened this issue Oct 5, 2024 · 5 comments
Open

Comments

@mradamcox
Copy link

mradamcox commented Oct 5, 2024

I just upgraded from v0.6.1 to v0.6.7, and now when I try to render a diagram the process just freezes.

echo "a -> b" > test.d2
d2 test.d2 test.png -d

This prints

debug: using theme Neutral default (ID: 0)

and then just stops. When I ctrl-C to cancel, nothing happens and I eventually just have to close the console.

I reinstalled the older version with

curl -fsSL https://d2lang.com/install.sh | sh -s -- --version v0.6.1

and it now works properly.


I'm on PopOS 22 (Ubuntu) and here's the output from the install

curl -fsSL https://d2lang.com/install.sh | sh -s --
/* installing d2-latest */
log: fetching info on latest version of terrastruct/d2
exec: curl -fL -#o /tmp/tmp.5WPrDLP9B8/78d207313efc3717/release-info.json.inprogress -C- -H 'Accept: application/json' https://api.github.com/repos/terrastruct/d2/releases/latest
##O=#  #                                                                      
exec: mv /tmp/tmp.5WPrDLP9B8/78d207313efc3717/release-info.json.inprogress /tmp/tmp.5WPrDLP9B8/78d207313efc3717/release-info.json
log: installing standalone release d2-v0.6.7-linux-amd64.tar.gz from github
exec: cat "$RELEASE_INFO" | grep -n "$ARCHIVE" | cut -d: -f1 | head -n1
exec: sed -n $((asset_line-3))p "$RELEASE_INFO" | sed "s/^.*: \"\(.*\)\",$/\1/g"
exec: curl -fL -#o ~/.cache/d2/release/d2-v0.6.7-linux-amd64.tar.gz.inprogress -C- -H 'Accept: application/octet-stream' https://api.github.com/repos/terrastruct/d2/releases/assets/195593650
######################################################################## 100.0%
exec: mv ~/.cache/d2/release/d2-v0.6.7-linux-amd64.tar.gz.inprogress ~/.cache/d2/release/d2-v0.6.7-linux-amd64.tar.gz
exec: mkdir -p '$HOME/.local/lib/d2'
exec: tar -C ~/.local/lib/d2 -xzf ~/.cache/d2/release/d2-v0.6.7-linux-amd64.tar.gz
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
exec: sh -c 'cd "$HOME/.local/lib/d2/d2-v0.6.7" && make install PREFIX="$HOME/.local"'
exec: mkdir -p ~/.local/bin
exec: install ./bin/d2 ~/.local/bin/d2
exec: mkdir -p ~/.local/share/man/man1
exec: install ./man/d2.1 ~/.local/share/man/man1
/****************************************************************
 * next steps
 ****************************************************************/
log: d2-v0.6.7-linux-amd64 has been successfully installed into ~/.local
log: Rerun this install script with --uninstall to uninstall.
log
log: Run d2 --help for usage.
log: Run man d2 for detailed docs.
@alixander
Copy link
Collaborator

echo "a -> b" test.d2
d2 test.d2 test.png -d

Is this a copy paste of what you ran? If so, test.d2 doesn't exist (you missed the |) and it should exit saying no such file. But you said 0.6.1 works with that? I'm confused, can you try some versions in between?

@mradamcox
Copy link
Author

Oops, that's my bad, I will correct it above, I typed it in and forgot the >. I will try different versions when I'm back at my laptop. Thanks for the quick reply!

@mradamcox
Copy link
Author

Ok, I'm on better internet now, and apparently that has something to do with what I was experiencing... First, I installed all versions between v0.6.1 and v0.6.7. All up to v0.6.7 do render the d2 graph as expected, but one note is that at v0.6.6 I saw the same tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance warnings as shown above, but never in earlier versions.

As for v0.6.7, what I was experiencing as a freeze before, now seems to be initialization of a Chromium download:

$ d2 test.d2 test.png -d
debug: using theme Neutral default (ID: 0)
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ubuntu22.04-x64.
Downloading Chromium 129.0.6668.29 (playwright build v1134) from https://playwright.azureedge.net/builds/chromium/1134/chromium-linux.zip
164 MiB [====                ] 20% 6.2s
etc.

I was able to cancel this download with ctrl+C without any issue this time around.

I don't see anything about a new dependency like this in the release notes but maybe I just need to have Chromium for d2 to work now? Just looking for clarification on that then.

For my needs I'll be 100% fine with just using v0.6.6, but I am happy to try other tests if that would help you.

@alixander
Copy link
Collaborator

Ah I see. Yeah Playwright is needed for PNG exports unfortunately (https://d2lang.com/tour/exports/#png). It's the only possible way to convert SVGs to PNGs. I'm not sure why it's different on different versions, as that shouldn't have changed...

I'll leave this open in case anyone else runs into the same. I really appreciate you trying each version and the detailed report

@mradamcox
Copy link
Author

Sounds good, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants