[ARM32/Linux] Cross build failure - managed build
After merging engineering changes (#15135), cross build fails in managed code build for ARM (targetting for nuget packaging)
- follow guideline for arm crossbuild (https://github.com/dotnet/corefx/blob/master/Documentation/building/cross-building.md)
sudo ./cross/build-rootfs.sh arm
./build-native.sh -release -buildArch=arm -- cross
./build-managed.sh -release
error in managed build
/nfs/rbp3/corefx/src/Tools/GenerateProps/GenerateProps.proj(15,5): error MSB4062: The "GenerateConfigurationProps" task could not be loaded from the assembly /nfs/rbp3/corefx/Tools/CoreFx.Tools.dll. Could not load file or assembly 'CoreFx.Tools, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
/nfs/rbp3/corefx/src/Tools/GenerateProps/GenerateProps.proj(15,5): error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
/nfs/rbp3/corefx/Tools/depProj.targets(79,5): error : Error no assets were resolved from NuGet packages. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
Need to build CoreFX.Tools (like build.sh)
-
try x64 build, and follow guideline for arm crossbuild cannot get nuget package for ubuntu ARM32
-
try x64 build, and arm native build
./clean -all
./build.sh -release
./build-native.sh -release -buildArch=arm -- cross
./build-managed.sh -release -buildArch=arm
error in managed build
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.TestHost (>= 1.2.0-beta-24904-03)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.Runtime.CoreCLR (>= 1.2.0-beta-24904-03)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.DotNetHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.DotNetHostPolicy (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.Jit (>= 1.2.0-beta-24904-03)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.DotNetHostResolver (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.14.04-arm.Microsoft.NETCore.DotNetAppHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.14.04-arm)'. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
/nfs/rbp3/corefx/Tools/packageresolve.targets(35,5): error MSB3073: The command ""/nfs/rbp3/corefx/Tools/dotnetcli/dotnet" restore --no-cache --packages "/nfs/rbp3/corefx/packages" --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json --source https://www.nuget.org/api/v2/ "/nfs/rbp3/corefx/bin/obj/AnyOS.AnyCPU.Release/coreclr/netcoreapp/arm/project.json"" exited with code 1. [/nfs/rbp3/corefx/external/coreclr/coreclr.depproj]
Command execution failed with exit code 1.
- build with arm target
./clean.sh -all
./build.sh -release -buildArch=arm
Same as 3.
It seems to try to resolve CoreCLR nuget packages and core-setup nuget packages for target architecture. But we cannot resolve these nuget pacakges for arm cannot yet. Core-setup need CoreFX's nuget package, and CoreFX need core-setup nuget packages. And IMHO, If we try to add new target architecture (or OS), we may face similar problem.
@jyoungyun @chunseoklee @hqueue @mellinoe @weshaggard @gkhanna79
@gkhanna79 Is this related to E2E pipeline build of CoreCLR and can be reolved with pipeline build?
@hqueue Very likely. @ericstj and @weshaggard have been working on fixing the issues. Can you confirm if the issue still persists?
I build corefx for armel by
- build native
./build-native.sh -buildArch=armel -release -- cross - build CoreFx.Tools
./Tools/msbuild.sh ./src/Tools/CoreFx.Tools/CoreFx.Tools.csproj /v:m /m - build managed without packaging
./build-managed.sh -release -BuildPackages=false
But we cannot get nuget package for arm and armel. (or we cannot fix nuget package file's name for other architecture)
It's trying to fetch the CoreCLR bits and the host (from core-setup) for testing.
@hseok-oh you can just comment that out if you don't want to run the tests. It shouldn't be needed if all you want to do is build. Can you try this and see if it works?
@weshaggard @karajas can't we move these external dependencies to the test phase only? /cc @ellismg
PS: the corefx.tools thing is temporary until we move all that to buildtools.
@ericstj I could build and get nuget package for ARM by comment out that. But fail for ARM-softfp (armel). It seems to related to build configuration for armel.
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: The "FindBestConfiguration" task failed unexpectedly. [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: System.ArgumentException: Unknown value 'armel' found in configuration 'netcoreapp-Linux-Release-armel'. Expected property 'ArchGroup' with one of values x86, x64, arm, arm64. [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: at Microsoft.DotNet.Build.Tasks.ConfigurationFactory.ParseConfiguration(String configurationString, Boolean permitUnknownValues) in /nfs/rbp3/corefx/src/Tools/CoreFx.Tools/Configuration/ConfigurationFactory.cs:line 219 [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: at Microsoft.DotNet.Build.Tasks.FindBestConfiguration.Execute() in /nfs/rbp3/corefx/src/Tools/CoreFx.Tools/FindBestConfiguration.cs:line 30 [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
/nfs/rbp3/corefx/buildvertical.targets(42,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/nfs/rbp3/corefx/src/System.Collections.Concurrent/ref/System.Collections.Concurrent.csproj]
Thanks.
I could build ARM-softfp(armel) target by adding ArchGroups armel in src/Tools/GenerateProps/archgroups.props.
./build.sh -release -buildArch=armel -runtimeos=tizen.4.0.0
@hseok-oh, that looks correct. I went ahead and made a PR to do this as well as add the RID-specific packages for all the RIDs added by @chunseoklee. https://github.com/dotnet/corefx/pull/15321
Let's let this issue track the dependency on CoreCLR & Host from the build phase.
New build errors for Ubuntu ARM build. May have same problem on Tizen ARMEL build.
CSC : error CS0006: Metadata file '/nfs/rbp3/corefx/bin/runtime/netcoreapp-Linux-Release-arm/System.Private.CoreLib.dll' could not be found [/nfs/rbp3/corefx/src/System.AppContext/src/System.AppContext.csproj]
CSC : error CS0006: Metadata file '/nfs/rbp3/corefx/bin/runtime/netcoreapp-Linux-Release-arm/System.Private.CoreLib.dll' could not be found [/nfs/rbp3/corefx/src/System.Diagnostics.Debug/src/System.Diagnostics.Debug.csproj]
CSC : error CS0006: Metadata file '/nfs/rbp3/corefx/bin/runtime/netcoreapp-Linux-Release-arm/System.Private.CoreLib.dll' could not be found [/nfs/rbp3/corefx/src/System.Private.Uri/src/System.Private.Uri.csproj]
............
/nfs/rbp3/corefx/Tools/Microsoft.CSharp.Core.targets(67,5): error MSB6006: "/nfs/rbp3/corefx/Tools/dotnetcli/dotnet" exited with code 139. [/nfs/rbp3/corefx/src/System.CodeDom/src/System.CodeDom.csproj]
Error from absence of System.Private.CoreLib.dll for ubuntu.14.04-arm in bin/runtime.
To avoid these errors, copy System.Private.CoreLib.dll generated by CoreCLR build to bin/runtime/netcoreapp-Linux-Release-arm and build CoreFX for ubuntu ARM.
@ericstj I have assigned this to you to help make progress with the issues above. Please reroute as applicable.
This was caused by @joperezr's change to use ReferenceFromRuntime for System.Private.CoreLib. CoreFx requires a build of CoreCLR for its System.Private.CoreLib for partial facades. You could potentially "cheat" and restore this from a different runtime if you were trying to bootstrap and couldn't build CoreCLR for some reason. /cc @weshaggard
@ericstj Does this mean this is blocked since we do not have Linux arm32 CoreCLR package on myget?
You could either
a) build one locally and add that to the feeds used by corefx so that https://github.com/dotnet/corefx/blob/4d6c7315359aed4d99ee3402de0f4eac9e606599/external/coreclr/coreclr.depproj builds correctly using arm RID against locally built packages.
b) just set NuGetRuntimeIdentitifier to a different RID when building that project for arm32, in order to bootstrap with existing packages.
I would probably go with option [b] for new platform bring-up until we have an official coreclr package.
We can build by adding local directory that have nuget packages generated by coreclr in dir.props https://github.com/dotnet/corefx/blob/4d6c7315359aed4d99ee3402de0f4eac9e606599/dir.props#L112-L114
@hseok-oh yes that is part of option [a] that @ericstj is suggesting. For folks that are building both repo's that would work. @ellismg has some work in progress to allow folks to consume local build coreclr packages when building corefx which would probably help with that scenario.
CoreCLR pipeline build is now publishing Arm32 (armhf) packages for Ubuntu 14.04 and Ubuntu 16.04 on myget! Here are the first set of packages that got published today from the repo:
https://dotnet.myget.org/feed/dotnet-core/package/nuget/runtime.ubuntu.14.04-arm.Microsoft.NETCore.Runtime.CoreCLR
https://dotnet.myget.org/feed/dotnet-core/package/nuget/runtime.ubuntu.16.04-arm.Microsoft.NETCore.Runtime.CoreCLR
This should ensure that workarounds should not be required anymore.
@gkhanna79 Thanks to you, CoreCLR dependency issues were resolved well. But to build CoreFX, we still need DotNetHost and other core-setup nupkgs because coreclr.depproj has a dependency with those nupkgs. And when I tried to build core-setup, it also failed not to resolve CoreFX nupkg. I think one of core-setup nupkgs or CoreFX nupkgs should be uploaded first for bootstrapping.
@jyoungyun I make new issue for bootstrapping issue.
I couldn't build just comment out coreclr/coreclr.depproj in external/dir.proj and copy System.Private.CoreLib.dll. To build CoreFX, I used pre-generated CoreCLR and core-setup nuget packages for ubuntu.14.04-arm.
I have assigned the issue @hseok-oh created (https://github.com/dotnet/corefx/issues/15503) to @weshaggard since we do not need host packages for CoreFX product build.
FWIW, upon doing a managed build using ./build-managed.sh -release -buildArch=arm, I only see the host resolution errors and not CoreCLR package resolution errors:
EXEC : error : Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'. [/home/gkhanna79/GH/gkhanna79/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHostPolicy (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'. [/home/gkhanna79/GH/gkhanna79/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHostResolver (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'. [/home/gkhanna79/GH/gkhanna79/corefx/external/coreclr/coreclr.depproj]
EXEC : error : Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetAppHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'. [/home/gkhanna79/GH/gkhanna79/corefx/external/coreclr/coreclr.depproj]
Errors in /home/gkhanna79/GH/gkhanna79/corefx/bin/obj/AnyOS.AnyCPU.Release/coreclr/netcoreapp/arm/project.json
Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'.
Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHostPolicy (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'.
Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetHostResolver (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'.
Unable to resolve 'runtime.ubuntu.16.04-arm.Microsoft.NETCore.DotNetAppHost (>= 1.2.0-beta-001259-00)' for '.NETCoreApp,Version=v2.0 (ubuntu.16.04-arm)'.
/home/gkhanna79/GH/gkhanna79/corefx/Tools/packageresolve.targets(35,5): error MSB3073: The command ""/home/gkhanna79/GH/gkhanna79/corefx/Tools/dotnetcli/dotnet" restore --no-cache --packages "/home/gkhanna79/GH/gkhanna79/corefx/packages" --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json --source https://api.nuget.org/v3/index.json "/home/gkhanna79/GH/gkhanna79/corefx/bin/obj/AnyOS.AnyCPU.Release/coreclr/netcoreapp/arm/project.json"" exited with code 1. [/home/gkhanna79/GH/gkhanna79/corefx/external/coreclr/coreclr.depproj]