Skip to content

FIX: [Port] Fixed CS0117 'remoteConnection' compile error in release Player builds with UNITY_INCLUDE_TESTS - #2508

Merged
Pauliusd01 merged 3 commits into
developfrom
input/port-remote-connection-include-tests-release-build
Dec 3, 2026
Merged

Pauliusd01 merged 3 commits into
developfrom
input/port-remote-connection-include-tests-release-build

Conversation

@unitydavidlo

@unitydavidlo unitydavidlo commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Port of a fix that is already in trunk (ISX-2788).

The problem: if a project sets the UNITY_INCLUDE_TESTS scripting define and makes a normal (non-development) Player build, it fails to compile:

InputSystemTestHooks.cs(38,29): error CS0117: 'InputSystem' does not contain a definition for 'remoteConnection'

Why: InputSystemTestHooks.cs (new in 1.20.0) is compiled whenever UNITY_INCLUDE_TESTS is set, and it uses InputSystem.remoteConnection. But remoteConnection only exists when DEBUG is defined, and DEBUG is only defined in development builds. So a non-development build with UNITY_INCLUDE_TESTS has the code that uses the property, but not the property itself.

A customer hit this after updating from 6000.3.7f1 to 6000.3.28f1 with Input System 1.20.1.

The fix:

  • remoteConnection is now always declared, not just in DEBUG builds.
  • Players still only turn on remoting in development builds. This is now checked at runtime with Debug.isDebugBuild instead of #if DEBUG.

Testing status & QA

I made a normal macOS Player build with Unity 6000.3.25f1, with UNITY_INCLUDE_TESTS set:

Package Result
develop before this change Fails with the error above
This branch Builds fine
1.19.0 Builds fine

QA suggestion:

  • Make a non-development Player build with UNITY_INCLUDE_TESTS set. It should compile.
  • Check that Input remoting from a development Player to the Editor still works.

There's no automated test. Our CI only makes development builds for tests, and those always define DEBUG, so a test would never hit this. Catching it would need a new CI job that makes a non-development build. That can be a follow-up.

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low. Remoting behaves the same as before: on in development Players, off in release Players.

Comments to reviewers

Only the InputSystem.cs change from the trunk fix is ported. The other files in that trunk change only apply to trunk. It merged onto develop with no conflicts.

There's no issue-tracker case yet. I'll add the ID to the title and changelog once there is one.

This PR was prepared by Claude Code (an AI coding agent).

Checklist

Before review:

  • Changelog entry added.
  • Tests added/changed, if applicable. (Not added. See Testing status.)
  • Docs for new/changed API's. (Not applicable: no API changes.)

During merge:

  • Commit message for squash-merge is prefixed with FIX: ___.

🤖 Generated with Claude Code

…Player builds with UNITY_INCLUDE_TESTS

InputSystemTestHooks.cs compiles under UNITY_EDITOR || UNITY_INCLUDE_TESTS but
accessed InputSystem.remoteConnection, which was only declared under #if DEBUG.
Non-development Player builds with UNITY_INCLUDE_TESTS failed to compile.

Port of the guard change from trunk (ISX-2788): remoteConnection is always
declared, and remoting is enabled in Players based on Debug.isDebugBuild.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cla-assistant-unity

cla-assistant-unity Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Ship it

The change resolves the test-hook guard mismatch while preserving development-build gating for automatic Player remoting. I examined the compilation guards, remoting dependencies, Player and Editor initialization paths, and changelog.

Reviewed commit 44892a2

🤖 Helpful? 👍/👎

@codecov-github-com

codecov-github-com Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2508      +/-   ##
===========================================
- Coverage    79.22%   79.22%   -0.01%     
===========================================
  Files          769      769              
  Lines       141295   141300       +5     
===========================================
- Hits        111944   111938       -6     
- Misses       29351    29362      +11     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.90% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.3 5.31% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.89% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.6 5.30% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.6_project 77.96% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0 5.31% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.81% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3 5.31% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.80% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.6 5.30% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.86% <ø> (-0.02%) ⬇️
inputsystem_Windows_6000.0 5.31% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 78.02% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.3 5.31% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 78.01% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.6 5.30% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.6_project 78.08% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ity.inputsystem/InputSystem/Runtime/InputSystem.cs 81.61% <ø> (-0.70%) ⬇️

... and 1 file with indirect coverage changes

ℹ️ Need help interpreting these results?

unitydavidlo and others added 2 commits November 24, 2026 10:32
…connection-include-tests-release-build

# Conflicts:
#	Packages/com.unity.inputsystem/CHANGELOG.md
@Pauliusd01
Pauliusd01 merged commit d77539b into develop Dec 3, 2026
69 checks passed
@Pauliusd01
Pauliusd01 deleted the input/port-remote-connection-include-tests-release-build branch December 3, 2026 10:22
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.

3 participants