diff --git a/build_projects/dotnet-host-build/CompileTargets.cs b/build_projects/dotnet-host-build/CompileTargets.cs index 2f5fab5a23..bce8e84bd4 100644 --- a/build_projects/dotnet-host-build/CompileTargets.cs +++ b/build_projects/dotnet-host-build/CompileTargets.cs @@ -30,6 +30,8 @@ public class CompileTargets { "osx.10.11-x64", "osx.10.10-x64" }, { "ubuntu.14.04-x64", "ubuntu.14.04-x64" }, { "ubuntu.16.04-x64", "ubuntu.16.04-x64" }, + { "ubuntu.14.04-arm", "ubuntu.14.04-arm" }, + { "ubuntu.16.04-arm", "ubuntu.16.04-arm" }, { "ubuntu.16.10-x64", "ubuntu.16.10-x64" }, { "centos.7-x64", "rhel.7-x64" }, { "rhel.7-x64", "rhel.7-x64" }, @@ -386,10 +388,23 @@ public static BuildTargetResult PackagePkgProjects(BuildTargetContext c) var hostNugetversion = hostVersion.LatestHostVersion.ToString(); var content = $@"{c.BuildContext["CommitHash"]}{Environment.NewLine}{hostNugetversion}{Environment.NewLine}"; var pkgDir = Path.Combine(c.BuildContext.BuildDirectory, "pkg"); - var packCmd = "pack." + (CurrentPlatform.IsWindows ? "cmd" : "sh"); string rid = HostPackageSupportedRids[c.BuildContext.Get("TargetRID")]; File.WriteAllText(Path.Combine(pkgDir, "version.txt"), content); - Exec(Path.Combine(pkgDir, packCmd)); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Exec(Path.Combine(pkgDir, "pack.cmd")); + } + else + { + List buildScriptArgList = new List(); + string buildScriptFile = Path.Combine(pkgDir, "pack.sh"); + + buildScriptArgList.Add("--rid"); + buildScriptArgList.Add(rid); + + Exec(buildScriptFile, buildScriptArgList); + } foreach (var file in Directory.GetFiles(Path.Combine(pkgDir, "bin", "packages"), "*.nupkg")) { diff --git a/build_projects/dotnet-host-build/PublishTargets.cs b/build_projects/dotnet-host-build/PublishTargets.cs index d834b735ef..f3f6ae9820 100644 --- a/build_projects/dotnet-host-build/PublishTargets.cs +++ b/build_projects/dotnet-host-build/PublishTargets.cs @@ -123,7 +123,9 @@ public static BuildTargetResult FinalizeBuild(BuildTargetContext c) "win.arm.version", "win.arm64.version", "ubuntu.x64.version", + "ubuntu.14.04.arm.version", "ubuntu.16.04.x64.version", + "ubuntu.16.04.arm.version", "ubuntu.16.10.x64.version", "rhel.x64.version", "osx.x64.version", @@ -190,7 +192,9 @@ private static bool CheckIfAllBuildsHavePublished() { "sharedfx_Windows_arm", false }, { "sharedfx_Windows_arm64", false }, { "sharedfx_Ubuntu_x64", false }, + { "sharedfx_Ubuntu_14_04_arm", false }, { "sharedfx_Ubuntu_16_04_x64", false }, + { "sharedfx_Ubuntu_16_04_arm", false }, { "sharedfx_Ubuntu_16_10_x64", false }, { "sharedfx_RHEL_x64", false }, { "sharedfx_OSX_x64", false }, diff --git a/build_projects/dotnet-host-build/TestTargets.cs b/build_projects/dotnet-host-build/TestTargets.cs index e40f340baa..4935f64daa 100644 --- a/build_projects/dotnet-host-build/TestTargets.cs +++ b/build_projects/dotnet-host-build/TestTargets.cs @@ -96,21 +96,24 @@ public static BuildTargetResult RunTests(BuildTargetContext c) return c.Success(); } + private static bool IsCrossArch(string rid) { + if (!String.IsNullOrEmpty(rid)) + { + return (String.Compare(rid, "win8-arm", true) == 0) + || (String.Compare(rid, "win10-arm64", true) == 0) + || (String.Compare(rid, "ubuntu.14.04-arm", true) == 0) + || (String.Compare(rid, "ubuntu.16.04-arm", true) == 0); + } + return false; + } + private static List RunDotnetTestOnTestProjects(BuildTargetContext c, DotNetCli dotnet, string configuration) { var failingTests = new List(); // Fetch the target RID to determine if we support running tests or not. string rid = c.BuildContext.Get("TargetRID"); - bool fIsCrossArch = false; - if (!String.IsNullOrEmpty(rid)) - { - if ((String.Compare(rid, "win8-arm", true) == 0) || (String.Compare(rid, "win10-arm64", true) == 0)) - { - // We dont support running native tests for cross-architecture builds yet. - fIsCrossArch = true; - } - } + bool fIsCrossArch = IsCrossArch(rid); // We dont support running native tests for cross-architecture builds yet. foreach (var project in TestProjects) { diff --git a/build_projects/shared-build-targets-utils/Utils/Crossgen.cs b/build_projects/shared-build-targets-utils/Utils/Crossgen.cs index a07da416ae..89bc982193 100644 --- a/build_projects/shared-build-targets-utils/Utils/Crossgen.cs +++ b/build_projects/shared-build-targets-utils/Utils/Crossgen.cs @@ -45,6 +45,7 @@ private string GetCrossgenPathForVersion() return ridCrossgen; } + // TODO-ARM-Crossgen: Add ubuntu.14.04-arm and ubuntu.16.04-arm if (_targetRID == "win8-arm") { ridCrossgen = Path.Combine(crossgenPackagePath, "tools", "x86_arm", $"crossgen{Constants.ExeSuffix}"); @@ -73,6 +74,7 @@ private string GetLibCLRJitPathForVersion() string jitPath = Path.Combine(jitPackagePath, "runtimes", jitRid, "native", $"{Constants.DynamicLibPrefix}clrjit{Constants.DynamicLibSuffix}"); + // TODO-ARM-Crossgen: Add ubuntu.14.04-arm and ubuntu.16.04-arm if (_targetRID == "win8-arm") { jitPath = Path.Combine(jitPackagePath, "runtimes", "x86_arm", "native", $"{Constants.DynamicLibPrefix}clrjit{Constants.DynamicLibSuffix}"); @@ -228,4 +230,4 @@ public void CrossgenDirectory(string sharedFxPath, string pathToAssemblies) } } } -} \ No newline at end of file +} diff --git a/build_projects/shared-build-targets-utils/Utils/SharedFrameworkPublisher.cs b/build_projects/shared-build-targets-utils/Utils/SharedFrameworkPublisher.cs index cc43eee254..0fe0511890 100644 --- a/build_projects/shared-build-targets-utils/Utils/SharedFrameworkPublisher.cs +++ b/build_projects/shared-build-targets-utils/Utils/SharedFrameworkPublisher.cs @@ -47,6 +47,7 @@ public SharedFrameworkPublisher( // If we are dealing with cross-targeting compilation, then specify the // correct RID for crossgen to use when compiling SharedFramework. + // TODO-ARM-Crossgen: Add ubuntu.14.04-arm and ubuntu.16.04-arm if ((sharedFrameworkRid == "win8-arm") || (sharedFrameworkRid == "win10-arm64")) { crossgenRID = sharedFrameworkRid; diff --git a/pkg/pack.sh b/pkg/pack.sh index 1e9ee02038..0bc3ca0a8e 100755 --- a/pkg/pack.sh +++ b/pkg/pack.sh @@ -1,14 +1,13 @@ #!/usr/bin/env bash -init_distro_name() +usage() { - if [ ! -e /etc/os-release ]; then - echo "WARNING: Can not determine runtime id for current distro." - export __distro_rid="" - else - source /etc/os-release - export __distro_rid="$ID.$VERSION_ID-x64" - fi + echo "Usage: $0 --rid " + echo "" + echo "Options:" + echo " --rid Target Runtime Identifier" + + exit 1 } set -e @@ -25,6 +24,24 @@ done __project_dir="$( cd -P "$( dirname "$SOURCE" )" && pwd )" __distro_rid= +while [ "$1" != "" ]; do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + -h|--help) + usage + exit 1 + ;; + --rid) + shift + __distro_rid=$1 + ;; + *) + echo "Unknown argument to pack.sh $1" + exit 1 + esac + shift +done + # setup msbuild "$__project_dir/init-tools.sh" @@ -44,7 +61,10 @@ if [ "$(uname -s)" == "Darwin" ]; then __targets_param="TargetsOSX=true" else __targets_param="TargetsLinux=true" - init_distro_name + if [ -z $__distro_rid ]; then + echo "Runtime Identifier not defined" + exit 1 + fi fi __common_parameters="/p:$__targets_param /p:DistroRid=$__distro_rid /verbosity:minimal" diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.builds b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.builds index 933cdb3fdf..f747e1b211 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.builds +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.builds @@ -35,10 +35,18 @@ Linux amd64 + + Linux + arm + Linux amd64 + + Linux + arm + Linux amd64 diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj index 0b4fa006ce..b6db556088 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj @@ -34,9 +34,15 @@ amd64 + + arm + amd64 + + arm + amd64 diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.builds b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.builds index e8fdd48cd7..132bf34c3f 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.builds +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.builds @@ -35,10 +35,18 @@ Linux amd64 + + Linux + arm + Linux amd64 + + Linux + arm + Linux amd64 diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.pkgproj b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.pkgproj index 3759402707..6607056e8a 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.pkgproj +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostPolicy.pkgproj @@ -37,9 +37,15 @@ amd64 + + arm + amd64 + + arm + amd64 diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.builds b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.builds index 5f7fd16387..edb1a47a0a 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.builds +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.builds @@ -35,10 +35,18 @@ Linux amd64 + + Linux + arm + Linux amd64 + + Linux + arm + Linux amd64 diff --git a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.pkgproj b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.pkgproj index 9888d97344..e2f1ba5641 100644 --- a/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.pkgproj +++ b/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHostResolver.pkgproj @@ -37,9 +37,15 @@ amd64 + + arm + amd64 + + arm + amd64