From 3b38e6f02132b2c335b0e04bdad1f79090769eb4 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 4 Feb 2020 13:20:42 -0800 Subject: [PATCH 1/4] Update Mono to 6.8.0 --- build.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.json b/build.json index 9a8da37187..cef6e86fff 100644 --- a/build.json +++ b/build.json @@ -4,11 +4,11 @@ "DotNetVersion": "3.0.100", "RequiredMonoVersion": "6.6.0", "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", - "MonoRuntimeMacOS": "mono.macOS-6.6.0.161.zip", - "MonoRuntimeLinux32": "mono.linux-x86-6.6.0.161.zip", - "MonoRuntimeLinux64": "mono.linux-x86_64-6.6.0.161.zip", - "MonoMSBuildRuntime": "Microsoft.Build.Runtime.Mono-6.6.0.161.zip", - "MonoMSBuildLib": "Microsoft.Build.Lib.Mono-6.6.0.161.zip", + "MonoRuntimeMacOS": "mono.macOS-6.8.0.104.zip", + "MonoRuntimeLinux32": "mono.linux-x86-6.8.0.96.zip", + "MonoRuntimeLinux64": "mono.linux-x86_64-6.8.0.96.zip", + "MonoMSBuildRuntime": "Microsoft.Build.Runtime.Mono-6.8.0.104.zip", + "MonoMSBuildLib": "Microsoft.Build.Lib.Mono-6.8.0.104.zip", "HostProjects": [ "OmniSharp.Stdio.Driver", "OmniSharp.Http.Driver" @@ -45,7 +45,7 @@ "WindowsOnlyTestAssets": [ "AntlrGeneratedFiles" ], - "RestoreOnlyTestAssets":[ + "RestoreOnlyTestAssets": [ "ProjectWithMissingType" ] } From 395d9f344314f482aa5152eb9921e3afdea72b3a Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 4 Feb 2020 20:32:08 -0800 Subject: [PATCH 2/4] Fully build the .msbuild folder in build.cake --- build.cake | 69 +++++++++++-- build.json | 2 - mono-packaging/copy-msbuild.sh | 181 --------------------------------- 3 files changed, 62 insertions(+), 190 deletions(-) delete mode 100755 mono-packaging/copy-msbuild.sh diff --git a/build.cake b/build.cake index 5fd13ff867..2e3dd057e3 100644 --- a/build.cake +++ b/build.cake @@ -147,8 +147,6 @@ Task("InstallMonoAssets") DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoRuntimeMacOS}", env.Folders.MonoRuntimeMacOS); DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoRuntimeLinux32}", env.Folders.MonoRuntimeLinux32); DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoRuntimeLinux64}", env.Folders.MonoRuntimeLinux64); - DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoMSBuildRuntime}", env.Folders.MonoMSBuildRuntime); - DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoMSBuildLib}", env.Folders.MonoMSBuildLib); var monoInstallFolder = env.CurrentMonoRuntime.InstallFolder; var monoRuntimeFile = env.CurrentMonoRuntime.RuntimeFile; @@ -196,6 +194,9 @@ Task("CreateMSBuildFolder") var msbuildCurrentTargetFolder = CombinePaths(env.Folders.MSBuild, "Current"); var msbuildCurrentBinTargetFolder = CombinePaths(msbuildCurrentTargetFolder, "Bin"); + DirectoryHelper.ForceCreate(msbuildCurrentTargetFolder); + DirectoryHelper.ForceCreate(msbuildCurrentBinTargetFolder); + var msbuildLibraries = new [] { "Microsoft.Build", @@ -208,6 +209,46 @@ Task("CreateMSBuildFolder") "Microsoft.Build.Utilities.v12.0" }; + var msbuildRuntimeFiles = new [] + { + "Microsoft.Common.CrossTargeting.targets", + "Microsoft.Common.CurrentVersion.targets", + "Microsoft.Common.Mono.targets", + "Microsoft.Common.overridetasks", + "Microsoft.Common.targets", + "Microsoft.Common.tasks", + "Microsoft.CSharp.CrossTargeting.targets", + "Microsoft.CSharp.CurrentVersion.targets", + "Microsoft.CSharp.Mono.targets", + "Microsoft.CSharp.targets", + "Microsoft.Data.Entity.targets", + "Microsoft.Managed.targets", + "Microsoft.NET.props", + "Microsoft.NETFramework.CurrentVersion.props", + "Microsoft.NETFramework.CurrentVersion.targets", + "Microsoft.NETFramework.props", + "Microsoft.NETFramework.targets", + "Microsoft.ServiceModel.targets", + "Microsoft.VisualBasic.CrossTargeting.targets", + "Microsoft.VisualBasic.CurrentVersion.targets", + "Microsoft.VisualBasic.Mono.targets", + "Microsoft.VisualBasic.targets", + "Microsoft.WinFx.targets", + "Microsoft.WorkflowBuildExtensions.targets", + "Microsoft.Xaml.targets", + "MSBuild.dll", + "MSBuild.dll.config", + "System.Buffers.dll", + "System.Collections.Immutable.dll", + "System.Memory.dll", + "System.Numerics.Vectors.dll", + "System.Reflection.Metadata.dll", + "System.Resources.Extensions.dll", + "System.Threading.Tasks.Dataflow.dll", + "Workflow.VisualBasic.targets", + "Workflow.targets" + }; + string sdkResolverTFM; if (Platform.Current.IsWindows) @@ -239,11 +280,25 @@ Task("CreateMSBuildFolder") { Information("Copying Mono MSBuild runtime..."); - var msbuildSourceFolder = env.Folders.MonoMSBuildRuntime; - DirectoryHelper.Copy(msbuildSourceFolder, msbuildCurrentBinTargetFolder, copySubDirectories: false); + var monoBasePath = Platform.Current.IsMacOS + ? "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono" + : "/usr/lib/mono"; + var monoMSBuildPath = $"{monoBasePath}/msbuild/Current/bin"; + var monoXBuildPath = $"{monoBasePath}/xbuild/Current"; - var msbuild15SourceFolder = CombinePaths(msbuildSourceFolder, "15.0"); - DirectoryHelper.Copy(msbuild15SourceFolder, msbuildCurrentTargetFolder); + var commonTargetsSourcePath = CombinePaths(monoXBuildPath, "Microsoft.Common.props"); + var commonTargetsTargetPath = CombinePaths(msbuildCurrentTargetFolder, "Microsoft.Common.props"); + FileHelper.Copy(commonTargetsSourcePath, commonTargetsTargetPath); + + foreach (var runtimeFileName in msbuildRuntimeFiles) + { + var runtimeSourcePath = CombinePaths(monoMSBuildPath, runtimeFileName); + var runtimeTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, runtimeFileName); + if (FileHelper.Exists(runtimeSourcePath)) + { + FileHelper.Copy(runtimeSourcePath, runtimeTargetPath); + } + } Information("Copying MSBuild libraries..."); @@ -252,7 +307,7 @@ Task("CreateMSBuildFolder") var libraryFileName = library + ".dll"; // copy MSBuild from current Mono (should be 6.4.0+) - var librarySourcePath = CombinePaths(Platform.Current.IsMacOS ? "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin" : "/usr/lib/mono/msbuild/Current/bin", libraryFileName); + var librarySourcePath = CombinePaths(monoMSBuildPath, libraryFileName); var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName); if (FileHelper.Exists(librarySourcePath)) { diff --git a/build.json b/build.json index cef6e86fff..21ed93cb2f 100644 --- a/build.json +++ b/build.json @@ -7,8 +7,6 @@ "MonoRuntimeMacOS": "mono.macOS-6.8.0.104.zip", "MonoRuntimeLinux32": "mono.linux-x86-6.8.0.96.zip", "MonoRuntimeLinux64": "mono.linux-x86_64-6.8.0.96.zip", - "MonoMSBuildRuntime": "Microsoft.Build.Runtime.Mono-6.8.0.104.zip", - "MonoMSBuildLib": "Microsoft.Build.Lib.Mono-6.8.0.104.zip", "HostProjects": [ "OmniSharp.Stdio.Driver", "OmniSharp.Http.Driver" diff --git a/mono-packaging/copy-msbuild.sh b/mono-packaging/copy-msbuild.sh deleted file mode 100755 index 42d3ede798..0000000000 --- a/mono-packaging/copy-msbuild.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env bash - -# Copies Mono MSBuild assets needed by OmniSharp. - -# Arguments: -# $1: output directory - -output_path=$1 - -if [ "$output_path" = "" ]; then - output_path=`pwd -P` - echo "No output directory specified. Using $output_path" -fi - -script_path="$(cd "$(dirname "$0")" && pwd -P)" - -target_path="" - -_create_target_path() { - _cleanup_target_path - - target_path=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'` - echo "Using temporary path: $target_path" -} - -# deletes the temp directory -_cleanup_target_path() { - if [ -d "$target_path" ]; then - rm -rf "$target_path" - echo "Deleted temp directory: $target_path" - fi -} - -trap _cleanup_target_path EXIT - -isMac=false - -case `uname` in - "Darwin") - isMac=true - ;; - "Linux") - isMac=false - ;; - *) - echo "This operating system is not supported." - exit 1 - ;; -esac - -mono_version=`mono --version | head -n 1 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'` - -msbuild_libraries=( - "Microsoft.Build.dll" - "Microsoft.Build.Framework.dll" - "Microsoft.Build.Tasks.Core.dll" - "Microsoft.Build.Tasks.v4.0.dll" - "Microsoft.Build.Tasks.v12.0.dll" - "Microsoft.Build.Utilities.Core.dll" - "Microsoft.Build.Utilities.v4.0.dll" - "Microsoft.Build.Utilities.v12.0.dll" -) - -msbuild_runtime=( - "Microsoft.Common.CrossTargeting.targets" - "Microsoft.Common.CurrentVersion.targets" - "Microsoft.Common.Mono.targets" - "Microsoft.Common.overridetasks" - "Microsoft.Common.targets" - "Microsoft.Common.tasks" - "Microsoft.CSharp.CrossTargeting.targets" - "Microsoft.CSharp.CurrentVersion.targets" - "Microsoft.CSharp.Mono.targets" - "Microsoft.CSharp.targets" - "Microsoft.Data.Entity.targets" - "Microsoft.Managed.targets" - "Microsoft.NETFramework.CurrentVersion.props" - "Microsoft.NETFramework.CurrentVersion.targets" - "Microsoft.NETFramework.props" - "Microsoft.NETFramework.targets" - "Microsoft.ServiceModel.targets" - "Microsoft.VisualBasic.CrossTargeting.targets" - "Microsoft.VisualBasic.CurrentVersion.targets" - "Microsoft.VisualBasic.targets" - "Microsoft.WinFx.targets" - "Microsoft.WorkflowBuildExtensions.targets" - "Microsoft.Xaml.targets" - "MSBuild.dll" - "MSBuild.dll.config" -#"System.Data.Common.dll" -"System.Collections.Immutable.dll" -#"System.Diagnostics.StackTrace.dll" -#"System.Diagnostics.Tracing.dll" -#"System.Globalization.Extensions.dll" -#"System.IO.Compression.dll" -#"System.Net.Http.dll" -#"System.Net.Sockets.dll" -"System.Reflection.Metadata.dll" -#"System.Runtime.Serialization.Primitives.dll" -#"System.Security.Cryptography.Algorithms.dll" -#"System.Security.SecureString.dll" -#"System.Threading.Overlapped.dll" -"System.Threading.Tasks.Dataflow.dll" -#"System.Xml.XPath.XDocument.dll" - #"NuGet.targets" - #"Workflow.VisualBasic.targets" - #"Workflow.targets" -) - -_verify_file() { - local file_path=$1 - - if [ ! -f "$file_path" ]; then - echo "File does not exist: $file_path" - exit 1 - fi -} - -_copy_file() { - local file_path=$1 - local target_path=$2 - - _verify_file $file_path - - mkdir -p "$(dirname "$target_path")" - - cp "$file_path" "$target_path" -} - -_create_archive() { - local name=$1 - - pushd "$target_path" - zip -r "$output_path/$name" . - popd -} - -_copy_msbuild_library_assets() { - local mono_msbuild_bin_path="" - - if [ $isMac = true ]; then - mono_base_path=/Library/Frameworks/Mono.framework/Versions/Current - - mono_msbuild_path=$mono_base_path/lib/mono/msbuild - else - mono_msbuild_path=/usr/lib/mono/msbuild - fi - - for file in "${msbuild_libraries[@]}"; do - _copy_file "$mono_msbuild_path/15.0/bin/$file" "$target_path/$file" - done -} - -_copy_msbuild_runtime_assets() { - local mono_msbuild_path="" - local mono_xbuild_path="" - - if [ $isMac = true ]; then - mono_base_path=/Library/Frameworks/Mono.framework/Versions/Current - - mono_msbuild_path=$mono_base_path/lib/mono/msbuild - mono_xbuild_path=$mono_base_path/lib/mono/xbuild - else - mono_msbuild_path=/usr/lib/mono/msbuild - mono_xbuild_path=/usr/lib/mono/xbuild - fi - - _copy_file "$mono_xbuild_path/15.0/Microsoft.Common.props" "$target_path/15.0/Microsoft.Common.props" - - for file in "${msbuild_runtime[@]}"; do - _copy_file "$mono_msbuild_path/15.0/bin/$file" "$target_path/$file" - done -} - -_create_target_path -_copy_msbuild_library_assets -_create_archive "Microsoft.Build.Lib.Mono-$mono_version.zip" - -_create_target_path -_copy_msbuild_runtime_assets -_create_archive "Microsoft.Build.Runtime.Mono-$mono_version.zip" From af55c03844c3b694016062a14c522d78dbee8f00 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 4 Feb 2020 20:34:04 -0800 Subject: [PATCH 3/4] Update Mono version used during build --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f7799eb99e..6b67d1ed17 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,7 +47,7 @@ jobs: vmImage: "macOS-10.13" dependsOn: GitVersion variables: - MONO_VERSION: 6.6.0 + MONO_VERSION: 6.8.0 steps: - template: ./.pipelines/init.yml parameters: @@ -56,7 +56,7 @@ jobs: DotNetVersion: $(DotNetVersion) NuGetVersion: $(NuGetVersion) - script: | - curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.161.macos10.xamarin.universal.pkg + curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.96.macos10.xamarin.universal.pkg sudo installer -pkg mono.pkg -target / sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/ MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION @@ -79,7 +79,7 @@ jobs: vmImage: "Ubuntu-16.04" dependsOn: GitVersion variables: - MONO_VERSION: 6.6.0 + MONO_VERSION: 6.8.0 steps: - template: ./.pipelines/init.yml parameters: @@ -90,7 +90,7 @@ jobs: - script: | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF sudo apt install apt-transport-https ca-certificates - echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/$MONO_VERSION.161 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/$MONO_VERSION.96 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list sudo apt update sudo apt install mono-devel sudo apt install msbuild From 3bd98f447d21824d6de67eb73207bd21189ee22b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 4 Feb 2020 22:21:50 -0800 Subject: [PATCH 4/4] Update to Mono 6.8.0.105 --- azure-pipelines.yml | 4 +- build.json | 94 ++++++++++++++++++++++----------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b67d1ed17..727954a5db 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,7 +56,7 @@ jobs: DotNetVersion: $(DotNetVersion) NuGetVersion: $(NuGetVersion) - script: | - curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.96.macos10.xamarin.universal.pkg + curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.105.macos10.xamarin.universal.pkg sudo installer -pkg mono.pkg -target / sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/ MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION @@ -90,7 +90,7 @@ jobs: - script: | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF sudo apt install apt-transport-https ca-certificates - echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/$MONO_VERSION.96 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/$MONO_VERSION.105 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list sudo apt update sudo apt install mono-devel sudo apt install msbuild diff --git a/build.json b/build.json index 21ed93cb2f..11090f0a04 100644 --- a/build.json +++ b/build.json @@ -1,49 +1,49 @@ { - "DotNetInstallScriptURL": "https://dot.net/v1", - "DotNetChannel": "Current", - "DotNetVersion": "3.0.100", - "RequiredMonoVersion": "6.6.0", - "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", - "MonoRuntimeMacOS": "mono.macOS-6.8.0.104.zip", - "MonoRuntimeLinux32": "mono.linux-x86-6.8.0.96.zip", - "MonoRuntimeLinux64": "mono.linux-x86_64-6.8.0.96.zip", - "HostProjects": [ - "OmniSharp.Stdio.Driver", - "OmniSharp.Http.Driver" - ], - "TestProjects": [ - "OmniSharp.MSBuild.Tests", - "OmniSharp.Roslyn.CSharp.Tests", - "OmniSharp.Http.Tests", - "OmniSharp.Stdio.Tests", - "OmniSharp.DotNetTest.Tests", - "OmniSharp.Tests", - "OmniSharp.Cake.Tests", - "OmniSharp.Script.Tests" - ], - "TestAssets": [ - "NUnitTestProject", - "XunitTestProject", - "MSTestProject", - "ProjectAndSolution", - "ProjectAndSolutionWithProjectSection", - "TwoProjectsWithSolution", - "ProjectWithGeneratedFile", - "CSharpAndFSharp", - "ProjectWithMismatchedFileName", - "SolutionWithSignedProject", - "ProjectWithMultiTFMLib", - "ExternAlias", - "ProjectWithComplexAnalyzers", - "NetCore30Project" - ], - "CakeTestAssets": [ - "CakeProject" - ], - "WindowsOnlyTestAssets": [ - "AntlrGeneratedFiles" - ], - "RestoreOnlyTestAssets": [ - "ProjectWithMissingType" - ] + "DotNetInstallScriptURL": "https://dot.net/v1", + "DotNetChannel": "Current", + "DotNetVersion": "3.0.100", + "RequiredMonoVersion": "6.6.0", + "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", + "MonoRuntimeMacOS": "mono.macOS-6.8.0.105.zip", + "MonoRuntimeLinux32": "mono.linux-x86-6.8.0.105.zip", + "MonoRuntimeLinux64": "mono.linux-x86_64-6.8.0.105.zip", + "HostProjects": [ + "OmniSharp.Stdio.Driver", + "OmniSharp.Http.Driver" + ], + "TestProjects": [ + "OmniSharp.MSBuild.Tests", + "OmniSharp.Roslyn.CSharp.Tests", + "OmniSharp.Http.Tests", + "OmniSharp.Stdio.Tests", + "OmniSharp.DotNetTest.Tests", + "OmniSharp.Tests", + "OmniSharp.Cake.Tests", + "OmniSharp.Script.Tests" + ], + "TestAssets": [ + "NUnitTestProject", + "XunitTestProject", + "MSTestProject", + "ProjectAndSolution", + "ProjectAndSolutionWithProjectSection", + "TwoProjectsWithSolution", + "ProjectWithGeneratedFile", + "CSharpAndFSharp", + "ProjectWithMismatchedFileName", + "SolutionWithSignedProject", + "ProjectWithMultiTFMLib", + "ExternAlias", + "ProjectWithComplexAnalyzers", + "NetCore30Project" + ], + "CakeTestAssets": [ + "CakeProject" + ], + "WindowsOnlyTestAssets": [ + "AntlrGeneratedFiles" + ], + "RestoreOnlyTestAssets": [ + "ProjectWithMissingType" + ] }