dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.21k stars 4.72k forks source link

Problem with ComInterfaceGenerator.Tests build #96572

Open BruceForstall opened 9 months ago

BruceForstall commented 9 months ago

The build of ComInterfaceGenerator.Tests creates architecture-specific files, but places them in an architecture-independent directory.

Specifically, the test build lives in artifacts\bin\ComInterfaceGenerator.Tests\Release\net9.0. One of the architecture-specific files is microsoft.interop.tests.nativeexports.dll. If you build win-x64, then microsoft.interop.tests.nativeexports.dll will be a Windows x64 native binary. If you then build win-x86, microsoft.interop.tests.nativeexports.dll will be overwritten with a Windows x86 native image.

This is undesirable and confusing. It should be possible to build for all architectures (e.g., win-x64, win-x86, win-arm64) in the same source tree and end up with assets for all built platforms.

I notice that some libraries tests do appear to have platform-specific subdirectories, e.g., artifacts\bin\System.Data.Common.Tests\Release\net9.0\runtimes\win-x64\native.

ghost commented 9 months ago

Tagging subscribers to this area: @dotnet/interop-contrib See info in area-owners.md if you want to be subscribed.

Issue Details
The build of ComInterfaceGenerator.Tests creates architecture-specific files, but places them in an architecture-independent directory. Specifically, the test build lives in artifacts\bin\ComInterfaceGenerator.Tests\Release\net9.0. One of the architecture-specific files is microsoft.interop.tests.nativeexports.dll. If you build win-x64, then microsoft.interop.tests.nativeexports.dll will be a Windows x64 native binary. If you then build win-x86, microsoft.interop.tests.nativeexports.dll will be **overwritten** with a Windows x86 native image. This is undesirable and confusing. It should be possible to build for all architectures (e.g., win-x64, win-x86, win-arm64) in the same source tree and end up with assets for all built platforms. I notice that some libraries tests do appear to have platform-specific subdirectories, e.g., artifacts\bin\System.Data.Common.Tests\Release\net9.0\runtimes\win-x64\native.
Author: BruceForstall
Assignees: jkoritzinsky
Labels: `area-System.Runtime.InteropServices`, `test-bug`
Milestone: -