Merge branch 'rel/1.0.0' of https://github.com/dotnet/cli into cli-x86-support
This commit is contained in:
commit
01d2656be1
132 changed files with 4399 additions and 527 deletions
96
scripts/dotnet-cli-build/PackageDependencies.cs
Normal file
96
scripts/dotnet-cli-build/PackageDependencies.cs
Normal file
|
@ -0,0 +1,96 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class PackageDependencies
|
||||
{
|
||||
internal static string[] DebianPackageBuildDependencies
|
||||
{
|
||||
get
|
||||
{
|
||||
return new string[]
|
||||
{
|
||||
"devscripts",
|
||||
"debhelper",
|
||||
"build-essential"
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal static string[] UbuntuCoreclrAndCoreFxDependencies
|
||||
{
|
||||
get
|
||||
{
|
||||
return new string[]
|
||||
{
|
||||
"libc6",
|
||||
"libedit2",
|
||||
"libffi6",
|
||||
"libgcc1",
|
||||
"libicu52",
|
||||
"liblldb-3.6",
|
||||
"libllvm3.6",
|
||||
"liblttng-ust0",
|
||||
"liblzma5",
|
||||
"libncurses5",
|
||||
"libpython2.7",
|
||||
"libstdc++6",
|
||||
"libtinfo5",
|
||||
"libunwind8",
|
||||
"liburcu1",
|
||||
"libuuid1",
|
||||
"zlib1g",
|
||||
"libasn1-8-heimdal",
|
||||
"libcomerr2",
|
||||
"libcurl3",
|
||||
"libgcrypt11",
|
||||
"libgnutls26",
|
||||
"libgpg-error0",
|
||||
"libgssapi3-heimdal",
|
||||
"libgssapi-krb5-2",
|
||||
"libhcrypto4-heimdal",
|
||||
"libheimbase1-heimdal",
|
||||
"libheimntlm0-heimdal",
|
||||
"libhx509-5-heimdal",
|
||||
"libidn11",
|
||||
"libk5crypto3",
|
||||
"libkeyutils1",
|
||||
"libkrb5-26-heimdal",
|
||||
"libkrb5-3",
|
||||
"libkrb5support0",
|
||||
"libldap-2.4-2",
|
||||
"libp11-kit0",
|
||||
"libroken18-heimdal",
|
||||
"librtmp0",
|
||||
"libsasl2-2",
|
||||
"libsqlite3-0",
|
||||
"libssl1.0.0",
|
||||
"libtasn1-6",
|
||||
"libwind0-heimdal"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static string[] CentosCoreclrAndCoreFxDependencies
|
||||
{
|
||||
get
|
||||
{
|
||||
return new string[]
|
||||
{
|
||||
"unzip",
|
||||
"libunwind",
|
||||
"gettext",
|
||||
"libcurl-devel",
|
||||
"openssl-devel",
|
||||
"zlib",
|
||||
"libicu-devel"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
using static Microsoft.DotNet.Cli.Build.FS;
|
||||
using static Microsoft.DotNet.Cli.Build.Utils;
|
||||
|
@ -17,6 +18,18 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Target(nameof(Init), nameof(RestorePackages))]
|
||||
public static BuildTargetResult Prepare(BuildTargetContext c) => c.Success();
|
||||
|
||||
[Target(nameof(CheckPrereqCmakePresent), nameof(CheckPlatformDependencies))]
|
||||
public static BuildTargetResult CheckPrereqs(BuildTargetContext c) => c.Success();
|
||||
|
||||
[Target(nameof(CheckCoreclrPlatformDependencies), nameof(CheckInstallerBuildPlatformDependencies))]
|
||||
public static BuildTargetResult CheckPlatformDependencies(BuildTargetContext c) => c.Success();
|
||||
|
||||
[Target(nameof(CheckUbuntuCoreclrAndCoreFxDependencies), nameof(CheckCentOSCoreclrAndCoreFxDependencies))]
|
||||
public static BuildTargetResult CheckCoreclrPlatformDependencies(BuildTargetContext c) => c.Success();
|
||||
|
||||
[Target(nameof(CheckUbuntuDebianPackageBuildDependencies))]
|
||||
public static BuildTargetResult CheckInstallerBuildPlatformDependencies(BuildTargetContext c) => c.Success();
|
||||
|
||||
// All major targets will depend on this in order to ensure variables are set up right if they are run independently
|
||||
[Target(nameof(GenerateVersions), nameof(CheckPrereqs), nameof(LocateStage0))]
|
||||
public static BuildTargetResult Init(BuildTargetContext c)
|
||||
|
@ -91,38 +104,6 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult CheckPrereqs(BuildTargetContext c)
|
||||
{
|
||||
try
|
||||
{
|
||||
Command.Create("cmake", "--version")
|
||||
.CaptureStdOut()
|
||||
.CaptureStdErr()
|
||||
.Execute();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string message = $@"Error running cmake: {ex.Message}
|
||||
cmake is required to build the native host 'corehost'";
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
message += Environment.NewLine + "Download it from https://www.cmake.org";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
message += Environment.NewLine + "Ubuntu: 'sudo apt-get install cmake'";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
message += Environment.NewLine + "OS X w/Homebrew: 'brew install cmake'";
|
||||
}
|
||||
return c.Failed(message);
|
||||
}
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult CheckPackageCache(BuildTargetContext c)
|
||||
{
|
||||
|
@ -200,6 +181,134 @@ cmake is required to build the native host 'corehost'";
|
|||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
[BuildPlatforms(BuildPlatform.Ubuntu)]
|
||||
public static BuildTargetResult CheckUbuntuDebianPackageBuildDependencies(BuildTargetContext c)
|
||||
{
|
||||
|
||||
var messageBuilder = new StringBuilder();
|
||||
var aptDependencyUtility = new AptDependencyUtility();
|
||||
|
||||
|
||||
foreach (var package in PackageDependencies.DebianPackageBuildDependencies)
|
||||
{
|
||||
if (!AptDependencyUtility.PackageIsInstalled(package))
|
||||
{
|
||||
messageBuilder.Append($"Error: Debian package build dependency {package} missing.");
|
||||
messageBuilder.Append(Environment.NewLine);
|
||||
messageBuilder.Append($"-> install with apt-get install {package}");
|
||||
messageBuilder.Append(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
if (messageBuilder.Length == 0)
|
||||
{
|
||||
return c.Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return c.Failed(messageBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[Target]
|
||||
[BuildPlatforms(BuildPlatform.Ubuntu)]
|
||||
public static BuildTargetResult CheckUbuntuCoreclrAndCoreFxDependencies(BuildTargetContext c)
|
||||
{
|
||||
var errorMessageBuilder = new StringBuilder();
|
||||
var stage0 = DotNetCli.Stage0.BinPath;
|
||||
|
||||
foreach (var package in PackageDependencies.UbuntuCoreclrAndCoreFxDependencies)
|
||||
{
|
||||
if (!AptDependencyUtility.PackageIsInstalled(package))
|
||||
{
|
||||
errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
|
||||
errorMessageBuilder.Append(Environment.NewLine);
|
||||
errorMessageBuilder.Append($"-> install with apt-get install {package}");
|
||||
errorMessageBuilder.Append(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessageBuilder.Length == 0)
|
||||
{
|
||||
return c.Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return c.Failed(errorMessageBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[Target]
|
||||
[BuildPlatforms(BuildPlatform.CentOS)]
|
||||
public static BuildTargetResult CheckCentOSCoreclrAndCoreFxDependencies(BuildTargetContext c)
|
||||
{
|
||||
var errorMessageBuilder = new StringBuilder();
|
||||
|
||||
foreach (var package in PackageDependencies.CentosCoreclrAndCoreFxDependencies)
|
||||
{
|
||||
if (!YumDependencyUtility.PackageIsInstalled(package))
|
||||
{
|
||||
errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
|
||||
errorMessageBuilder.Append(Environment.NewLine);
|
||||
errorMessageBuilder.Append($"-> install with yum install {package}");
|
||||
errorMessageBuilder.Append(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessageBuilder.Length == 0)
|
||||
{
|
||||
return c.Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return c.Failed(errorMessageBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult CheckPrereqCmakePresent(BuildTargetContext c)
|
||||
{
|
||||
try
|
||||
{
|
||||
Command.Create("cmake", "--version")
|
||||
.CaptureStdOut()
|
||||
.CaptureStdErr()
|
||||
.Execute();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string message = $@"Error running cmake: {ex.Message}
|
||||
cmake is required to build the native host 'corehost'";
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
message += Environment.NewLine + "Download it from https://www.cmake.org";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
message += Environment.NewLine + "Ubuntu: 'sudo apt-get install cmake'";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
message += Environment.NewLine + "OS X w/Homebrew: 'brew install cmake'";
|
||||
}
|
||||
return c.Failed(message);
|
||||
}
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
private static bool AptPackageIsInstalled(string packageName)
|
||||
{
|
||||
var result = Command.Create("dpkg", "-s", packageName)
|
||||
.CaptureStdOut()
|
||||
.CaptureStdErr()
|
||||
.QuietBuildReporter()
|
||||
.Execute();
|
||||
|
||||
return result.ExitCode == 0;
|
||||
}
|
||||
|
||||
private static IDictionary<string, string> ReadBranchInfo(BuildTargetContext c, string path)
|
||||
{
|
||||
var lines = File.ReadAllLines(path);
|
||||
|
|
|
@ -4,9 +4,14 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args) => BuildSetup.Create(".NET Core CLI")
|
||||
.UseStandardGoals()
|
||||
.UseAllTargetsFromAssembly<Program>()
|
||||
.Run(args);
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
DebugHelper.HandleDebugSwitch(ref args);
|
||||
|
||||
return BuildSetup.Create(".NET Core CLI")
|
||||
.UseStandardGoals()
|
||||
.UseAllTargetsFromAssembly<Program>()
|
||||
.Run(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
"dotnet-build.Tests",
|
||||
"dotnet-pack.Tests",
|
||||
"dotnet-resgen.Tests",
|
||||
"dotnet-run.Tests",
|
||||
"Microsoft.DotNet.Cli.Utils.Tests",
|
||||
"Microsoft.DotNet.Compiler.Common.Tests",
|
||||
"Microsoft.DotNet.ProjectModel.Tests",
|
||||
|
|
24
scripts/dotnet-cli-build/Utils/AptDependencyUtility.cs
Normal file
24
scripts/dotnet-cli-build/Utils/AptDependencyUtility.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class AptDependencyUtility
|
||||
{
|
||||
internal static bool PackageIsInstalled(string packageName)
|
||||
{
|
||||
var result = Command.Create("dpkg", "-s", packageName)
|
||||
.CaptureStdOut()
|
||||
.CaptureStdErr()
|
||||
.QuietBuildReporter()
|
||||
.Execute();
|
||||
|
||||
return result.ExitCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
22
scripts/dotnet-cli-build/Utils/YumDependencyUtility.cs
Normal file
22
scripts/dotnet-cli-build/Utils/YumDependencyUtility.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class YumDependencyUtility
|
||||
{
|
||||
internal static bool PackageIsInstalled(string packageName)
|
||||
{
|
||||
var result = Command.Create("yum", "list", "installed", packageName)
|
||||
.CaptureStdOut()
|
||||
.CaptureStdErr()
|
||||
.QuietBuildReporter()
|
||||
.Execute();
|
||||
|
||||
return result.ExitCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue