Skip to content

Use SDK directory for environment command search - #55925

Merged
baronfel merged 1 commit into
mainfrom
copilot/environment-provider-sdk-directory
Aug 28, 2026
Merged

Use SDK directory for environment command search#55925
baronfel merged 1 commit into
mainfrom
copilot/environment-provider-sdk-directory

Conversation

@baronfel

Copy link
Copy Markdown
Member

Summary

  • use SdkPaths.SdkDirectory as the first default executable search path in EnvironmentProvider
  • keep explicit search-path overrides and PATH lookup behavior unchanged
  • add host-independent managed and NativeAOT regression coverage

Stacked on #55923; merge that PR first.

Testing

  • focused managed EnvironmentProviderTests
  • NativeAOT-published EnvironmentProviderTests
  • Microsoft.DotNet.Cli.Utils.Tests (230 passed, 6 skipped)
  • Microsoft.DotNet.Cli.Utils build for net11.0 and net472

@baronfel
baronfel requested a review from a team as a code owner August 25, 2026 18:43
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@baronfel baronfel added the Area-dotnet AOT Items that are part of the dotnet CLI AOT-ification effort label Aug 25, 2026
Copilot AI lite review requested due to automatic review settings August 25, 2026 21:52
@baronfel
baronfel force-pushed the copilot/environment-provider-sdk-directory branch from a6d604d to a040b21 Compare August 25, 2026 21:52

Copilot AI 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.

Pull request overview

Updates the CLI utility EnvironmentProvider to prefer the versioned SDK directory (via SdkPaths.SdkDirectory) as the first location for executable discovery, aligning command lookup behavior with the SDK-root resolution used by the NativeAOT bridge.

Changes:

  • Switch default executable search precedence from AppContext.BaseDirectory to SdkPaths.SdkDirectory.
  • Add a NativeAOT regression test that asserts commands are discovered from the versioned SDK directory first.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/dotnet-aot.Tests/EnvironmentProviderTests.cs Adds regression coverage for SDK-directory-first command discovery.
src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs Changes default command search root to the versioned SDK directory.

Comment thread test/dotnet-aot.Tests/EnvironmentProviderTests.cs
Base automatically changed from copilot/baronfel/fix-aot-forwarding-paths to main August 26, 2026 15:34
@baronfel
baronfel requested review from a team as code owners August 26, 2026 15:34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6929a73-7e24-4f78-830c-f6ae2a14b812
@baronfel
baronfel force-pushed the copilot/environment-provider-sdk-directory branch from a040b21 to 0712e3f Compare August 26, 2026 15:34
@baronfel

Copy link
Copy Markdown
Member Author

@dsplaisted ok, this one is green now too after base branch merges

@Evangelink Evangelink left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No actionable issues found.

Note

This review content was generated with AI assistance.

@baronfel
baronfel merged commit bdcce39 into main Aug 28, 2026
17 of 18 checks passed
@baronfel
baronfel deleted the copilot/environment-provider-sdk-directory branch August 28, 2026 13:49
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-CLI Area-dotnet AOT Items that are part of the dotnet CLI AOT-ification effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants