libGL error on RStudio + conda

󰃭 2023-07-06

Again, I encountered shenanigans when running RStudio using base R and packages installed via conda-forge!

This time, the error message is:

TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/xdg/xdg-mate:/etc/xdg/rstudio/logging.conf'. Logging to '/home/ptr/.local/share/rstudio/log/rdesktop.log'.
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)

The issue is fixed by downgrading the version of libffi in the conda environment file to v3.4.2:

  - conda-forge::libffi=3.4.2