You are not logged in.

#1 2023-02-01 17:47:31

Wroch
Member
Registered: 2023-02-01
Posts: 2

[SOLVED] Build dotnet-core package from ABS

Hello

For quite some time, I've been toying with ideas to modify dotnet-core. Surly first step is to actually build the bloody thing. Having failed miserably with instructions on dotnet github (installer, source-build, dotnet) repos (tried core 5, 6, 7, 8) I figured it would probably be easiest to start with whatever my distro is  doing to build the thing.

So I've tried:

asp extract dotnet-core
cd ./dotnet-core 
makepkg

this did not work. Got some error or other, seems like conflict with existing dotnet or something of sort.
So I went ahead and done next best thing and tried to build in arch docker image

docker run --rm -it -v dotnet_arch_pkgbuild:/vmr -w /vmr archlinux:base-devel 
pacman -Syyu
pacman -S asp bash  clang  cmake  git  icu  inetutils  krb5  libgit2  libunwind  libxml2  lldb  llvm  lttng-ust2.12  nodejs  openssl  systemd  zlib asp
sed -i 's/#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
locale-gen
useradd -m -G wheel -s /bin/bash buildusr
su - buildusr
cd /vmr
asp export dotnet-core
cd ./dotnet-core
makepkg

Sure enough the prvious error was gone and compilation proceeded nicely until it didn't:

Microsoft.NETCore.Platforms -> /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/artifacts/bin/Microsoft.NETCore.Platforms/Release/net7.0/Microsoft.NETCore.Platforms.BuildTasks.dll
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018: The "GenerateRuntimeGraph" task failed unexpectedly. [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018: System.FormatException: The input string 'template_version_id' was not in a correct format. [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type) [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at System.Version.ParseVersion(ReadOnlySpan`1 input, Boolean throwOnFailure) [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at System.Version.Parse(String input) [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeVersion..ctor(String versionString) in /_/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeVersion.cs:line 37 [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RID.Parse(String runtimeIdentifier) in /_/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs:line 152 [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.RuntimeGroupCollection.AddRuntimeIdentifier(String runtimeIdentifier, String parent) in /_/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs:line 37 [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.AddRuntimeIdentifiers(ICollection`1 runtimeGroups) in /_/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 327 [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.NETCore.Platforms.BuildTasks.GenerateRuntimeGraph.Execute() in /_/src/libraries/Microsoft.NETCore.Platforms/src/GenerateRuntimeGraph.cs:line 157 [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [TargetFramework=net7.0]
    /vmr/dotnet-core/src/sources/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj(62,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [TargetFramework=net7.0]
    
    Build FAILED.

Same thing on dotnet 6 and 7.
So my question is: is there some setup step I am missing here? How is this built for official repo? Anyone got idea how to get rid of these errors?

Just to make sure it's clear: I did 0 modification to source code at this point.

Last edited by Wroch (2023-02-01 19:16:17)

Offline

#2 2023-02-01 19:16:00

Wroch
Member
Registered: 2023-02-01
Posts: 2

Re: [SOLVED] Build dotnet-core package from ABS

Obviously, the moment I've posted the question I've come up with answer. There must be some kind of enviroment flag missing on my docker machine, which makes the build stumble on invalid value. Appending

/p:TargetRid=arch-x64

to the build command parameters solves the issue

Offline

Board footer

Powered by FluxBB