Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions patchwise/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ def start_clangd_lsp(

self.logger.debug(f"Docker command: {' '.join(docker_command)}")

# Redirect stderr to /dev/null to prevent pipe blocking
process = subprocess.Popen(
docker_command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
bufsize=0, # Unbuffered for real-time LSP communication
universal_newlines=True,
Expand All @@ -333,15 +334,10 @@ def start_clangd_lsp(
# Give clangd a moment to start and check if it's still running
time.sleep(1)
if process.poll() is not None:
# Process died immediately, read stderr for debugging
stderr_output = (
process.stderr.read() if process.stderr else "No stderr available"
)
self.logger.error(
f"clangd process died immediately with return code {process.returncode}"
)
self.logger.error(f"clangd stderr: {stderr_output}")
raise RuntimeError(f"clangd failed to start: {stderr_output}")
raise RuntimeError(f"clangd failed to start (stderr redirected to /dev/null)")

return process

Expand Down
Loading
Loading