dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

BuildEnvironmentHelper Tests With Process Detection Logic Get Confused #7552

Open benvillalobos opened 2 years ago

benvillalobos commented 2 years ago

Issue Description

The new-and-improved process detection logic in BuildEnvironmentHelper confuses tests, which run a "fake" 64-bit MSBuild.exe in an x86 process.

The detection logic:

https://github.com/BenVillalobos/msbuild/blob/525eebc0f31f8c770ad7b1636866aa2a15850e41/src/Shared/BuildEnvironmentHelper.cs#L540-L546

Steps to Reproduce

Un-skip the relevant tests that were disabled in https://github.com/dotnet/msbuild/pull/7550 and run tests.

Expected Behavior

Actual Behavior

Analysis

Versions & Configurations

benvillalobos commented 2 years ago

There might be a property to control the architecture the tests run as.

These tests could probably be replaced with some uber-test that does something to the effect of "given some msbuild.exe in a reasonable directory, can you figure out:

  1. The root
  2. amd64 dir
  3. etc properly?"