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

Plantuml/graphviz crashes on some diagrams on alpine linux arm 64 #2

Open
laughingbiscuit opened this issue Apr 25, 2022 · 8 comments
Labels
c:plantuml-cli plantuml-cli container

Comments

@laughingbiscuit
Copy link

Any ideas what the root cause is? Here is my script to replicate:

#!/bin/sh
set -e
set -x
# display architecture
uname -a

# install java
apk add openjdk8

# Get PlantUML
wget https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar
# Write code
echo -e "@startuml \n database Database {\n}\n@enduml" > example.puml
# Run plantuml
java -jar plantuml-1.2022.4.jar example.puml

Output attached.
output.log.txt
example

@laughingbiscuit
Copy link
Author

laughingbiscuit commented Apr 25, 2022

Note - if testing is required you can install Termux (https://github.com/termux/termux-app) on Android and install alpine with this helper (https://github.com/Hax4us/TermuxAlpine) and run the script above to replicate on any Android 10/11 device. Raspberry Pi on alpine is the same. Not sure about ARM Mac OSs

@soloturn
Copy link

does dot iself work, like described e.g. here:
https://graphviz.org/doc/info/command.html

@laughingbiscuit
Copy link
Author

$ echo 'digraph { a -> b }' | dot > output.svg
There is no layout engine support for "dot"
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?

so it appears to be a problem with dot / graphviz installation via. apk I guess.

However, in my example I did not install dot with a package manager so this problem may be unrelated (https://stackoverflow.com/questions/69377104/unable-to-execute-dot-command-after-installation-of-graphviz-there-is-no-layou). I expected that since the JAR contains graphviz that package manager bugs are not relevant.

I will post back when I get dot working

@laughingbiscuit
Copy link
Author

after downloading the graphviz release and building from source, it works. is there anything we can do to make the packaged graphviz work without this additional step?

@soloturn
Copy link

soloturn commented May 20, 2022

graphviz is not packaged with plantuml, but an optional dependency of the operating system package. e.g. here, arch linux:
https://github.com/archlinux/svntogit-community/blob/packages/plantuml/trunk/PKGBUILD

in alpine i cannot see that the package sets this dependency:
https://git.alpinelinux.org/aports/tree/community/plantuml/APKBUILD

you want to report it there, and close the issue here?

@SpyrosKou
Copy link

SpyrosKou commented Jun 17, 2022

after downloading the graphviz release and building from source, it works. is there anything we can do to make the packaged graphviz work without this additional step?

I understand that this is not an issue of Plantuml but since it is a related and recurring issue to Plantuml usage in Alpine Linux, I would like to continue the conversation by asking the following.
Has anyone identified a faster way of fixing dot in Alpine linux from building graphviz from source?

@arnaudroques arnaudroques transferred this issue from plantuml/plantuml Mar 18, 2023
@evantill evantill added the c:plantuml-cli plantuml-cli container label Mar 18, 2023
@evantill
Copy link
Collaborator

could you try with this released image ?
https://github.com/plantuml/docker/pkgs/container/docker%2Fplantuml-cli
https://github.com/plantuml/docker/tree/main/plantuml-cli

@SpyrosKou
Copy link

SpyrosKou commented Mar 31, 2023

could you try with this released image ? https://github.com/plantuml/docker/pkgs/container/docker%2Fplantuml-cli https://github.com/plantuml/docker/tree/main/plantuml-cli

Thank you for your answer.
It was not directly tried as openjdk:17-alpine had to be used.
An approach that worked was to add the following dependencies.

FROM openjdk:17-alpine
RUN apk --no-cache add graphviz
RUN apk --no-cache add dos2unix
RUN apk add --no-cache fontconfig ttf-dejavu
RUN apk add --no-cache --upgrade bash

Perhaps not all dependencies are strictly required.

However, by looking the Dockerfile in plantuml-cli the two approaches add graphviz and the dejavu fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:plantuml-cli plantuml-cli container
Projects
None yet
Development

No branches or pull requests

4 participants