From e3056303aae9d67f7454c897048b1bcf496f655c Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 11:03:56 -0700 Subject: [PATCH 01/10] Rename compilationOptions to buildOptions in project.json files This resolves #928. This is a breaking change in that you *must* be running a recent version of .NET CLI. --- src/Microsoft.PowerShell.Commands.Management/project.json | 4 ++-- src/Microsoft.PowerShell.Commands.Utility/project.json | 6 +++--- src/Microsoft.PowerShell.ConsoleHost/project.json | 4 ++-- .../project.json | 6 +++--- src/Microsoft.PowerShell.CoreCLR.Eventing/project.json | 6 +++--- src/Microsoft.PowerShell.PSReadLine/project.json | 4 ++-- src/Microsoft.PowerShell.Security/project.json | 4 ++-- src/System.Management.Automation/project.json | 6 +++--- src/System.Security.SecureString/project.json | 2 +- src/TypeCatalogGen/project.json | 2 +- src/TypeCatalogParser/project.json | 2 +- src/powershell/project.json | 4 ++-- test/PSReadLine/project.json | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/project.json b/src/Microsoft.PowerShell.Commands.Management/project.json index 58a0c0657..5eb180316 100644 --- a/src/Microsoft.PowerShell.Commands.Management/project.json +++ b/src/Microsoft.PowerShell.Commands.Management/project.json @@ -3,7 +3,7 @@ "version": "1.0.0-*", "authors": [ "garretts", "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, @@ -15,7 +15,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "dependencies": { diff --git a/src/Microsoft.PowerShell.Commands.Utility/project.json b/src/Microsoft.PowerShell.Commands.Utility/project.json index bcdf61b06..3f20366ff 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/project.json +++ b/src/Microsoft.PowerShell.Commands.Utility/project.json @@ -3,14 +3,14 @@ "version": "1.0.0-*", "authors": [ "garretts", "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, "configurations": { "Linux": { - "compilationOptions": { + "buildOptions": { "define": [ "LINUX" ] } } @@ -22,7 +22,7 @@ "frameworks": { "netstandard1.5": { - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "imports": [ "dnxcore50", "portable-net45+win8" ], diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json index 20d094351..fd5325fb9 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/project.json +++ b/src/Microsoft.PowerShell.ConsoleHost/project.json @@ -4,7 +4,7 @@ "description": "PowerShell Host", "authors": [ "sevoroby", "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, @@ -25,7 +25,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50", "portable-net45+win8" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR", "PORTABLE" ] }, "dependencies": { diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json index 89ab31b97..44087e8ee 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json @@ -3,13 +3,13 @@ "version": "1.0.0-*", "authors": [ "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true }, "configurations": { "Linux": { - "compilationOptions": { + "buildOptions": { "define": [ "LINUX" ] } } @@ -18,7 +18,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "dependencies": { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json index 22e15060c..ed146f543 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json @@ -3,14 +3,14 @@ "version": "1.0.0-*", "authors": [ "sevoroby" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, "configurations": { "Linux": { - "compilationOptions": { + "buildOptions": { "define": [ "NOETW" ] } } @@ -19,7 +19,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "dependencies": { diff --git a/src/Microsoft.PowerShell.PSReadLine/project.json b/src/Microsoft.PowerShell.PSReadLine/project.json index 172b9ae40..7f9bce543 100644 --- a/src/Microsoft.PowerShell.PSReadLine/project.json +++ b/src/Microsoft.PowerShell.PSReadLine/project.json @@ -3,7 +3,7 @@ "version": "1.0.0-*", "authors": [ "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true }, @@ -13,7 +13,7 @@ "frameworks": { "netstandard1.5": { - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "imports": [ "dnxcore50", "portable-net45+win8" ] diff --git a/src/Microsoft.PowerShell.Security/project.json b/src/Microsoft.PowerShell.Security/project.json index bf6fd2486..bf7057573 100644 --- a/src/Microsoft.PowerShell.Security/project.json +++ b/src/Microsoft.PowerShell.Security/project.json @@ -3,7 +3,7 @@ "version": "1.0.0-*", "authors": [ "garretts", "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, @@ -15,7 +15,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] } }, diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index e66f8f86f..216f823f4 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -3,14 +3,14 @@ "version": "1.0.0-*", "authors": [ "garretts", "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, "configurations": { "Linux": { - "compilationOptions": { + "buildOptions": { "define": [ "LINUX", "NOETW" ] } } @@ -23,7 +23,7 @@ "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "dependencies": { diff --git a/src/System.Security.SecureString/project.json b/src/System.Security.SecureString/project.json index 311de9620..c27bcc313 100644 --- a/src/System.Security.SecureString/project.json +++ b/src/System.Security.SecureString/project.json @@ -4,7 +4,7 @@ "description": "SecureString Stub borrowed from Mono", "authors": [ "garretts" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true }, diff --git a/src/TypeCatalogGen/project.json b/src/TypeCatalogGen/project.json index c9e79d795..2ed878846 100644 --- a/src/TypeCatalogGen/project.json +++ b/src/TypeCatalogGen/project.json @@ -4,7 +4,7 @@ "description": "Generates CorePsTypeCatalog.cs given powershell.inc", "authors": [ "andschwa" ], - "compilationOptions": { + "buildOptions": { "emitEntryPoint": true }, diff --git a/src/TypeCatalogParser/project.json b/src/TypeCatalogParser/project.json index 92f387418..d29a2eebc 100644 --- a/src/TypeCatalogParser/project.json +++ b/src/TypeCatalogParser/project.json @@ -1,5 +1,5 @@ { - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "emitEntryPoint": true }, diff --git a/src/powershell/project.json b/src/powershell/project.json index 7e5e6fc77..9ee25ae02 100644 --- a/src/powershell/project.json +++ b/src/powershell/project.json @@ -4,7 +4,7 @@ "description": ".NET CLI PowerShell app", "authors": [ "andschwa" ], - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true, "emitEntryPoint": true @@ -26,7 +26,7 @@ "frameworks": { "netcoreapp1.0": { "imports": [ "dnxcore50", "portable-net45+win8" ], - "compilationOptions": { + "buildOptions": { "define": [ "CORECLR" ] }, "dependencies": { diff --git a/test/PSReadLine/project.json b/test/PSReadLine/project.json index 80263abfb..d9be88df9 100644 --- a/test/PSReadLine/project.json +++ b/test/PSReadLine/project.json @@ -3,7 +3,7 @@ "version": "1.0.0-*", "description": "PSReadLine basic tests", - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "emitEntryPoint": true }, From 80aceb7a8a0eae158c05a3666a1fa3909f1e5fc8 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 11:15:37 -0700 Subject: [PATCH 02/10] Move compile data to build options --- .../project.json | 7 +++---- src/Microsoft.PowerShell.Commands.Utility/project.json | 7 +++---- src/Microsoft.PowerShell.ConsoleHost/project.json | 9 +++------ src/Microsoft.PowerShell.CoreCLR.Eventing/project.json | 7 +++---- src/Microsoft.PowerShell.Security/project.json | 7 +++---- src/System.Management.Automation/project.json | 9 +++------ 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/project.json b/src/Microsoft.PowerShell.Commands.Management/project.json index 5eb180316..97c855f81 100644 --- a/src/Microsoft.PowerShell.Commands.Management/project.json +++ b/src/Microsoft.PowerShell.Commands.Management/project.json @@ -5,7 +5,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/Microsoft.PowerShell.Commands.Management/*.cs" ] }, "dependencies": { @@ -34,7 +35,5 @@ "Microsoft.WSMan.Management": "1.0.0" } } - }, - - "compile": [ "../windows-build/gen/Microsoft.PowerShell.Commands.Management/*.cs" ] + } } diff --git a/src/Microsoft.PowerShell.Commands.Utility/project.json b/src/Microsoft.PowerShell.Commands.Utility/project.json index 3f20366ff..89e813cb6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/project.json +++ b/src/Microsoft.PowerShell.Commands.Utility/project.json @@ -5,7 +5,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/Microsoft.PowerShell.Commands.Utility/*.cs" ] }, "configurations": { @@ -43,7 +44,5 @@ "Microsoft.mshtml": "1.0.0" } } - }, - - "compile": [ "../windows-build/gen/Microsoft.PowerShell.Commands.Utility/*.cs" ] + } } diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json index fd5325fb9..b04a7ae64 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/project.json +++ b/src/Microsoft.PowerShell.ConsoleHost/project.json @@ -6,7 +6,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/Microsoft.PowerShell.ConsoleHost/*.cs" ] }, "dependencies": { @@ -36,9 +37,5 @@ }, "net451": { } - }, - - "compile": [ - "../windows-build/gen/Microsoft.PowerShell.ConsoleHost/*.cs" - ] + } } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json index ed146f543..6a35f47c3 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json @@ -5,7 +5,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/Microsoft.PowerShell.CoreCLR.Eventing/*.cs" ] }, "configurations": { @@ -29,7 +30,5 @@ "System.Security.SecureString": "4.0.0-*" } } - }, - - "compile": [ "../windows-build/gen/Microsoft.PowerShell.CoreCLR.Eventing/*.cs" ] + } } diff --git a/src/Microsoft.PowerShell.Security/project.json b/src/Microsoft.PowerShell.Security/project.json index bf7057573..fe0710e3b 100644 --- a/src/Microsoft.PowerShell.Security/project.json +++ b/src/Microsoft.PowerShell.Security/project.json @@ -5,7 +5,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/Microsoft.PowerShell.Security/*.cs" ] }, "dependencies": { @@ -21,7 +22,5 @@ }, "net451": { } - }, - - "compile": [ "../windows-build/gen/Microsoft.PowerShell.Security/*.cs" ] + } } diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index 216f823f4..5acef7e89 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -5,7 +5,8 @@ "buildOptions": { "warningsAsErrors": true, - "allowUnsafe": true + "allowUnsafe": true, + "compile": [ "../windows-build/gen/System.Management.Automation/*.cs" ] }, "configurations": { @@ -78,9 +79,5 @@ "System.Configuration.Install": "" } } - }, - - "compile": [ - "../windows-build/gen/System.Management.Automation/*.cs" - ] + } } From e61d698bbc4fea470041587928baced1695bb3d1 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 11:49:40 -0700 Subject: [PATCH 03/10] Remove NOETW in favor of LINUX ETW is available on Windows, so this is only (and will always be) necessary for Linux. --- src/Microsoft.PowerShell.CoreCLR.Eventing/project.json | 8 -------- src/System.Management.Automation/CoreCLR/CorePsStub.cs | 2 +- src/System.Management.Automation/logging/MshLog.cs | 2 +- src/System.Management.Automation/project.json | 2 +- .../utils/PowerShellETWTracer.cs | 2 +- .../utils/tracing/EtwActivity.cs | 2 +- .../utils/tracing/EtwActivityReverter.cs | 2 +- .../utils/tracing/EtwActivityReverterMethodInvoker.cs | 2 +- .../utils/tracing/EtwEventCorrelator.cs | 2 +- .../utils/tracing/IMethodInvoker.cs | 2 +- .../utils/tracing/PSEtwLog.cs | 2 +- .../utils/tracing/PSEtwLogProvider.cs | 2 +- src/System.Management.Automation/utils/tracing/Tracing.cs | 2 +- .../utils/tracing/TracingGen.cs | 2 +- 14 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json index 6a35f47c3..2ff44c9ba 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/project.json @@ -9,14 +9,6 @@ "compile": [ "../windows-build/gen/Microsoft.PowerShell.CoreCLR.Eventing/*.cs" ] }, - "configurations": { - "Linux": { - "buildOptions": { - "define": [ "NOETW" ] - } - } - }, - "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50" ], diff --git a/src/System.Management.Automation/CoreCLR/CorePsStub.cs b/src/System.Management.Automation/CoreCLR/CorePsStub.cs index 185cdc172..ae5670654 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsStub.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsStub.cs @@ -1409,7 +1409,7 @@ namespace System.Management.Automation.Security } -#if NOETW || LINUX +#if LINUX // Porting note: Tracing is absolutely not available on Linux namespace System.Management.Automation.Tracing diff --git a/src/System.Management.Automation/logging/MshLog.cs b/src/System.Management.Automation/logging/MshLog.cs index e380c51a3..59ed23f05 100644 --- a/src/System.Management.Automation/logging/MshLog.cs +++ b/src/System.Management.Automation/logging/MshLog.cs @@ -172,7 +172,7 @@ namespace System.Management.Automation #endif Collection providers = new Collection(); // Porting note: Linux does not support ETW -#if !NOETW && !LINUX +#if !LINUX try { #if !CORECLR //TODO:CORECLR EventLogLogProvider not handled yet diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index 5acef7e89..b5fd0b342 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -12,7 +12,7 @@ "configurations": { "Linux": { "buildOptions": { - "define": [ "LINUX", "NOETW" ] + "define": [ "LINUX" ] } } }, diff --git a/src/System.Management.Automation/utils/PowerShellETWTracer.cs b/src/System.Management.Automation/utils/PowerShellETWTracer.cs index 7685073ba..d9ec3d2df 100644 --- a/src/System.Management.Automation/utils/PowerShellETWTracer.cs +++ b/src/System.Management.Automation/utils/PowerShellETWTracer.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX // // Copyright (C) Microsoft. All rights reserved. // diff --git a/src/System.Management.Automation/utils/tracing/EtwActivity.cs b/src/System.Management.Automation/utils/tracing/EtwActivity.cs index 19ed45d07..e7256d36e 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivity.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivity.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX // // Copyright (C) Microsoft. All rights reserved. // diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs index ec3b9d385..30f621040 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX //----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs index 3cd849ea9..8ccd2159f 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX //----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs index a8df80b9e..8a2d54654 100644 --- a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs +++ b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX //----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs index 980788273..51c33a1d2 100644 --- a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX //----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs index c784b2975..08ae05b4f 100644 --- a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX // // Copyright (C) Microsoft. All rights reserved. // diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs index 2f8d206e2..4c04fe963 100644 --- a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX // // Copyright (C) Microsoft. All rights reserved. // diff --git a/src/System.Management.Automation/utils/tracing/Tracing.cs b/src/System.Management.Automation/utils/tracing/Tracing.cs index eea3605ad..ce69bb5d5 100644 --- a/src/System.Management.Automation/utils/tracing/Tracing.cs +++ b/src/System.Management.Automation/utils/tracing/Tracing.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX // // Copyright (C) Microsoft. All rights reserved. // diff --git a/src/System.Management.Automation/utils/tracing/TracingGen.cs b/src/System.Management.Automation/utils/tracing/TracingGen.cs index 30564cff1..e781bbffc 100644 --- a/src/System.Management.Automation/utils/tracing/TracingGen.cs +++ b/src/System.Management.Automation/utils/tracing/TracingGen.cs @@ -1,4 +1,4 @@ -#if !NOETW +#if !LINUX using System; using System.Collections; using System.Diagnostics.Eventing; From 1a1de1d4a0d0b368eab105fd519c5790bd95369f Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 11:52:35 -0700 Subject: [PATCH 04/10] Remove unnecessary LINUX configuration from Commands.Utility --- src/Microsoft.PowerShell.Commands.Utility/project.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/project.json b/src/Microsoft.PowerShell.Commands.Utility/project.json index 89e813cb6..1f36dd7d1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/project.json +++ b/src/Microsoft.PowerShell.Commands.Utility/project.json @@ -9,14 +9,6 @@ "compile": [ "../windows-build/gen/Microsoft.PowerShell.Commands.Utility/*.cs" ] }, - "configurations": { - "Linux": { - "buildOptions": { - "define": [ "LINUX" ] - } - } - }, - "dependencies": { "System.Management.Automation": "1.0.0-*" }, From 44f3fb121122ed2dbbba063afa100e73d072e77a Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 12:41:26 -0700 Subject: [PATCH 05/10] Update content to `copyToOutput` and `publishOptions` These must be duplicated as we require the same files for both `build` and `publish`. This is the requirement of the new schema, as `content` was split. Note that while each key can take an object, if given just a `string[]` as we do here, it defaults to `include`. See the new schema: https://github.com/aspnet/Announcements/issues/175 --- .../project.json | 22 ++++++++++++------- src/powershell/project.json | 20 ++++++++++++----- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json index b04a7ae64..c09ff9b9d 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/project.json +++ b/src/Microsoft.PowerShell.ConsoleHost/project.json @@ -7,22 +7,28 @@ "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true, - "compile": [ "../windows-build/gen/Microsoft.PowerShell.ConsoleHost/*.cs" ] + "compile": [ "../windows-build/gen/Microsoft.PowerShell.ConsoleHost/*.cs" ], + "copyToOutput": [ + "Modules", + "../Modules", + "powershell.exe", + "../../powershell.version" + ] }, + "publishOptions": [ + "Modules", + "../Modules", + "powershell.exe", + "../../powershell.version" + ], + "dependencies": { "Microsoft.PowerShell.PSReadLine": "1.0.0-*", "Microsoft.PowerShell.Commands.Management": "1.0.0-*", "Microsoft.PowerShell.Commands.Utility": "1.0.0-*" }, - "content": [ - "Modules", - "../Modules", - "powershell.exe", - "../../powershell.version" - ], - "frameworks": { "netstandard1.5": { "imports": [ "dnxcore50", "portable-net45+win8" ], diff --git a/src/powershell/project.json b/src/powershell/project.json index 9ee25ae02..7b69e54ed 100644 --- a/src/powershell/project.json +++ b/src/powershell/project.json @@ -7,14 +7,18 @@ "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true, - "emitEntryPoint": true + "emitEntryPoint": true, + "copyToOutput": [ + "Modules", + "../Modules", + "*_profile.ps1", + "*.so", + "*.dylib", + "../../powershell.version" + ] }, - "dependencies": { - "Microsoft.PowerShell.ConsoleHost": "1.0.0-*" - }, - - "content": [ + "publishOptions": [ "Modules", "../Modules", "*_profile.ps1", @@ -23,6 +27,10 @@ "../../powershell.version" ], + "dependencies": { + "Microsoft.PowerShell.ConsoleHost": "1.0.0-*" + }, + "frameworks": { "netcoreapp1.0": { "imports": [ "dnxcore50", "portable-net45+win8" ], From 9b2be207f77770e4a654e95ea2ee93ad588a0108 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 12:44:18 -0700 Subject: [PATCH 06/10] Don't attempt to publish any profiles PowerShell does not ship with any default profiles. --- src/powershell/project.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/powershell/project.json b/src/powershell/project.json index 7b69e54ed..8ea2ea4e0 100644 --- a/src/powershell/project.json +++ b/src/powershell/project.json @@ -11,7 +11,6 @@ "copyToOutput": [ "Modules", "../Modules", - "*_profile.ps1", "*.so", "*.dylib", "../../powershell.version" @@ -21,7 +20,6 @@ "publishOptions": [ "Modules", "../Modules", - "*_profile.ps1", "*.so", "*.dylib", "../../powershell.version" From 2639f2a8ae6aabe87831c1175ce35679ffd78718 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 13:00:33 -0700 Subject: [PATCH 07/10] Use `include` key in `copyToOutput` and `publishOptions` While the schema says that a `string[]` will be picked up as if `{ "include" : [ ... ] }` was used, it does not. This is a .NET CLI bug. --- .../project.json | 20 ++++++++++------- src/powershell/project.json | 22 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json index c09ff9b9d..22a12273e 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/project.json +++ b/src/Microsoft.PowerShell.ConsoleHost/project.json @@ -8,7 +8,18 @@ "warningsAsErrors": true, "allowUnsafe": true, "compile": [ "../windows-build/gen/Microsoft.PowerShell.ConsoleHost/*.cs" ], - "copyToOutput": [ + "copyToOutput": { + "include": [ + "Modules", + "../Modules", + "powershell.exe", + "../../powershell.version" + ] + } + }, + + "publishOptions": { + "include": [ "Modules", "../Modules", "powershell.exe", @@ -16,13 +27,6 @@ ] }, - "publishOptions": [ - "Modules", - "../Modules", - "powershell.exe", - "../../powershell.version" - ], - "dependencies": { "Microsoft.PowerShell.PSReadLine": "1.0.0-*", "Microsoft.PowerShell.Commands.Management": "1.0.0-*", diff --git a/src/powershell/project.json b/src/powershell/project.json index 8ea2ea4e0..c14dba975 100644 --- a/src/powershell/project.json +++ b/src/powershell/project.json @@ -8,7 +8,19 @@ "warningsAsErrors": true, "allowUnsafe": true, "emitEntryPoint": true, - "copyToOutput": [ + "copyToOutput": { + "include": [ + "Modules", + "../Modules", + "*.so", + "*.dylib", + "../../powershell.version" + ] + } + }, + + "publishOptions": { + "include": [ "Modules", "../Modules", "*.so", @@ -17,14 +29,6 @@ ] }, - "publishOptions": [ - "Modules", - "../Modules", - "*.so", - "*.dylib", - "../../powershell.version" - ], - "dependencies": { "Microsoft.PowerShell.ConsoleHost": "1.0.0-*" }, From 11d2c2c6e78d17ed4d489b85efb4ef6525680af9 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 14:02:25 -0700 Subject: [PATCH 08/10] Update `Start-PSBootstrap` to use .NET CLI's scripts Linux and OS X no longer install packages, instead they download the 1.0.0 uninstall and install scripts provided by .NET CLI, uninstall all existing `dotnet` packages, and "install" the latest 1.0.0 preview2 version of `dotnet` to `~/.dotnet`, which `Start-PSBuild` automatically picks up. Additionally, `Start-PSBootstrap` only attempts to install dependencies when it detects that it is on Ubuntu 14.04, otherwise it warns that dependencies must be installed manually, and still installs `dotnet` via their obtain script. This makes `Start-PSBootstrap` safe to run on Debian, and usable on CentOS. --- build.psm1 | 92 +++++++++++++++++++++++++++++------------------- tools/.gitignore | 2 ++ 2 files changed, 58 insertions(+), 36 deletions(-) create mode 100644 tools/.gitignore diff --git a/build.psm1 b/build.psm1 index 17e0d72f7..f1e670def 100644 --- a/build.psm1 +++ b/build.psm1 @@ -66,8 +66,8 @@ function Start-PSBuild { Write-Verbose "Appending probable .NET CLI tool path" if ($IsWindows) { $env:Path += ";$env:LocalAppData\Microsoft\dotnet" - } elseif ($IsOSX) { - $env:PATH += ":/usr/local/share/dotnet" + } else { + $env:PATH += ":$env:HOME/.dotnet" } } @@ -371,48 +371,68 @@ function Start-PSBootstrap { Write-Host "Installing Open PowerShell build dependencies" - if ($IsLinux) { - precheck 'curl' "Bootstrap dependency 'curl' not found in PATH, please install!" > $null - precheck 'apt-get' "Bootstrap dependency 'apt-get' not found in PATH, this only supports Ubuntu 14.04!" > $null + Push-Location $PSScriptRoot/tools - # Setup LLVM feed - curl -s http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | sudo tee /etc/apt/sources.list.d/llvm.list - sudo apt-get update -qq + try { + # Install dependencies for Linux and OS X + if ($IsLinux) { + $IsUbuntu = Select-String "Ubuntu 14.04" /etc/os-release -Quiet + precheck 'curl' "Bootstrap dependency 'curl' not found in PATH, please install!" > $null + if ($IsUbuntu) { + # Setup LLVM feed + curl -s http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - + echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt-get update -qq - # Install ours and .NET's dependencies - sudo apt-get install -y make g++ cmake libc6 libgcc1 libstdc++6 libcurl3 libgssapi-krb5-2 libicu52 liblldb-3.6 liblttng-ust0 libssl1.0.0 libunwind8 libuuid1 zlib1g clang-3.5 + # Install ours and .NET's dependencies + sudo apt-get install -y -qq make g++ cmake libc6 libgcc1 libstdc++6 libcurl3 libgssapi-krb5-2 libicu52 liblldb-3.6 liblttng-ust0 libssl1.0.0 libunwind8 libuuid1 zlib1g clang-3.5 + } else { + Write-Warning "This script only supports Ubuntu 14.04, you must install dependencies manually!" + } + } elseif ($IsOSX) { + precheck 'brew' "Bootstrap dependency 'brew' not found, must install Homebrew! See http://brew.sh/" - # Install .NET CLI packages - Remove-Item dotnet*.deb + # Install ours and .NET's dependencies + brew install cmake wget openssl + } - wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-host-ubuntu-x64.latest.deb - sudo dpkg -i dotnet-host-ubuntu-x64.latest.deb + $obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain" - wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sharedframework-ubuntu-x64.latest.deb - sudo dpkg -i dotnet-sharedframework-ubuntu-x64.latest.deb + # Install for Linux and OS X + if ($IsLinux -or $IsOSX) { + # Uninstall all previous dotnet packages + $uninstallScript = if ($IsUbuntu) { + "dotnet-uninstall-debian-packages.sh" + } elseif ($IsOSX) { + "dotnet-uninstall-pkgs.sh" + } - wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sdk-ubuntu-x64.latest.deb - sudo dpkg -i dotnet-sdk-ubuntu-x64.latest.deb + if ($uninstallScript) { + curl -s $obtainUrl/uninstall/$uninstallScript -o $uninstallScript + chmod +x $uninstallScript + sudo ./$uninstallScript + } else { + Write-Warning "This script only removes prior versions of dotnet for Ubuntu 14.04 and OS X" + } - } elseif ($IsOSX) { - precheck 'brew' "Bootstrap dependency 'brew' not found, must install Homebrew! See http://brew.sh/" + # Install new dotnet 1.0.0 preview packages + $installScript = "dotnet-install.sh" + curl -s $obtainUrl/$installScript -o $installScript + chmod +x $installScript + bash ./$installScript -c preview + } - # Install ours and .NET's dependencies - brew install cmake wget openssl - - # Install .NET CLI packages - Remove-Item dotnet*.pkg - wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-dev-osx-x64.latest.pkg - sudo installer -pkg dotnet-dev-osx-x64.latest.pkg -target / - - } elseif ($IsWindows -And -Not $IsCore) { - Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet - Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1 -OutFile dotnet-install.ps1 - ./dotnet-install.ps1 - - } else { - Write-Warning "Start-PSBootstrap cannot be run in Core PowerShell on Windows (need Invoke-WebRequest!)" + # Install for Windows + if ($IsWindows -and -not $IsCore) { + Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet + $installScript = "dotnet-install.ps1" + Invoke-WebRequest -Uri $obtainUrl/$installScript -OutFile $installScript + & ./$installScript + } elseif ($IsWindows) { + Write-Warning "Start-PSBootstrap cannot be run in Core PowerShell on Windows (need Invoke-WebRequest!)" + } + } finally { + Pop-Location } } diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 000000000..528e5b9e1 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,2 @@ +dotnet-install.sh +dotnet-uninstall-debian-packages.sh From 896129652c655146f5bc8735642e19e3776e5bcd Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 14:24:20 -0700 Subject: [PATCH 09/10] Force link openssl on OS X --- build.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build.psm1 b/build.psm1 index f1e670def..69be76130 100644 --- a/build.psm1 +++ b/build.psm1 @@ -394,6 +394,7 @@ function Start-PSBootstrap { # Install ours and .NET's dependencies brew install cmake wget openssl + brew link --force openssl } $obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain" From c9c20988c366b6c3d288b8eb6f4aacddba4430e5 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 10 Jun 2016 16:06:08 -0700 Subject: [PATCH 10/10] Update building documentations for Linux and OS X --- docs/building/linux.md | 12 ++++++++---- docs/building/osx.md | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/building/linux.md b/docs/building/linux.md index 130e104b7..9e1346d33 100644 --- a/docs/building/linux.md +++ b/docs/building/linux.md @@ -7,8 +7,9 @@ start by showing how to set up your environment from scratch. Environment =========== -These instructions are written assuming the Ubuntu 14.04 LTS, since -that's the distro the team uses. +These instructions are written assuming the Ubuntu 14.04 LTS, since that's the +distro the team uses. The build module works on a best-effort basis for other +distributions. Git Setup --------- @@ -74,8 +75,11 @@ The `Start-PSBootstrap` function does the following: - Adds the LLVM package feed - Installs our dependencies combined with the dependencies of the .NET CLI toolchain via `apt-get` -- Installs the .NET CLI host, shared framework, and SDK by downloading - the three `.deb` packages and using `dpkg -i` +- Uninstalls any prior versions of .NET CLI +- Downloads and installs the latest .NET CLI 1.0.0-preview2 SDK to `~/.dotnet` + +If you want to use `dotnet` outside of `Start-PSBuild`, add `~/.dotnet` to your +`PATH` environment variable. [dotnet-cli]: https://github.com/dotnet/cli#new-to-net-cli [CMake]: https://cmake.org/cmake/help/v2.8.12/cmake.html diff --git a/docs/building/osx.md b/docs/building/osx.md index 112fddda9..8ed403dbe 100644 --- a/docs/building/osx.md +++ b/docs/building/osx.md @@ -20,12 +20,12 @@ install a self-hosted copy of PowerShell on your OS X machine, and use The `Start-PSBootstrap` function does the following: - Uses `brew` to install CMake, OpenSSL, and GNU WGet -- Downloads and installs the latest .NET CLI package -- Adds `/usr/local/share/dotnet` to the process path +- Links OpenSSL +- Uninstalls any prior versions of .NET CLI +- Downloads and installs the latest .NET CLI 1.0.0-preview2 SDK to `~/.dotnet` -Please heed that last step. You may want to add the .NET CLI tool -location to your path more permanently by adding it to your shell's -profile. +If you want to use `dotnet` outside of `Start-PSBuild`, add `~/.dotnet` to your +`PATH` environment variable. error: Too many open files --------------------------