On Wed, May 18, 2022 at 12:53:53PM +0000, Alyssa Ross wrote:
On Wed, May 18, 2022 at 03:44:45PM +0300, Ville Ilvonen wrote:
On Tue, May 17, 2022 at 10:00 PM Paco <paco@ecomail.io> wrote:
Hi all,
One question about draw.io: is there a tool we could use in the build process of our documentation to render the .drawio files to SVG, so we don't have to check in the SVG files?
drawio supports being called on the command-line like this:
drawio in.drawio --export --output out.png # or svg
Yes, and no. Yes, command line but no in a headless environment. It was easy to test this before "jekyll build" with "drawio in.drawio --export --output test.svg"
However,
[vilvo@blop:~/dev/spectrum/Documentation]$ nix-build -I nixpkgs=../../nixpkgs-spectrum ... error: builder for '/nix/store/r8xf2kpba673ngi2fck4xsyvyc6pd3j1-spectrum-docs.drv' failed with exit code 133; last 10 log lines: > at new ElectronStore (/nix/store/iqinmbk2jzl8nay42hqkbd32mbj1jzq7-drawio-18.0.6/share/drawio/resources/app.asar/node_modules/electron-store/index.js:48:32) > at Object.<anonymous> (/nix/store/iqinmbk2jzl8nay42hqkbd32mbj1jzq7-drawio-18.0.6/share/drawio/resources/app.asar/electron.js:15:15) > at Module._compile (node:internal/modules/cjs/loader:1116:14) > at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10) > at Module.load (node:internal/modules/cjs/loader:988:32) > at Module._load (node:internal/modules/cjs/loader:829:12) > at Function.c._load (node:electron/js2c/asar_bundle:5:13343) > at Object.<anonymous> (node:electron/js2c/browser_init:185:3104) > at Object../lib/browser/init.ts (node:electron/js2c/browser_init:185:3308) > /build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 1: 5 Trace/breakpoint trap (core dumped) drawio in.drawio --export --output test.svg
Issue is the same with drawio versions: - version 15.7.3 from nixpkgs - version 17.4.2 from nixpkgs-spectrum - latest rpm available - 18.0.6 from updated nixpkgs-spectrum
Does it maybe require an X server / Wayland compositor to talk to? That would be a pain to do in the build but maybe not impossible. I know there are programs for dummy compositors out there but don't know how easy they are to use.
Actually, this looking more closely at the stack trace, this is more likely to be it not having a writeable XDG_CONFIG_HOME or HOME directory. So you could try setting those to temporary directories in the build. Something like export XDG_CONFIG_HOME="$(mktemp -d)"