danini-the-panini / mittsu

3D Graphics Library for Ruby.
https://github.com/danini-the-panini/mittsu
MIT License
508 stars 33 forks source link

Console errors on require in Docker #127

Open Floppy opened 2 months ago

Floppy commented 2 months ago

I've seen these errors for a while, but only just realised they're coming from mittsu. When running inside my app's Docker container, which is based on Alpine Linux, I get this output:

/usr/src/app # bundle exec irb
irb(main):001> require 'mittsu'
Illegal option -p
sh: lspci: not found
Illegal option -p
sh: lspci: not found

Looks like the first one is ldconfig, presumably from https://github.com/danini-the-panini/mittsu/blob/b0bf979e4ca2d2c122a9b7cad3689c998b66ddfd/lib/mittsu/renderers/glfw_lib.rb#L19.

/usr/src/app # ldconfig -p
Illegal option -p

Second one is lspci at https://github.com/danini-the-panini/mittsu/blob/b0bf979e4ca2d2c122a9b7cad3689c998b66ddfd/lib/mittsu/renderers/generic_lib.rb#L35

I'm assuming as both these have rescues after them, it's not a showstopper if they fail. So we could just suppress the output.

danini-the-panini commented 2 months ago

That makes sense. Should be relatively straightforward.

I think it would be beneficial to still output as a warning if the debug env var is set.

Floppy commented 2 months ago

Yep, good call.