Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alpine build #106

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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 tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<Platforms>AnyCPU</Platforms>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>

<ItemGroup>
Expand Down
39 changes: 16 additions & 23 deletions tests/IL2C.Core.Test.Common/ILSupport.Standard.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
-->

<PropertyGroup>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('windows'))">win</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('freebsd'))">freebsd</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('netbsd'))">netbsd</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('illumos'))">illumos</_OSPlatform>
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('solaris'))">solaris</_OSPlatform>
<_OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</_OSArchitecture>

<MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(_OSPlatform)-$(_OSArchitecture.ToLower())</MicrosoftNetCoreIlasmPackageRuntimeId>
<_runtime>$(NETCoreSdkPortableRuntimeIdentifier)</_runtime>
<_runtime Condition="'$(_runtime)' == ''">$(NETCoreSdkRuntimeIdentifier)</_runtime>
<MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(_runtime)</MicrosoftNetCoreIlasmPackageRuntimeId>
Comment on lines +12 to +14
Copy link
Author

@am11 am11 Oct 16, 2021

Choose a reason for hiding this comment

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

  • portable runtime identifer $(NETCoreSdkPortableRuntimeIdentifier) is a distro-agnostic ID which we need for MicrosoftNetCoreIlasmPackageRuntimeId.
  • non-portable runtime identifier $(NETCoreSdkRuntimeIdentifier) on the other hand, is distro-aware. For instance, if the SDK was built with -p:PortableBuild=false. This is the case when some distros (like RHEL, Fedora etc.) build the SDK in their packages. But the one provided by .NET team is always portable.

MicrosoftNetCoreIlasmPackageRuntimeId requires a portable RID, since the packages are published by .NET team for only portable flavors. Since NETCoreSdkPortableRuntimeIdentifier is new in .NET 5, if we are building this project on, e.g. Fedora, and we installed dotnet-sdk 3.1 package from the distro, we would need to pass the correct portable RID explicitly dotnet test il2c.proj -p:MicrosoftNetCoreIlasmPackageRuntimeId=linux-x64 in such environment (I think we can live with that since it's not a very common setup and only effects older version of runtimes). Otherwise if we are using SDK 3x provided by .NET team, it will return the correct value of portable RID (linux-x64) from NETCoreSdkRuntimeIdentifier.

<!-- It's RC version, but latest stable 5.0.0 cause unknown bug (0xc0000004) occurred -->
<MicrosoftNETCoreILAsmVersion Condition="'$(MicrosoftNETCoreILAsmVersion)' == ''">6.0.0-rc.2.21480.5</MicrosoftNETCoreILAsmVersion>
<MicrosoftNetCoreIlasmPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ilasm</MicrosoftNetCoreIlasmPackageName>
Expand Down Expand Up @@ -78,7 +71,7 @@
<Target Name="CoreDecompile" Inputs="@(IntermediateAssembly)" Outputs="$(ILFile)" Condition=" Exists ( @(IntermediateAssembly) ) ">
<Message Importance="normal" Text="ILSupport: ILDasmPath = $(ILDasmPath)" />
<PropertyGroup>
<ILDasm>&quot;$(ILDasmPath)&quot; /linenum /utf8 /output=&quot;$(ILFile)&quot; @(IntermediateAssembly->'&quot;%(FullPath)&quot;', ' ')</ILDasm>
<ILDasm>&quot;$(ILDasmPath)&quot; -linenum -utf8 -output=&quot;$(ILFile)&quot; @(IntermediateAssembly->'&quot;%(FullPath)&quot;', ' ')</ILDasm>
</PropertyGroup>
<Exec Command="$(ILDasm)" />
<ItemGroup>
Expand All @@ -102,47 +95,47 @@
<Target Name="CoreCompileIL" Inputs="@(IL)" Outputs="@(IntermediateAssembly)">
<Message Importance="normal" Text="ILSupport: ILAsmPath = $(ILAsmPath)" />
<PropertyGroup>
<ILAsm>&quot;$(ILAsmPath)&quot; /nologo /quite /output=@(IntermediateAssembly->'&quot;%(FullPath)&quot;', ' ')</ILAsm>
<ILAsm>&quot;$(ILAsmPath)&quot; -nologo -quite -output=@(IntermediateAssembly->'&quot;%(FullPath)&quot;', ' ')</ILAsm>
<MergedILPath>$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','$(IntermediateOutputPath)','Merged.il'))</MergedILPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(FileAlignment)' != '' ">
<ILAsm>$(ILAsm) /alignment=$(FileAlignment)</ILAsm>
<ILAsm>$(ILAsm) -alignment=$(FileAlignment)</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(BaseAddress)' != '' ">
<ILAsm>$(ILAsm) /base=$(BaseAddress)</ILAsm>
<ILAsm>$(ILAsm) -base=$(BaseAddress)</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(OutputType)' == 'Library' ">
<ILAsm>$(ILAsm) /dll</ILAsm>
<ILAsm>$(ILAsm) -dll</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(DebugType)' == 'pdbonly' ">
<!-- warning : Classic PDB format is not supported on CoreCLR. -->
<ILAsm>$(ILAsm) /debug=opt /pdbfmt=portable</ILAsm>
<ILAsm>$(ILAsm) -debug=opt -pdbfmt=portable</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(DebugType)' == 'impl' ">
<!-- warning : Classic PDB format is not supported on CoreCLR. -->
<ILAsm>$(ILAsm) /debug=impl /pdbfmt=portable</ILAsm>
<ILAsm>$(ILAsm) -debug=impl -pdbfmt=portable</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(DebugType)' == 'portable' ">
<!-- warning : Classic PDB format is not supported on CoreCLR. -->
<ILAsm>$(ILAsm) /debug /pdbfmt=portable</ILAsm>
<ILAsm>$(ILAsm) -debug -pdbfmt=portable</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(DebugType)' == 'full' ">
<!-- warning : Classic PDB format is not supported on CoreCLR. -->
<ILAsm>$(ILAsm) /debug /pdbfmt=portable</ILAsm>
<ILAsm>$(ILAsm) -debug -pdbfmt=portable</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(Optimize)' == 'true' ">
<ILAsm>$(ILAsm) /optimize</ILAsm>
<ILAsm>$(ILAsm) -optimize</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'Itanium' ">
<ILAsm>$(ILAsm) /pe64 /itanium</ILAsm>
<ILAsm>$(ILAsm) -pe64 -itanium</ILAsm>
</PropertyGroup>
<PropertyGroup Condition=" '$(AssemblyOriginatorKeyFile)' != '' ">
<ILAsm>$(ILAsm) /key:"$(AssemblyOriginatorKeyFile)"</ILAsm>
<ILAsm>$(ILAsm) -key:"$(AssemblyOriginatorKeyFile)"</ILAsm>
</PropertyGroup>
<!-- Couldn't combine resources with ILAsm .NET 5.0 version.
IL2C regression test doesn't require Win32 resources, so simply omitted.
<PropertyGroup Condition=" Exists ( '$(ILResourceFile)' ) ">
<ILAsm>$(ILAsm) /resource:"$(ILResourceFile)"</ILAsm>
<ILAsm>$(ILAsm) -resource:"$(ILResourceFile)"</ILAsm>
</PropertyGroup>
-->
<PropertyGroup Condition=" Exists ( '$(ILFile)' ) ">
Expand Down