Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- eng/native/build-commons.sh
- src/native/libs/build-native.sh
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs
- src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<_targetPackageName>runtime.$(_targetOS)-$(_targetArchitecture).Microsoft.DotNet.ILCompiler</_targetPackageName>

<!-- From this point onwards, we will treat linux-musl as linux -->
<_linuxLibcFlavor Condition="$(_targetOS.StartsWith('linux-'))">$(_targetOS.SubString(6))</_linuxLibcFlavor>
<_targetOS Condition="$(_targetOS.StartsWith('linux'))">linux</_targetOS>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<TargetTriple />
<TargetTriple Condition="'$(CrossCompileArch)' != ''">$(CrossCompileArch)-linux-gnu</TargetTriple>
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('linux-musl')) or $(CrossCompileRid.StartsWith('alpine')))">$(CrossCompileArch)-alpine-linux-musl</TargetTriple>
<TargetTriple Condition="'$(CrossCompileArch)' != '' and $(CrossCompileRid.StartsWith('linux-bionic'))">$(CrossCompileArch)-linux-android21</TargetTriple>
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('freebsd')))">$(CrossCompileArch)-unknown-freebsd12</TargetTriple>

<IlcRPath Condition="'$(IlcRPath)' == '' and '$(_IsApplePlatform)' != 'true'">$ORIGIN</IlcRPath>
Expand All @@ -64,7 +65,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NetCoreAppNativeLibrary Include="System.Native" />
<NetCoreAppNativeLibrary Include="System.Globalization.Native" Condition="'$(StaticICULinking)' != 'true' and '$(InvariantGlobalization)' != 'true'" />
<NetCoreAppNativeLibrary Include="System.IO.Compression.Native" />
<NetCoreAppNativeLibrary Include="System.Net.Security.Native" />
<NetCoreAppNativeLibrary Include="System.Net.Security.Native" Condition="'$(_linuxLibcFlavor)' != 'bionic'" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am reading the correctly, uses of System.Net.Security.Native are not ifdefed out for linux-bionic in

<UseManagedNtlm Condition="'$(TargetPlatformIdentifier)' == 'android' or '$(TargetPlatformIdentifier)' == 'tvos'">true</UseManagedNtlm>

Do we need a matching fix in the libraries too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Looking at the latest Bionic Mono build, we're not building this library there either so this can't be a NativeAOT specific problem, if it is a problem:

https://dnceng.visualstudio.com/7ea9116e-9fac-403d-b258-b31fcf1bb293/_apis/build/builds/2202215/logs/1188

2023-06-16T01:47:31.0970341Z   Install the project...
2023-06-16T01:47:31.1000197Z   -- Install configuration: "RELEASE"
2023-06-16T01:47:31.1000861Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.IO.Compression.Native.so.dbg
2023-06-16T01:47:31.1019420Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.IO.Compression.Native.so
2023-06-16T01:47:31.1028723Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.IO.Compression.Native.a
2023-06-16T01:47:31.1064467Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Native.so.dbg
2023-06-16T01:47:31.1070650Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Native.so
2023-06-16T01:47:31.1074222Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Native.a
2023-06-16T01:47:31.1085002Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Globalization.Native.so.dbg
2023-06-16T01:47:31.1089764Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Globalization.Native.so
2023-06-16T01:47:31.1092925Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Globalization.Native.a
2023-06-16T01:47:31.1101678Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Security.Cryptography.Native.OpenSsl.so.dbg
2023-06-16T01:47:31.1107872Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Security.Cryptography.Native.OpenSsl.so
2023-06-16T01:47:31.1114082Z   -- Installing: /__w/1/s/artifacts/bin/native/net8.0-linux-Release-arm64/./libSystem.Security.Cryptography.Native.OpenSsl.a
2023-06-16T01:47:31.1130823Z   /__w/1/s/src/native/libs

I currently can't even test this enough to run a hello world so I'm not able to answer this question. It won't be much worse than Mono-Bionic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to open an issue on it since it looks like a problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #87665. It looks like System.Net.Security tests are disabled on Bionic due to "Timeout on Helix, cannot repro locally".

<NetCoreAppNativeLibrary Include="System.Security.Cryptography.Native.Apple" Condition="'$(_IsApplePlatform)' == 'true'" />
<!-- Not compliant for iOS-like platforms -->
<NetCoreAppNativeLibrary Include="System.Security.Cryptography.Native.OpenSsl" Condition="'$(StaticOpenSslLinking)' != 'true' and '$(_IsiOSLikePlatform)' != 'true'" />
Expand Down Expand Up @@ -122,7 +123,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-lswiftCore" Condition="'$(_targetOS)' == 'osx'" />
<LinkerArg Include="-lswiftFoundation" Condition="'$(_targetOS)' == 'osx'" />
<LinkerArg Include="-lz" />
<LinkerArg Include="-lrt" Condition="'$(_IsApplePlatform)' != 'true'" />
<LinkerArg Include="-lrt" Condition="'$(_IsApplePlatform)' != 'true' and '$(_linuxLibcFlavor)' != 'bionic'" />
<LinkerArg Include="-licucore" Condition="'$(_IsApplePlatform)' == 'true'" />
<LinkerArg Include="-L/usr/lib/swift" Condition="'$(_targetOS)' == 'osx'" />
<LinkerArg Include="@(StaticICULibs)" Condition="'$(StaticICULinking)' == 'true'" />
Expand Down Expand Up @@ -153,11 +154,16 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-Wl,--eh-frame-hdr" Condition="'$(_IsApplePlatform)' != 'true'" />
</ItemGroup>

<Exec Command="command -v &quot;$(CppLinker)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low">
<PropertyGroup>
<_CommandProbe>command -v</_CommandProbe>
<_CommandProbe Condition="$([MSBuild]::IsOSPlatform('Windows'))">where</_CommandProbe>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not used on Windows, right? (i.e. we don't support cross-OS publishing in cross build mode)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the above dotnet publish -r linux-bionic-arm64 /p:DisableUnsupportedError=true /p:PublishAotUsingRuntimePack=true with this on Windows. Worked fine with this change.

</PropertyGroup>

<Exec Command="$(_CommandProbe) &quot;$(CppLinker)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low">
<Output TaskParameter="ExitCode" PropertyName="_WhereLinker" />
</Exec>

<Exec Command="command -v &quot;$(CppCompilerAndLinkerAlternative)&quot;" Condition="'$(CppCompilerAndLinkerAlternative)' != '' and '$(_WhereLinker)' != '0'" IgnoreExitCode="true" StandardOutputImportance="Low">
<Exec Command="$(_CommandProbe) &quot;$(CppCompilerAndLinkerAlternative)&quot;" Condition="'$(CppCompilerAndLinkerAlternative)' != '' and '$(_WhereLinker)' != '0'" IgnoreExitCode="true" StandardOutputImportance="Low">
<Output TaskParameter="ExitCode" PropertyName="_WhereLinkerAlt" />
</Exec>

Expand Down Expand Up @@ -189,11 +195,11 @@ The .NET Foundation licenses this file to you under the MIT license.
<_LinkerVersion>$([System.Text.RegularExpressions.Regex]::Match($(_LinkerVersionString), '[1-9]\d*'))</_LinkerVersion>
</PropertyGroup>

<Exec Command="command -v &quot;$(ObjCopyName)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' != 'true' and '$(StripSymbols)' == 'true'">
<Exec Command="$(_CommandProbe) &quot;$(ObjCopyName)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' != 'true' and '$(StripSymbols)' == 'true'">
<Output TaskParameter="ExitCode" PropertyName="_WhereSymbolStripper" />
</Exec>

<Exec Command="command -v &quot;$(ObjCopyNameAlternative)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' != 'true' and '$(ObjCopyNameAlternative)' != '' and '$(StripSymbols)' == 'true'">
<Exec Command="$(_CommandProbe) &quot;$(ObjCopyNameAlternative)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' != 'true' and '$(ObjCopyNameAlternative)' != '' and '$(StripSymbols)' == 'true'">
<Output TaskParameter="ExitCode" PropertyName="_WhereSymbolStripperAlt" />
</Exec>

Expand Down