Skip to content

Changing PATH is a no-op in non-windows platforms.#10094

Closed
MrSoup678 wants to merge 2 commits intoFacepunch:masterfrom
MrSoup678:noop_path_linux
Closed

Changing PATH is a no-op in non-windows platforms.#10094
MrSoup678 wants to merge 2 commits intoFacepunch:masterfrom
MrSoup678:noop_path_linux

Conversation

@MrSoup678
Copy link
Copy Markdown
Contributor

@MrSoup678 MrSoup678 commented Feb 27, 2026

Pull Request

Thanks for contributing to s&box ❤️
Please fill out the sections below to help us review your change efficiently.


Summary

Motivation & Context

Fixes:

Implementation Details

Screenshots / Videos (if applicable)

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I’m okay with this PR being rejected or requested to change 🙂

Copilot AI review requested due to automatic review settings February 27, 2026 14:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts launcher environment setup so that PATH mutation is only applied on Windows, avoiding ineffective (and potentially confusing) behavior on other platforms.

Changes:

  • Gate PATH-prepending logic behind OperatingSystem.IsWindows() in UpdateNativeDllPath.
  • Add an extra using (currently unused) related to interop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

var path = System.Environment.GetEnvironmentVariable( "PATH" );
path = $"{nativeDllPath};{path}";
System.Environment.SetEnvironmentVariable( "PATH", path );
if (OperatingSystem.IsWindows())
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Formatting is inconsistent with the surrounding codebase style (spaces inside parentheses): if (OperatingSystem.IsWindows()) vs if ( OperatingSystem.IsWindows() ) used elsewhere in this file. Please align the spacing for consistency (and to match any .editorconfig formatting rules).

Suggested change
if (OperatingSystem.IsWindows())
if ( OperatingSystem.IsWindows() )

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +82
if (OperatingSystem.IsWindows())
{
var path = System.Environment.GetEnvironmentVariable( "PATH" );
path = $"{nativeDllPath};{path}";
System.Environment.SetEnvironmentVariable( "PATH", path );
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The comment above this block implies we’re adjusting lookup behavior unconditionally, but this now only happens on Windows. Consider updating the comment to explicitly note the Windows-only PATH modification (and rely on NetCore.NativeDllPath for other platforms) to avoid misleading future readers.

Copilot uses AI. Check for mistakes.
@@ -1,5 +1,6 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

using System.Runtime.InteropServices; appears unused in this file (no references to RuntimeInformation, NativeLibrary, DllImport, etc.). Please remove it to avoid analyzer warnings and keep the import list minimal.

Suggested change
using System.Runtime.InteropServices;

Copilot uses AI. Check for mistakes.
@MrSoup678 MrSoup678 mentioned this pull request Feb 27, 2026
5 tasks
@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Mar 25, 2026
@sboxbot
Copy link
Copy Markdown
Contributor

sboxbot commented Apr 7, 2026

This PR has been merged upstream.

@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Apr 7, 2026
@sboxbot sboxbot closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants