Uh oh!
There was an error while loading. Please reload this page.
Fix TargetOS value linux instead of Unix - #80794
Conversation
ghost
commented
Jan 18, 2023
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsRegression from 4ece8f0 (see Daily build of SDK ( $ dotnet publish -o dist -p:PublishAot=true
...
foo -> /foo/bin/Debug/net8.0/linux-arm64/foo.dll
Generating native code
Unhandled exception. System.CommandLine.CommandLineException: Target OS 'Unix' is not supported
at System.CommandLine.Helpers.GetTargetOS(String) in /_/src/coreclr/tools/Common/CommandLineHelpers.cs:line 82
at System.CommandLine.Argument`1.<>c__DisplayClass5_0.<.ctor>b__1(ArgumentResult, Object& ) at System.CommandLine.Parsing.ArgumentResult.Convert(Argument) at System.CommandLine.Parsing.ArgumentResult.GetArgumentConversionResult() at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertArgumentResult(ArgumentResult) at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertOptionResult(OptionResult) at System.CommandLine.Parsing.ParseResultVisitor.Stop() at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList`1, String ) at ILCompiler.Program.Main(String[]) in /_/src/coreclr/tools/aot/ILCompiler/Program.cs:line 672 Aborted/root/.nuget/packages/microsoft.dotnet.ilcompiler/8.0.0-alpha.1.23067.2/build/Microsoft.NETCore.Native.targets(281,5): error MSB3073: The command""/root/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.0-alpha.1.23067.2/tools/ilc" @"obj/Debug/net8.0/linux-arm64/native/foo.ilc.rsp"" exited with code 134. [/foo/foo.csproj]copied this block: https://github.com/am11/runtime/blob/feature/nativeaot/build-integration2/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets#L5-L8 plus a line from @Thefrank's PR.
|
am11
commented
Jan 18, 2023
Uh oh!
There was an error while loading. Please reload this page.
ViktorHofer
commented
Jan 18, 2023
Why do we need to pass a target OS value to ILC at all? Before 4ece8f0, we didn't do that as ILC already has OS runtime detection code. |
MichalStrehovsky
commented
Jan 19, 2023
FreeBSD is a first instance of where we need to do cross-OS build. In our infrastructure, the build machine is Linux. The target is FreeBSD. Before FreeBSD the most advanced thing we needed was a cross-architecture build (from x64 to arm64, but same OS). |
MichalStrehovsky
commented
Jan 19, 2023
Since the revert merged, could you add a revert of the revert (or just the extra IlcArg to specify target os)? |
MichalStrehovsky
commented
Jan 19, 2023
Let's also wait for dotnet/sdk#29800 to merge so that if there's something wrong, we don't break it again. I'll mark this no merge for now. |
am11
commented
Jan 19, 2023
This PR is targeting the
It's not supported even with that PR, cross compilation is disabled: https://github.com/dotnet/runtime/pull/80323/files#diff-115c40d5f6cdfb8ebea1490c13581e76b60c3430cbf13f45c270fc5ec383daffR22 |
MichalStrehovsky
commented
Jan 19, 2023
I meant that #80791 removed passing TargetOS to ILC. So with this PR we would fill out the property, but still not actually use it. |
MichalStrehovsky
commented
Jan 19, 2023
Agreed on both counts but I'm also a bit worried about PRs that only update dead code. If we make this actually use the value of target OS we get at least some coverage. |
am11
commented
Jan 19, 2023
Yup, TargetOS is also used in conditions to distinguish between Windows, OSX and |
MichalStrehovsky
commented
Jan 19, 2023
Makes sense. Let's wait for the SDK update to merge and we can merge this too. |
Thefrank
commented
Jan 19, 2023
As both my pending PR and me look responsible for this one...how do I prevent In all cases I came across the os logic looks like windows -> osx -> linux -> |
am11
commented
Jan 19, 2023
@Thefrank, at least this issue was avoidable if #71486 hadn't touched anything related to "NativeAOT on FreeBSD" and left it for #80323. Generally, yes it is sometimes a pain as some of these issues are revealed during the integration or code flow. The runtime CI does some testing, but since there are growing number of configurations in NativeAOT, it is not possible to test all combinations in the runtime repo. |
jkotas
commented
Jan 19, 2023
We have tiered validation system. Some issues are only going to get caught in secondary tiers. |
sec
commented
Jan 19, 2023
Yeah that's on me - I was thinking those were needed for crossgen to work as it was failing/generating Linux binaries instead of FreeBSD ones, hence the TargetOS changes :( Sorry for that |
am11
commented
Jan 19, 2023
It's merged. Removed the labels. |
Regression from 4ece8f0 (see
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets).Daily build of SDK (
8.0.100-alpha.1.23068.3) is failing with:copied this block: https://github.com/am11/runtime/blob/feature/nativeaot/build-integration2/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets#L5-L8 plus a line from @Thefrank's PR.