Skip to content

Fix connector cross-platform dotnet-host lookup and win-x64-hardcoded packaging - #21

Merged
clrudolphi merged 1 commit into
masterfrom
fix/connector-cross-platform-packaging
Jul 2, 2026
Merged

Fix connector cross-platform dotnet-host lookup and win-x64-hardcoded packaging#21
clrudolphi merged 1 commit into
masterfrom
fix/connector-cross-platform-packaging

Conversation

@clrudolphi

Copy link
Copy Markdown
Collaborator

Summary

  • OutProcReqnrollConnector resolved the dotnet host via Windows-only Program Files env vars and a hardcoded dotnet.exe, so every net6.0+ discovery call would fail to launch on a non-Windows LSP server. Now branches on OperatingSystem.IsWindows(), falling back to DOTNET_ROOT/PATH-resolved dotnet on Linux/macOS.
  • The connector's staged build output was copied into a literal .../win-x64/Connectors/... path regardless of the RID the server was actually published for, so linux-x64/osx-x64/osx-arm64 publishes silently shipped with no connectors at all. The server's RuntimeIdentifier is now threaded through to the connector build (via a new _ConnectorServerRid property), while RuntimeIdentifier/SelfContained are explicitly cleared for that nested build since the connector itself must stay a framework-dependent, per-TFM build.

Fixes #19.

Test plan

  • dotnet build of the server project for the default win-x64 RID still succeeds and stages connectors correctly.
  • dotnet build -p:RuntimeIdentifier=linux-x64 now succeeds (previously failed with NETSDK1201 due to global-property leakage) and stages connectors under .../linux-x64/Connectors/....
  • dotnet test on Reqnroll.IdeSupport.LSP.Server.Tests (Connector-related tests): 46 passed, 0 failed (43 existing + 3 new).
  • Updated two existing tests that hardcoded dotnet.exe in assertions to be OS-aware, since that's now legitimately platform-dependent behavior.
  • Added unit tests for the extracted ResolveNonWindowsDotNetCommand pure function (null/empty/set DOTNET_ROOT).
  • No new test needed for the packaging path fix — the existing publish-server CI matrix job (win-x64/linux-x64/osx-x64/osx-arm64) already exercises this exact scenario on every PR touching src/LSP/**.

🤖 Generated with Claude Code

… packaging

OutProcReqnrollConnector resolved the dotnet host via Windows-only Program
Files env vars and a hardcoded "dotnet.exe", so every net6.0+ discovery call
would fail to launch on a non-Windows LSP server. Separately, the connector's
staged build output was copied into a literal ".../win-x64/Connectors/..."
path regardless of which RID the server was actually being published for, so
linux-x64/osx-x64/osx-arm64 publishes silently shipped without any connectors.

Thread the server's RuntimeIdentifier through to the connector build (while
clearing RuntimeIdentifier/SelfContained for that nested build, since the
connector itself stays a framework-dependent per-TFM build) so packaging
matches the RID actually being published, and branch the dotnet host lookup
on OperatingSystem.IsWindows() with a DOTNET_ROOT/PATH fallback for Linux/macOS.

Fixes #19.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@clrudolphi
clrudolphi merged commit c3a18d2 into master Jul 2, 2026
6 checks passed
@clrudolphi
clrudolphi deleted the fix/connector-cross-platform-packaging branch July 2, 2026 19:58
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.

Reflection Connector: dotnet host lookup and packaging are hardcoded to win-x64

1 participant