dotnet / dotnet/arcade

GenerateNativeVersionFile should only run when the TargetOS is windows-like

Open
#15,496 0 comments 0 reactions 0 assignees View on GitHub
up-for-grabs
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

The condition below will cause the target to run on Windows regardless if you're cross compiling or not.

https://github.com/dotnet/arcade/blob/91630b31ce859c28f637b62b566ea8829b982f2c/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets#L63

To date, that's been ok because building on windows has only dealt with windows-like targets. https://github.com/dotnet/runtime/pull/112256 enables building for android on windows and so the condition above no longer holds.

We should utilize the Unified Build [output controls](https://github.com/dotnet/arcade/blob/7ae3923f26bb1c5406c75446764a9e8dcaf6126c/Documentation/UnifiedBuild/Unified-Build-Controls.md#output-controls) and fall back to the HostOS if the TargetOS is not specified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.