sdk: Fail to copy core-sdk files in ubuntu.16.04-arm build

Steps to reproduce

Build Command:

./build.sh -c Release /p:CLIBUILD_SKIP_TESTS=true /p:DISABLE_CROSSGEN=1 /p:Rid=ubuntu.16.04-arm /p:IncludeAdditionalSharedFrameworks=false

Related patch:

--- a/build/Branding.props
+++ b/build/Branding.props
@@ -12,7 +12,7 @@
     <SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
     <SharedFrameworkNugetName>$(SharedFrameworkName)</SharedFrameworkNugetName>
 
-    <ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' Or '$(Rid)' == 'fedora.23-x64' Or '$(Rid)' == 'opensuse.13.2-x64' ">$(Rid)</ProductMonikerRid>
+    <ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' Or '$(Rid)' == 'fedora.23-x64' Or '$(Rid)' == 'opensuse.13.2-x64' Or '$(Rid)' == 'ubuntu.16.04-arm'">$(Rid)</ProductMonikerRid>
     <ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
     
     <ArtifactNameSdk>dotnet-sdk</ArtifactNameSdk>
--- a/build/BundledRuntimes.props
+++ b/build/BundledRuntimes.props
@@ -53,21 +53,21 @@
       </_DownloadAndExtractItem>
 
       <_DownloadAndExtractItem Include="DownloadedSharedFrameworkInstallerFile"
-                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''">
+                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != '' And '$(IsCross)' == 'False'">
         <Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName)</Url>
         <DownloadFileName>$(DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
         <ExtractDestination></ExtractDestination>
       </_DownloadAndExtractItem>
 
       <_DownloadAndExtractItem Include="DownloadedSharedHostInstallerFile"
-                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''">
+                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != '' And '$(IsCross)' == 'False'">
         <Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName)</Url>
         <DownloadFileName>$(DownloadedSharedHostInstallerFile)</DownloadFileName>
         <ExtractDestintation></ExtractDestintation>
       </_DownloadAndExtractItem>
 
       <_DownloadAndExtractItem Include="DownloadedHostFxrInstallerFile"
-                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''">
+                               Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != '' And '$(IsCross)' == 'False'">
         <Url>$(CoreSetupInstallerBlobRootUrl)/$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName)</Url>
         <DownloadFileName>$(DownloadedHostFxrInstallerFile)</DownloadFileName>
         <ExtractDestintation></ExtractDestintation>
--- a/build/DependencyVersions.props
+++ b/build/DependencyVersions.props
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <CLI_SharedFrameworkVersion>2.0.0-beta-001509-00</CLI_SharedFrameworkVersion>
+    <CLI_SharedFrameworkVersion>2.0.0-beta-001650-00</CLI_SharedFrameworkVersion>^M
     <CLI_MSBuild_Version>15.2.0-preview-000002-01</CLI_MSBuild_Version>
     <CLI_Roslyn_Version>2.0.0-rc4-61325-08</CLI_Roslyn_Version>
     <CLI_NETSDK_Version>1.1.0-alpha-20170209-1</CLI_NETSDK_Version>
--- a/build/Prepare.targets
+++ b/build/Prepare.targets
@@ -26,10 +26,14 @@
       <OverwriteExtractionDestination Condition="'$(OverwriteExtractionDestination)' == ''">True</OverwriteExtractionDestination>
     </PropertyGroup>
     
-    <DownloadFile Condition=" '@(_DownloadAndExtractItem)' != '' "
+    <DownloadFile Condition=" '@(_DownloadAndExtractItem)' != '' And '$(IsCross)' == 'False'"
                   Uri="%(_DownloadAndExtractItem.Url)"
                   DestinationPath="%(_DownloadAndExtractItem.DownloadFileName)" />
 
+    <Copy Condition=" '$(IsCross)' == 'True' "
+          SourceFiles="$(RepoRoot)/testsource/$(CombinedFrameworkHostCompressedFileName)"
+          DestinationFiles="$(CombinedSharedHostAndFrameworkArchive)" />
+
     <ZipFileExtractToDirectory Condition=" '%(_DownloadAndExtractItem.ExtractDestination)' != '' AND '$(OSName)' == 'win' "
                                SourceArchive="%(_DownloadAndExtractItem.DownloadFileName)"
                                DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestination)"
--- a/build/Stage0.props
+++ b/build/Stage0.props
@@ -5,6 +5,8 @@
       <DotnetStage0>$(Stage0Directory)/dotnet$(ExeExtension)</DotnetStage0>
       <IsDesktopAvailable>False</IsDesktopAvailable>
       <IsDesktopAvailable Condition=" '$(OSName)' == 'win' ">True</IsDesktopAvailable>
+      <IsCross>False</IsCross>
+      <IsCross Condition=" !$(Rid.Contains('$(OSName)')) Or !$(Rid.Contains('$(Architecture)')) ">True</IsCross>
       <CoreCLRRid>$(Rid)</CoreCLRRid>
       <CoreCLRRid Condition=" '$(OSName)' == 'win' ">win7-$(Architecture)</CoreCLRRid>
       <CoreCLRRid Condition=" '$(OSName)' == 'osx' ">osx.10.10-x64</CoreCLRRid>

Expected behavior

Build successful

Actual behavior

Occurred the following errors:

                   "/home/jyoung/git/dotnet/cli-jy/build.proj" (default target) (1) ->
                   (CompileCLI target) -> 
                     /home/jyoung/git/dotnet/cli-jy/build/Compile.targets(50,7): error MSB3680: The source file "/home/jyoung/git/dotnet/cli-jy/artifacts/ubuntu.16.04-arm/stage2/sdk/2.0.0-alpha-005111/System.ComponentModel.Primitives.dll" does not exist. [/home/jyoung/git/dotnet/cli-jy/build.proj]
                     /home/jyoung/git/dotnet/cli-jy/build/Compile.targets(50,7): error MSB3680: The source file "/home/jyoung/git/dotnet/cli-jy/artifacts/ubuntu.16.04-arm/stage2/sdk/2.0.0-alpha-005111/System.Collections.Specialized.dll" does not exist. [/home/jyoung/git/dotnet/cli-jy/build.proj]
                     /home/jyoung/git/dotnet/cli-jy/build/Compile.targets(50,7): error MSB3680: The source file "/home/jyoung/git/dotnet/cli-jy/artifacts/ubuntu.16.04-arm/stage2/sdk/2.0.0-alpha-005111/System.Collections.NonGeneric.dll" does not exist. [/home/jyoung/git/dotnet/cli-jy/build.proj]
                     /home/jyoung/git/dotnet/cli-jy/build/Compile.targets(50,7): error MSB3680: The source file "/home/jyoung/git/dotnet/cli-jy/artifacts/ubuntu.16.04-arm/stage2/sdk/2.0.0-alpha-005111/System.Private.DataContractSerialization.dll" does not exist. [/home/jyoung/git/dotnet/cli-jy/build.proj]

I’m trying to build cli project for Ubuntu.16.04-arm. I already had a tarball for Ubuntu.16.04-arm but there wasn’t in Azure server so I added some patch to copy the local tarball for testing. The copy and decompression worked fine, but fails to copy the core-sdk dlls. Related code:

in build/Compile.targets
      <!-- copy core sdk -->                                                    
      <Copy SourceFiles="@(MSBuildImportsContent)"                              
            DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" /> 

What does that MSBuildImportsContent mean? When I look at the Ubuntu.14.04-x64 log, it looks like there are not any files to copy at that stage, but I can not find any part of it that copies files to SdkOutputDirectory.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

Finally, I got below results!

pi3@raspberry:~/Downloads/c$ time NUGET_PACKAGES=/home/pi3/Downloads/c/p dotnet build
Microsoft (R) Build Engine version 15.2.47.30403
Copyright (C) Microsoft Corporation. All rights reserved.

  c -> /home/pi3/Downloads/c/bin/Debug/netcoreapp2.0/c.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:27.08

real	0m40.917s
user	0m43.890s
sys	0m1.390s

pi3@raspberry:~/Downloads/c$ time NUGET_PACKAGES=/home/pi3/Downloads/c/p dotnet run
Hello World!

real	0m51.861s
user	0m54.380s
sys	0m1.870s

Build Command: (in jyoung:arm/build_ubuntu_arm branch)

./build.sh --runtime-id ubuntu.16.04-arm -c Release /p:CLIBUILD_SKIP_TESTS=true

I need to change sdk to get upper results, my changes are like below:

+++ b/src/Tasks/Microsoft.NET.Build.Tasks/LockFileLookup.cs
@@ -16,11 +16,17 @@ internal class LockFileLookup
 
         public LockFileLookup(LockFile lockFile)
         {
             _packages = new Dictionary<KeyValuePair<string, NuGetVersion>, LockFileLibrary>(PackageCacheKeyComparer.Instance);
             _projects = new Dictionary<string, LockFileLibrary>(StringComparer.OrdinalIgnoreCase);
 
             foreach (var library in lockFile.Libraries)
             {
+                if (library.Type == null)
+                    throw new ArgumentNullException(library.Type);
+
                 var libraryType = LibraryType.Parse(library.Type);
 
                 if (libraryType == LibraryType.Package)

I’m not clear where lockFile.Libraries come from and why the Type is null in arm target. Who can review this?