Skip to content

Conversation

nagilson
Copy link
Member

@nagilson nagilson commented Oct 2, 2024

What's this?

When finding the dotnet on the PATH and whether we can use that as the runtime for an extension to run on, we now check whether it matches the architecture that's requested in a given API request.

Resolves #1984

Notes

Some of this code initially existed and I pulled it noting that the architecture check could sometimes have 'Other Architectures' that were not valid, that dotnet --info is subject to change and thus this is flaky, and that certain runtimes and hosts did not print the architecture when running info, such as the 3.1 host.

We had a discussion about how Mac users tend to need the arm64 runtime for C# DevKit and C#, and often have the x64 host installed on their PATH. This was a big concern, and since the check works in the vast majority of scenarios, we decided to go with it anyway. Upon further consideration, most of the time we are only installing .NET 8 and beyond anyways, in which now these issues are fixed, so upon testing it appears we have achieved success here.

Evidence that it works

Will be relying on vendor testing to test in a variety of scenarios with architectures.
They did a pass with a giant testing matrix of every permutation of arch on non-native/native with all combinations to confirm it works for all of them.

image

Here's part of the matrix, with the Mac M1 showing that it works for all directions :)

Additional Changes

Adds the public connection strings like in #1968 to the other package.jsons because it can cause failures to load due to null referencing an invalid propery in package.json

More context: dotnet/runtime#108503

We had a discussion about how Mac users tend to need the arm64 runtime and often have the x64 host installed on their PATH. This was a big concern. With global installs at least we can still rely on the output from `dotnet --info` for now, so we decided to add this back in.
@nagilson nagilson changed the title Fix incorrect PATH logging Check Architecture on .NET FindPath API Oct 10, 2024
@nagilson nagilson marked this pull request as ready for review October 15, 2024 18:10
@nagilson nagilson requested a review from a team October 15, 2024 18:11
@nagilson nagilson requested a review from smitpatel October 15, 2024 23:53
@nagilson nagilson removed the request for review from smitpatel October 16, 2024 18:15
@nagilson
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nagilson nagilson merged commit 2ff7c2a into dotnet:main Oct 22, 2024
9 checks passed
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.

[NETE2ESDK] 'The .NET runtime architecture' doesn't work when using the "Find Path" command.
2 participants