Skip to content

headless platform fallback - #257

Open
SimonDanisch wants to merge 2 commits into
masterfrom
sd/headless-platform-fallback
Open

SimonDanisch wants to merge 2 commits into
masterfrom
sd/headless-platform-fallback

Conversation

@SimonDanisch

Copy link
Copy Markdown
Member

Continuation of: #256

May need to be tagged as 4.0, since otherwise Makie will print bogous error messages on some platforms.

NittanyLion and others added 2 commits August 12, 2026 00:29
GLFW.jl calls glfwInit() from __init__, so on a machine with no display
server -- headless CI, cluster nodes, batch jobs -- merely loading the
package (or any package that depends on it) throws an InitError, and it
cannot even be precompiled there. Downstream packages get no chance to
handle the situation themselves.

GLFW 3.4's NULL platform exists for exactly this case and initializes
without a display. When the default platform fails and the user has not
requested a platform explicitly, retry with PLATFORM_NULL and warn: the
package loads, windows cannot be created or shown, and downstream code
can detect the state with GLFW.GetPlatform() == GLFW.PLATFORM_NULL.

An explicit JULIA_GLFW_PLATFORM is honored as stated: if the requested
platform cannot be initialized, loading fails as before rather than
being second-guessed. Behavior with a working display is unchanged.

Fixes #169. Addresses the load-time layer of #200 and #253.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants