Repository navigation
fix(cli): keep the display server and stray stderr off the dashboard - #359
Merged
Merged
Conversation
In a shell with DISPLAY set but no usable XAUTHORITY, `xearthlayer run` printed "Authorization required, but no authorization protocol specified" at launch and the line bled into the dashboard; `diagnostics` printed it three times under GPU Compute Adapters. The text is the X server's refusal reason, written by libxcb with a raw write(2) on fd 2, past tracing and ratatui. #255 removed the GL probe; the connections now come from Mesa's VK_LAYER_MESA_device_select (two) and the NVIDIA ICD (one) inside vkCreateInstance, whatever backends wgpu asks for. Two changes: - `system::disown_display()` removes DISPLAY and WAYLAND_DISPLAY from the process environment, called from `main` before any thread exists. XEL never presents to a display and chooses its adapter from `texture.gpu_device`, so the display's answer was never used. With no display named there is nothing to connect to, and enumeration is spared the round trips. Both adapters still enumerate. - `StderrDetour` points fd 2 at the flight log (appended, as tracing's appender is, so the two writers interleave by line) or /dev/null for the dashboard's lifetime, and puts the terminal back when it drops, unless SIGHUP already took it. This closes the class: anything in C that writes to stderr, and a panic message, lands in the log rather than on the screen or lost with the alternate screen. Verified with the release binary under `env -u XAUTHORITY DISPLAY=:0`: `diagnostics` prints the line 0 times (3 before) and lists the same two adapters.
…stderr-358 # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #358
Fix
system::disown_display()removesDISPLAYandWAYLAND_DISPLAYfrom the process environment, called frommainbefore any thread exists. XEarthLayer never presents to a display and chooses its adapter fromtexture.gpu_device, so the display's answer was never used. With no display named, Mesa's device-select layer and the NVIDIA ICD have nothing to connect to, and enumeration is spared the round trips.StderrDetourpoints fd 2 at the flight log (appended, as tracing's appender is) or/dev/nullfor the dashboard's lifetime, and puts the terminal back when it drops unless SIGHUP already took it. Anything in C that writes to stderr, and a panic message, now lands in the log rather than on the screen.Verification
make pre-commitgreen (2669 library tests, 594 CLI tests, clippy clean).env -u XAUTHORITY DISPLAY=:0:diagnosticsprints "Authorization required, but no authorization protocol specified" 0 times (3 before) and lists the same two adapters (RTX 5090, RADV).xearthlayer runlaunched from the tmux shell: dashboard clean.