runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Wrong computed RID on Alpine Linux alpha / beta releases

Open ayakael opened this issue 3 years ago • 3 comments

Description

Runtime does not support RID format for alpha / beta releases of Alpine Linux which uses a VERSION_ID format which goes as such: x.xx_alphayyyymmdd (i.e. alpine.3.17_alpha20220715-x64) During build, even when RID is added to JSON RID graph using source-build's _IsBootstrapping=true flag and eng/native/init-distro-rid.sh logics are modified to not cut what's after alpine.3, fails with MSB4018: System.FormatException: Input string was not in a correct format. in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5)

Reproduction Steps

  • Run abuild -r using aport as available here in current Alpine Edge environment

Expected behavior

Either GenerateRuntimeGraph should be able to cope with that VERSION_ID format, as it is within spec of /etc/os-release, or [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should cut whatever's after _ as irrelevant information, just as it does with subversions. (i.e 3.17.1 becomes 3.17, thus should 3.17_alpha20220715 become 3.17)

Actual behavior

Computed RID through eng/native/init-distro-rid is alpine.3-x64 and through [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier it is alpine.3.17_alpha20220715-x64

Regression?

No response

Known Workarounds

No response

Configuration

Note that this is done within source-build environment with 6.0.107 release on an Alpine Linux LXC container. Many patches are also applied by Alpine's build system. Patches relevant to runtime are prefixed by runtime_ in aport here

Other information

Full error is as follows:

  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: System.FormatException: Input string was not in a correct format.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.TryParseComponent(ReadOnlySpan`1 component, String componentName, Boolean throwOnFailure, Int32& parsedComponent)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.Parse(String input)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 325
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
      478 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:10:20.07
  Build failed with exit code 1. Check errors above.
/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets(194,5): error MSB3073: The command "./build.sh  --arch x64 --configuration Release --allconfigurations --verbosity minimal --nodereuse false --warnAsError false /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 /p:PackageRid=alpine.3.17_alpha20220715-x64 /p:NoPgoOptimize=true /p:KeepNativeSymbols=true /p:RuntimeOS=alpine.3.17_alpha20220715 /p:PortableBuild=false /p:BuildDebPackage=false --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE /p:ArcadeInnerBuildFromSource=true /p:DotNetBuildFromSource=true /p:RepoRoot=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/ /p:ArtifactsDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/ /bl:/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/sourcebuild.binlog /p:ContinuousIntegrationBuild=true /p:SourceBuildOutputDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/ /p:SourceBuiltBlobFeedDir= /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false /p:DotNetBuildOffline=true /p:DotNetPackageVersionPropsPath=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/artifacts/obj/x64/Release/PackageVersions.props" exited with code 1. [/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]

Full log of build here

ayakael avatar Aug 07 '22 05:08 ayakael

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

Issue Details

Description

Runtime does not support RID format for alpha / beta releases of Alpine Linux which uses a VERSION_ID format which goes as such: x.xx_alphayyyymmdd (i.e. alpine.3.17_alpha20220715-x64) During build, even when RID is added to JSON RID graph using source-build's _IsBootstrapping=true flag and eng/native/init-distro-rid.sh logics are modified to not cut what's after alpine.3, fails with MSB4018: System.FormatException: Input string was not in a correct format. in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5)

Reproduction Steps

  • Run abuild -r using aport as available here in current Alpine Edge environment

Expected behavior

Either GenerateRuntimeGraph should be able to cope with that VERSION_ID format, as it is within spec of /etc/os-release, or [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should cut whatever's after _ as irrelevant information, just as it does with subversions. (i.e 3.17.1 becomes 3.17, thus should 3.17_alpha20220715 become 3.17)

Actual behavior

Computed RID through eng/native/init-distro-rid is alpine.3-x64 and through [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier it is alpine.3.17_alpha20220715-x64

Regression?

No response

Known Workarounds

No response

Configuration

Note that this is done within source-build environment with 6.0.107 release on an Alpine Linux LXC container. Many patches are also applied by Alpine's build system. Patches relevant to runtime are prefixed by runtime_ in aport here

Other information

Full error is as follows:

  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: System.FormatException: Input string was not in a correct format.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.TryParseComponent(ReadOnlySpan`1 component, String componentName, Boolean throwOnFailure, Int32& parsedComponent)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.Parse(String input)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 325
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
      478 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:10:20.07
  Build failed with exit code 1. Check errors above.
/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets(194,5): error MSB3073: The command "./build.sh  --arch x64 --configuration Release --allconfigurations --verbosity minimal --nodereuse false --warnAsError false /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 /p:PackageRid=alpine.3.17_alpha20220715-x64 /p:NoPgoOptimize=true /p:KeepNativeSymbols=true /p:RuntimeOS=alpine.3.17_alpha20220715 /p:PortableBuild=false /p:BuildDebPackage=false --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE /p:ArcadeInnerBuildFromSource=true /p:DotNetBuildFromSource=true /p:RepoRoot=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/ /p:ArtifactsDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/ /bl:/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/sourcebuild.binlog /p:ContinuousIntegrationBuild=true /p:SourceBuildOutputDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/ /p:SourceBuiltBlobFeedDir= /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false /p:DotNetBuildOffline=true /p:DotNetPackageVersionPropsPath=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/artifacts/obj/x64/Release/PackageVersions.props" exited with code 1. [/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]
Author: ayakael
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

msftbot[bot] avatar Aug 07 '22 05:08 msftbot[bot]

Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Runtime does not support RID format for alpha / beta releases of Alpine Linux which uses a VERSION_ID format which goes as such: x.xx_alphayyyymmdd (i.e. alpine.3.17_alpha20220715-x64) During build, even when RID is added to JSON RID graph using source-build's _IsBootstrapping=true flag and eng/native/init-distro-rid.sh logics are modified to not cut what's after alpine.3, fails with MSB4018: System.FormatException: Input string was not in a correct format. in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5)

Reproduction Steps

  • Run abuild -r using aport as available here in current Alpine Edge environment

Expected behavior

Either GenerateRuntimeGraph should be able to cope with that VERSION_ID format, as it is within spec of /etc/os-release, or [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should cut whatever's after _ as irrelevant information, just as it does with subversions. (i.e 3.17.1 becomes 3.17, thus should 3.17_alpha20220715 become 3.17)

Actual behavior

Computed RID through eng/native/init-distro-rid is alpine.3-x64 and through [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier it is alpine.3.17_alpha20220715-x64

Regression?

No response

Known Workarounds

No response

Configuration

Note that this is done within source-build environment with 6.0.107 release on an Alpine Linux LXC container. Many patches are also applied by Alpine's build system. Patches relevant to runtime are prefixed by runtime_ in aport here

Other information

Full error is as follows:

  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: System.FormatException: Input string was not in a correct format.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.TryParseComponent(ReadOnlySpan`1 component, String componentName, Boolean throwOnFailure, Int32& parsedComponent)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.Parse(String input)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 325
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
      478 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:10:20.07
  Build failed with exit code 1. Check errors above.
/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets(194,5): error MSB3073: The command "./build.sh  --arch x64 --configuration Release --allconfigurations --verbosity minimal --nodereuse false --warnAsError false /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 /p:PackageRid=alpine.3.17_alpha20220715-x64 /p:NoPgoOptimize=true /p:KeepNativeSymbols=true /p:RuntimeOS=alpine.3.17_alpha20220715 /p:PortableBuild=false /p:BuildDebPackage=false --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE /p:ArcadeInnerBuildFromSource=true /p:DotNetBuildFromSource=true /p:RepoRoot=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/ /p:ArtifactsDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/ /bl:/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/sourcebuild.binlog /p:ContinuousIntegrationBuild=true /p:SourceBuildOutputDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/ /p:SourceBuiltBlobFeedDir= /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false /p:DotNetBuildOffline=true /p:DotNetPackageVersionPropsPath=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/artifacts/obj/x64/Release/PackageVersions.props" exited with code 1. [/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]

Full log of build here

Author: ayakael
Assignees: -
Labels:

area-Host, untriaged

Milestone: -

msftbot[bot] avatar Aug 07 '22 06:08 msftbot[bot]

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

Issue Details

Description

Runtime does not support RID format for alpha / beta releases of Alpine Linux which uses a VERSION_ID format which goes as such: x.xx_alphayyyymmdd (i.e. alpine.3.17_alpha20220715-x64) During build, even when RID is added to JSON RID graph using source-build's _IsBootstrapping=true flag and eng/native/init-distro-rid.sh logics are modified to not cut what's after alpine.3, fails with MSB4018: System.FormatException: Input string was not in a correct format. in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5)

Reproduction Steps

  • Run abuild -r using aport as available here in current Alpine Edge environment

Expected behavior

Either GenerateRuntimeGraph should be able to cope with that VERSION_ID format, as it is within spec of /etc/os-release, or [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should cut whatever's after _ as irrelevant information, just as it does with subversions. (i.e 3.17.1 becomes 3.17, thus should 3.17_alpha20220715 become 3.17)

Actual behavior

Computed RID through eng/native/init-distro-rid is alpine.3-x64 and through [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier it is alpine.3.17_alpha20220715-x64

Regression?

No response

Known Workarounds

No response

Configuration

Note that this is done within source-build environment with 6.0.107 release on an Alpine Linux LXC container. Many patches are also applied by Alpine's build system. Patches relevant to runtime are prefixed by runtime_ in aport here

Other information

Full error is as follows:

  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: System.FormatException: Input string was not in a correct format.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.TryParseComponent(ReadOnlySpan`1 component, String componentName, Boolean throwOnFailure, Int32& parsedComponent)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.Parse(String input)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 325
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
      478 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:10:20.07
  Build failed with exit code 1. Check errors above.
/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets(194,5): error MSB3073: The command "./build.sh  --arch x64 --configuration Release --allconfigurations --verbosity minimal --nodereuse false --warnAsError false /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 /p:PackageRid=alpine.3.17_alpha20220715-x64 /p:NoPgoOptimize=true /p:KeepNativeSymbols=true /p:RuntimeOS=alpine.3.17_alpha20220715 /p:PortableBuild=false /p:BuildDebPackage=false --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE /p:ArcadeInnerBuildFromSource=true /p:DotNetBuildFromSource=true /p:RepoRoot=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/ /p:ArtifactsDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/ /bl:/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/sourcebuild.binlog /p:ContinuousIntegrationBuild=true /p:SourceBuildOutputDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/ /p:SourceBuiltBlobFeedDir= /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false /p:DotNetBuildOffline=true /p:DotNetPackageVersionPropsPath=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/artifacts/obj/x64/Release/PackageVersions.props" exited with code 1. [/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]

Full log of build here

Author: ayakael
Assignees: -
Labels:

source-build, area-Host, area-Infrastructure, untriaged

Milestone: -

msftbot[bot] avatar Aug 07 '22 15:08 msftbot[bot]

The following bit of code is relevant to this issue: https://github.com/dotnet/runtime/blob/c1dba415f397853bde5383d07b1c38b0ad072316/src/native/corehost/hostmisc/pal.unix.cpp#L718-L748

I think it'd be easy to fix if there was some logic put in place to strip any information following a '_' character, similar to how minor version numbers are stripped.

ayakael avatar Aug 08 '22 05:08 ayakael

Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Runtime does not support RID format for alpha / beta releases of Alpine Linux which uses a VERSION_ID format which goes as such: x.xx_alphayyyymmdd (i.e. alpine.3.17_alpha20220715-x64) During build, even when RID is added to JSON RID graph using source-build's _IsBootstrapping=true flag and eng/native/init-distro-rid.sh logics are modified to not cut what's after alpine.3, fails with MSB4018: System.FormatException: Input string was not in a correct format. in src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5)

Reproduction Steps

  • Run abuild -r using aport as available here in current Alpine Edge environment

Expected behavior

Either GenerateRuntimeGraph should be able to cope with that VERSION_ID format, as it is within spec of /etc/os-release, or [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should cut whatever's after _ as irrelevant information, just as it does with subversions. (i.e 3.17.1 becomes 3.17, thus should 3.17_alpha20220715 become 3.17)

Actual behavior

Computed RID through eng/native/init-distro-rid is alpine.3-x64 and through [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier it is alpine.3.17_alpha20220715-x64

Regression?

No response

Known Workarounds

No response

Configuration

Note that this is done within source-build environment with 6.0.107 release on an Alpine Linux LXC container. Many patches are also applied by Alpine's build system. Patches relevant to runtime are prefixed by runtime_ in aport here

Other information

Full error is as follows:

  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018: System.FormatException: Input string was not in a correct format.
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.TryParseComponent(ReadOnlySpan`1 component, String componentName, Boolean throwOnFailure, Int32& parsedComponent)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at System.Version.Parse(String input)
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 325
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  /var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(55,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
      478 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:10:20.07
  Build failed with exit code 1. Check errors above.
/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/SourceBuild/SourceBuildArcadeBuild.targets(194,5): error MSB3073: The command "./build.sh  --arch x64 --configuration Release --allconfigurations --verbosity minimal --nodereuse false --warnAsError false /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 /p:PackageRid=alpine.3.17_alpha20220715-x64 /p:NoPgoOptimize=true /p:KeepNativeSymbols=true /p:RuntimeOS=alpine.3.17_alpha20220715 /p:PortableBuild=false /p:BuildDebPackage=false --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE /p:ArcadeInnerBuildFromSource=true /p:DotNetBuildFromSource=true /p:RepoRoot=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/ /p:ArtifactsDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/ /bl:/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/self/src/artifacts/sourcebuild.binlog /p:ContinuousIntegrationBuild=true /p:SourceBuildOutputDir=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/src/runtime/artifacts/source-build/ /p:SourceBuiltBlobFeedDir= /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false /p:DotNetBuildOffline=true /p:DotNetPackageVersionPropsPath=/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/artifacts/obj/x64/Release/PackageVersions.props" exited with code 1. [/var/build/dotnet6-fix-rid/community/dotnet6-stage0/src/source-build-tarball-6.0.107/Tools/source-built/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj]

Full log of build here

Author: ayakael
Assignees: -
Labels:

source-build, area-Host, untriaged

Milestone: -

msftbot[bot] avatar Aug 08 '22 08:08 msftbot[bot]

I've mitigated this issue by doing two things:

  1. Build runtime with p:TargetRid=alpine.3.17-x64
  2. Patched eng/native/init-distro-rid.sh to cut out _* from `alpine.3.17_alpha20220715```
From 389814c78216f8f969f99bd87d58d7f386e0301a Mon Sep 17 00:00:00 2001
From: Antoine Martin (ayakael) <[email protected]>
Date: Fri, 5 Aug 2022 15:05:30 +0000
Subject: [PATCH 1/1] improved VERSION_ID parsing

Runtime doesn't generate a proper distro-rid for Alpine, leaving the
last version digit. Patch fixes this by adding new VERSION_ID parsing
logics.

---
 eng/native/init-distro-rid.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh
index f71aa8640b1..fce4092a43d 100644
--- a/eng/native/init-distro-rid.sh
+++ b/eng/native/init-distro-rid.sh
@@ -41,16 +41,21 @@ initNonPortableDistroRid()
             # We have forced __PortableBuild=0. This is because -portablebuld
             # has been passed as false.
             if (( isPortable == 0 )); then
-                if [ "${ID}" = "rhel" ]; then
-                    # remove the last version digit
-                    VERSION_ID="${VERSION_ID%.*}"
-                fi
-
                 if [ -z "${VERSION_ID+x}" ]; then
                         # Rolling release distros do not set VERSION_ID, so omit
                         # it here to be consistent with everything else.
                         nonPortableBuildID="${ID}-${buildArch}"
                 else
+                        local VERSION_ID_DOT="${VERSION_ID//[^.]}"
+                        while [[ ${#VERSION_ID_DOT} -gt 1 ]]; do
+                                VERSION_ID="${VERSION_ID%.*}"
+                                local VERSION_ID_DOT="${VERSION_ID//[^.]}"
+                        done
+                       local VERSION_ID_DASH="${VERSION_ID//[^_]}"
+                        while [[ ${#VERSION_ID_DASH} -ge 1 ]]; do
+                                VERSION_ID="${VERSION_ID%_*}"
+                                local VERSION_ID_DASH="${VERSION_ID//[^_]}"
+                        done
                         nonPortableBuildID="${ID}.${VERSION_ID}-${buildArch}"
                 fi
             fi
-- 
2.37.1

As you see above, I removed the distro-specific VERSION_ID normalization logics in favor of distro-agnostic logics. I do not know if this would break build on other platforms, but it would probably be worthwhile to explore other ways to normalize this variable.

ayakael avatar Aug 15 '22 13:08 ayakael

Moving to 8.0 since there is a mitigation

LakshanF avatar Aug 16 '22 20:08 LakshanF

Of note, with https://github.com/dotnet/runtime/pull/74504 changing init-distro-rid.sh is not necessary as TargetRid is now used to define __DistroRid when in source-build. [System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier should be changed as to parse all VERSION_ID variables that respects the specification so that TargetRid is well defined.

ayakael avatar Nov 21 '22 22:11 ayakael

To add to the above, this means the following manipulations should be supported on Alpine: alpine.3.17.0-$archalpine.3.17-$arch alpine.3.17-$archalpine.3.17-$arch alpine.3.17_alpha-$archalpine.3.17-$arch alpine.3.17.0_rc1alpine.3.17-$arch

My knowledge of c++ is non-existent, so I've been working on pal.unix.cpp to, just like cut anything after _, and then cut after ..

ayakael avatar Nov 23 '22 20:11 ayakael

Hi all, I think I've run into the same issue as described above.

I am using the official ASP.NET Core runtime image as my base image i.e. "mcr.microsoft.com/dotnet/aspnet:7.0.2-alpine3.17-amd64".

When I want to populate my image with my application, I follow these 4 basic steps: dotnet restore dotnet build dotnet publish copy the published app to the container

So in other words, I am publishing my application for all RIDs, but then when I run my container, I get a segmentation fault -> This is where I assumed its selecting the wrong RID.

I then tried a different approach, and instead of publishing my application for all RIDs, I targeted a specific RID i.e. 'linux-musl-x64'. This results in a single RID variant of my application. If I then copy this published app to the container, it works as expected.

As @ayakael mentioned, I think this is because I am using the 'alpine3.17-amd64' base image i.e. 'alpine.3.17-$arch' which seems like a manipulation that is not yet supported on Alpine. Is that right?

soutieslak avatar Feb 16 '23 19:02 soutieslak

Hi all, I think I've run into the same issue as described above.

I am using the official ASP.NET Core runtime image as my base image i.e. "mcr.microsoft.com/dotnet/aspnet:7.0.2-alpine3.17-amd64".

When I want to populate my image with my application, I follow these 4 basic steps: dotnet restore dotnet build dotnet publish copy the published app to the container

So in other words, I am publishing my application for all RIDs, but then when I run my container, I get a segmentation fault -> This is where I assumed its selecting the wrong RID.

I then tried a different approach, and instead of publishing my application for all RIDs, I targeted a specific RID i.e. 'linux-musl-x64'. This results in a single RID variant of my application. If I then copy this published app to the container, it works as expected.

As @ayakael mentioned, I think this is because I am using the 'alpine3.17-amd64' base image i.e. 'alpine.3.17-$arch' which seems like a manipulation that is not yet supported on Alpine. Is that right?

Sorry for the late reply! Your application should be supported. This issue occurs when running dotnet on edge, thus you should not get a segmentation fault. Have you tried using the aspnetcore package that Alpine provides?

ayakael avatar Mar 30 '23 11:03 ayakael

No longer relevant, as https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/8.0/rid-asset-list is now the default in .NET 8.

agocke avatar Jun 26 '23 20:06 agocke