charmbracelet / freeze

Generate images of code and terminal output 📸
MIT License
2.98k stars 50 forks source link

"ERROR Unable to convert SVG to PNG" on short groovy file #66

Open alastair-drong-wd opened 3 months ago

alastair-drong-wd commented 3 months ago

Describe the bug I was hoping for slightly improved syntax highlighting on a groovy file by specifying the language java. freeze exited with message ERROR Unable to convert SVG to PNG (exit code 1) when generating a PNG.

My experience is that one out of every 200 groovy files behaves this way.

user@shell$ freeze abapEnvironmentPushATCSystemConfig.groovy -l java -o /tmp/butts.png
thread '<unnamed>' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:524:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

   ERROR  Unable to convert SVG to PNG

  wasm error: unreachable
  wasm stack trace:
      .$831()
      .$327(i32,i32,i32,i32,i32)
      .$839(i32)
      .$838(i32)
      .$168(i32)
      .$131(i32,i32)
      .$65()
      .$47(i32,i32,i32)
      .$909(i32,i32,i32)
      .$98(i32,i32)
      .$97(i32,i32)
      .$1626(i32,i32)

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/SAP/jenkins-library.git
  2. cd jenkins-library/vars
  3. freeze abapEnvironmentPushATCSystemConfig.groovy -l java -o /tmp/x.png
  4. See error

Expected behavior An SVG can be created without issue and visually looks correct, so freeze should be able to generate a png without error.

Screenshots n/a

Desktop (please complete the following information):

Smartphone (please complete the following information): n/a

Additional context Add any other context about the problem here.