diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 3c401e883..2217fae22 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,7 +1,7 @@ - 2.0.6 + 2.0.7-servicing-26322-01 $(MicrosoftNETCoreAppPackageVersion) 15.6.82 $(MicrosoftBuildPackageVersion) diff --git a/build/NugetConfigFile.targets b/build/NugetConfigFile.targets index 1155c016a..e0737ca5a 100644 --- a/build/NugetConfigFile.targets +++ b/build/NugetConfigFile.targets @@ -19,6 +19,7 @@ + diff --git a/run-build.sh b/run-build.sh index 597268b25..9d50c827f 100755 --- a/run-build.sh +++ b/run-build.sh @@ -163,14 +163,6 @@ if [ $EXIT_CODE != 0 ]; then exit $EXIT_CODE fi -# Install a project.json based CLI for use by tests -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR_PJ" --architecture "$ARCHITECTURE" --version "1.0.0-preview2-1-003177") -EXIT_CODE=$? -if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: installing project-json based cli failed with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE -fi - # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" diff --git a/scripts/docker/fedora.27/Dockerfile b/scripts/docker/fedora.27/Dockerfile new file mode 100644 index 000000000..e0f6e851d --- /dev/null +++ b/scripts/docker/fedora.27/Dockerfile @@ -0,0 +1,32 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:fedora-27-82a3800-20180326211504 + +RUN dnf install -y findutils + +RUN dnf upgrade -y nss + +RUN dnf clean all + +# Set a different rid to publish buildtools for, until we update to a version which +# natively supports fedora.24-x64 +ENV __PUBLISH_RID=fedora.23-x64 + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g wheel +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/scripts/docker/opensuse.42.3/Dockerfile b/scripts/docker/opensuse.42.3/Dockerfile new file mode 100644 index 000000000..b128f8bc9 --- /dev/null +++ b/scripts/docker/opensuse.42.3/Dockerfile @@ -0,0 +1,49 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +FROM microsoft/dotnet-buildtools-prereqs:opensuse-42.3-d46ee12-20180327014902 + +# Install the base toolchain we need to build anything (clang, cmake, make and the like) +# this does not include libraries that we need to compile different projects, we'd like +# them in a different layer. +RUN zypper -n install binutils \ + cmake \ + which \ + gcc \ + llvm-clang \ + tar \ + ncurses-utils \ + curl \ + git \ + sudo && \ + zypper clean -a + +# Dependencies of CoreCLR and CoreFX. + +RUN zypper -n install --force-resolution \ + libunwind \ + libicu \ + lttng-ust \ + libuuid1 \ + libopenssl1_0_0 \ + libcurl4 \ + krb5 && \ + zypper clean -a + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g wheel +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/lib/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/scripts/docker/ubuntu.18.04/Dockerfile b/scripts/docker/ubuntu.18.04/Dockerfile new file mode 100644 index 000000000..97d0578c7 --- /dev/null +++ b/scripts/docker/ubuntu.18.04/Dockerfile @@ -0,0 +1,29 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:ubuntu-18.04-f90bc20-20180320154721 + +RUN apt-get update && \ + apt-get -qqy install \ + sudo && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g sudo +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/lib/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/src/Microsoft.DotNet.TestFramework/TestAssets.cs b/src/Microsoft.DotNet.TestFramework/TestAssets.cs index 0e47e3ba9..ca4162fe0 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssets.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssets.cs @@ -17,13 +17,9 @@ namespace Microsoft.DotNet.TestFramework private FileInfo _dotnetCsprojExe; - private FileInfo _dotnetProjectJsonExe; - - private const string ProjectJsonSearchPattern = "project.json"; - private const string CsprojSearchPattern = "*.csproj"; - public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, FileInfo dotnetProjectJsonExe) + public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe) { if (assetsRoot == null) { @@ -35,11 +31,6 @@ namespace Microsoft.DotNet.TestFramework throw new ArgumentNullException(nameof(dotnetCsprojExe)); } - if (dotnetProjectJsonExe == null) - { - throw new ArgumentNullException(nameof(dotnetProjectJsonExe)); - } - if (!assetsRoot.Exists) { throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'"); @@ -50,16 +41,9 @@ namespace Microsoft.DotNet.TestFramework throw new FileNotFoundException("Csproj dotnet executable must exist", dotnetCsprojExe.FullName); } - if (!dotnetProjectJsonExe.Exists) - { - throw new FileNotFoundException("project.json dotnet executable must exist", dotnetProjectJsonExe.FullName); - } - _root = assetsRoot; _dotnetCsprojExe = dotnetCsprojExe; - - _dotnetProjectJsonExe = dotnetProjectJsonExe; } public TestAssetInfo Get(string name) @@ -78,22 +62,6 @@ namespace Microsoft.DotNet.TestFramework CsprojSearchPattern); } - public TestAssetInfo GetProjectJson(string name) - { - return GetProjectJson(TestAssetKinds.TestProjects, name); - } - - public TestAssetInfo GetProjectJson(string kind, string name) - { - var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name)); - - return new TestAssetInfo( - assetDirectory, - name, - _dotnetProjectJsonExe, - ProjectJsonSearchPattern); - } - public DirectoryInfo CreateTestDirectory(string testProjectName = "temp", [CallerMemberName] string callingMethod = "", string identifier = "") { var testDestination = GetTestDestinationDirectoryPath(testProjectName, callingMethod, identifier); diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index 4333b887c..fc38daf17 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -303,7 +303,7 @@ namespace Microsoft.DotNet.Tests result.Should().NotBeNull(); - result.Args.Should().Contain("--fx-version 2.0.6"); + result.Args.Should().Contain("--fx-version 2.0.7-servicing-26322-01"); } [Fact] diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs deleted file mode 100644 index 6b05edfe8..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class BuildPJCommand : TestCommand - { - - private bool _captureOutput; - - private string _configuration; - - private NuGetFramework _framework; - - private string _runtime; - - private bool _noDependencies; - - private DirectoryInfo _outputPath; - - private FileInfo _projectFile; - - private DirectoryInfo _workingDirectory; - - public BuildPJCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args = "") - { - args = $"build {GetNoDependencies()} {GetProjectFile()} {GetOutputPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {args}"; - - if (_workingDirectory != null) - { - this.WithWorkingDirectory(_workingDirectory.FullName); - } - - if (_captureOutput) - { - return base.ExecuteWithCapturedOutput(args); - } - else - { - return base.Execute(args); - } - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - WithCapturedOutput(); - - return Execute(args); - } - - public BuildPJCommand WithCapturedOutput() - { - _captureOutput = true; - - return this; - } - - public BuildPJCommand WithConfiguration(string configuration) - { - _configuration = configuration; - - return this; - } - - public BuildPJCommand WithFramework(NuGetFramework framework) - { - _framework = framework; - - return this; - } - - public BuildPJCommand WithRuntime(string runtime) - { - _runtime = runtime; - - return this; - } - - public BuildPJCommand WithNoDependencies() - { - _noDependencies = true; - - return this; - } - - public BuildPJCommand WithOutputPath(DirectoryInfo outputPath) - { - _outputPath = outputPath; - - return this; - } - - public BuildPJCommand WithProjectDirectory(DirectoryInfo projectDirectory) - { - _workingDirectory = projectDirectory; - - return this; - } - - public BuildPJCommand WithProjectFile(FileInfo projectFile) - { - _projectFile = projectFile; - - return this; - } - - public BuildPJCommand WithWorkingDirectory(DirectoryInfo workingDirectory) - { - _workingDirectory = workingDirectory; - - return this; - } - - private string GetConfiguration() - { - if (_configuration == null) - { - return null; - } - - return $"--configuration {_configuration}"; - } - - private string GetFramework() - { - if (_framework == null) - { - return null; - } - - return $"--framework {_framework.GetShortFolderName()}"; - } - - private string GetRuntime() - { - if (_runtime == null) - { - return null; - } - - return $"--runtime {_runtime}"; - } - - private string GetNoDependencies() - { - if (!_noDependencies) - { - return null; - } - - return "--no-dependencies"; - } - - private string GetOutputPath() - { - if (_outputPath == null) - { - return null; - } - - return $"\"{_outputPath.FullName}\""; - } - - private string GetProjectFile() - { - if (_projectFile == null) - { - return null; - } - - return $"\"{_projectFile.FullName}\""; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs deleted file mode 100644 index a54d89605..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class RestoreProjectJsonCommand : TestCommand - { - public RestoreProjectJsonCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args="") - { - args = $"restore {args}"; - - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"restore {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs deleted file mode 100644 index 3b812ed28..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class ProjectUtils - { - public static string GetProjectJson(string testRoot, string project) - { - // We assume that the project name same as the directory name with contains the project.json - // We can do better here by using ProjectReader to get the correct project name - string projectPath = Directory.GetFiles(testRoot, "project.json", SearchOption.AllDirectories) - .FirstOrDefault(pj => Directory.GetParent(pj).Name.Equals(project)); - - if (string.IsNullOrEmpty(projectPath)) - { - throw new Exception($"Cannot file project '{project}' in '{testRoot}'"); - } - - return projectPath; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index 2f5e1e830..e86f76bac 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -20,7 +20,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string _stage2Sdk; private string _stage2WithBackwardsCompatibleRuntimesDirectory; private string _testPackages; - private string _pjDotnet; public static string RepoRoot { @@ -81,7 +80,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities public string Artifacts => _artifacts; public string BuiltDotnet => _builtDotnet; public string NugetPackages => _nugetPackages; - public string PjDotnet => _pjDotnet; public string Stage2Sdk => _stage2Sdk; public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory; public string TestPackages => _testPackages; @@ -91,13 +89,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities string builtDotnet = null, string nugetPackages = null, string corehostPackages = null, - string corehostDummyPackages = null, - string pjDotnet = null) + string corehostDummyPackages = null) { _artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); - _pjDotnet = pjDotnet ?? GetPjDotnetPath(); _stage2Sdk = Directory .EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")) .First(d => !d.Contains("NuGetFallbackFolder")); diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs index b377b4331..974686b92 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs @@ -52,8 +52,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities s_testAssets = new TestAssets( new DirectoryInfo(assetsRoot), - new FileInfo(new Muxer().MuxerPath), - new FileInfo(new RepoDirectoriesProvider().PjDotnet)); + new FileInfo(new Muxer().MuxerPath)); } return s_testAssets;