Commit graph

270 commits

Author SHA1 Message Date
Dongbo Wang 79a1f80309 Update build script to always use 'dotnet publish' (#3589)
Also update 2 building docs
2017-04-18 13:12:35 -07:00
Dongbo Wang 7a55bf98b2 Move powershell to .NET Core 2.0 (#3556)
This change moves powershell to .NET Core 2.0. Major changes are:
1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`.
2. Refactor code to remove most CLR stub types and extension types.
3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed.
4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded).
5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286](https://github.com/dotnet/cli/issues/6286) is tracking this.
6. Replace the use of some APIs with the ones that take `SecureString`.
7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12.
8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797](https://github.com/dotnet/corefx/issues/17797). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 11:52:38 -07:00
Raghu Shantha [MSFT] d2d80c6832 Use Product Semantic version in the MSI installer where possible (#3435) 2017-03-29 13:36:44 -07:00
Ilya 27b27cc43a Autoload TestRemoting.psm1 (#3430) 2017-03-29 10:11:02 -07:00
Dongbo Wang 5c6ca49da4 Rename OSX package name to include operating system information (#3440) 2017-03-27 18:27:07 -07:00
Travis Plunk 737058f62e Add markdown lint test (#3420)
* Fix markdown syntax and spelling issues
* update spelling dictionary
2017-03-27 16:44:28 -07:00
Steve Lee c0c4cf41e7 rename AppImage to include version (#3433) 2017-03-27 15:52:58 -07:00
Ilya a99fb531e6 Add autoload for test modules (#3342)
Related #3238

1. Add autoload for test modules
2. Move TestHostCS.psm1 to 'test\tools\Modules\' folder
3. Remove explicit load TestHostCS.psm1 from test files
2017-03-26 21:46:39 -07:00
Dongbo Wang 54fa658e31 Migrate from project.json to MSBuild (#3398)
- FullCLR build is disabled in this change.
- FullCLR build related functionalities in `build.psm1` and `AppVeyor.psm1` are disabled. They are not cleaned up from `build.psm1` and `AppVeyor.psm1` yet. We need to adopt .NET Core 2.0 to verify the portable module concept, and if that works well, we will remove the Windows PowerShell source code and clean up our scripts.
- `dnxcore50` and `portable-net5+win8` target framework monikers are removed.
- Dependency on `Microsoft.NETCore.Portable.Compatibility` is removed. It's not necessary, but it may come back when we work on supporting the `portable module`. Its necessity can be reviewed at that time.
- I didn't spend the time to try building powershell in Visual Studio 2017. We should have a separate issue for that. It's tracked by #3400

The `TypeCatalogParser` project is replaced by a MSBuild target to gather the dependency information.
Due to .NET Core SDK issue [#1021](https://github.com/dotnet/sdk/issues/1021), our meta-package project `Microsoft.PowerShell.SDK` starts to generate an empty assembly during the build and that results in an empty assembly `Microsoft.PowerShell.SDK.dll` appear in `publish` folder and in `.deps.json` file. We cannot simply remove the assembly because it's now part of the TPA, and removing it will cause powershell to crash at startup. We have to live with this empty assembly until that .NET Core SDK issue is fixed.  It's tracked by #3401.
2017-03-23 13:04:52 -07:00
Travis Plunk 27c819ce2e Add build support for OpenSUSE 42.1 (#3389) 2017-03-22 14:19:51 -07:00
Sergei Vorobev 1225977f14 Restore Microsoft.PowerShell.Archive module from www.powershellgallery.com 2017-03-22 12:43:38 -07:00
Steve Lee 76de340e79 corrected use of PSModulePath casing to be consistent with Windows PowerShell (#3255)
* corrected use of PSModulePath casing to be consistent with Windows PowerShell
addresses #3227

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in
2017-03-15 12:04:28 -07:00
Travis Plunk 0fc4ef4c2e Add support for crossgen on OpenSUSE 13.2 (#3326) 2017-03-14 11:44:29 -07:00
Dongbo Wang dd0fbd63a1 Fix $LinuxInfo to be a Hashtable instead of an array of Hashtable's. (#3276)
Get-Content /etc/os-release returns an array of strings, which get feeded to ConvertFrom-StringData. Therefore, $LinuxInfo is actually an array of Hashtable instances before this change. Property access on $LinuxInfo like $LinuxInfo.ID happens to work because powershell supports accessing a property or calling a method on a collection of object, but it's inefficient.
After this fix, $LinuxInfo will be a Hashtable, and it's efficient to access its members.
2017-03-07 16:23:18 -08:00
Travis Plunk 5d97bc558a update build.psm1 to support packaging for opensuse 13.2 (#3274) 2017-03-07 15:03:38 -08:00
Travis Plunk e734d44199 Add OpenSUSE 13.2 build support (#3254) 2017-03-06 17:30:14 -08:00
Kevin Marquette f29b99ec6a Add PassThru support to Start-PSPester (#3205) 2017-03-06 13:13:34 -08:00
Andrew Schwartzmeyer 8185fd9350 Add AppImage to CI 2017-02-17 11:09:36 -08:00
Francisco Gamino f852e40b3c Enabling crossgen for the assemblies used by Add-Type, which are Microsoft.CodeAnalysis.CSharp.dll, Microsoft.CodeAnalysis.dll, Microsoft.CodeAnalysis.VisualBasic.dll, and Microsoft.CSharp.dll. This speeds up executing Add-Type from ~3 to 0.9 seconds. (#3086) 2017-02-03 15:19:05 -08:00
Sergei Vorobev b37371b3dd Fix patching logic for .dotnet openssl dylib
Fixes #3062
2017-02-03 09:27:35 -08:00
Sergei Vorobev 9750297ce3 Add 'osx.10.12-x64' runtime to project.json files 2017-02-01 17:52:35 -08:00
Mike Richmond 1431105251 Adding Microsoft.PowerShell.Commands.Diagnostics to the list of packages published to our MyGet feed (#3050) 2017-01-30 16:44:23 -08:00
Joey Aiello f41b94fe03 change '2k' years in build script (#3043) 2017-01-25 18:00:39 -08:00
Andrew Schwartzmeyer 3a34747913 Address code review issues 2017-01-20 11:05:24 -08:00
Andrew Schwartzmeyer f1767dd24d Fix undefined variable in build.psm1
`$rpm_dist` used to be unconditionally defined,
but the changes to support Fedora made it defined only on
RedHat family platforms, so the variable was undefined on Ubuntu
but the flag still added to fpm's arguments, causing a build error.
Now we only add the flag and its argument when it's relevant.
2017-01-20 11:05:24 -08:00
Naadir Jeewa 01dfb88e4d Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-20 11:05:24 -08:00
Jason Shirk 8c08c7b382 use global nuget package cache (#2987) 2017-01-17 13:00:52 -08:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Paul Allen c43de5a19f Add dependent symlinks in package for libmi.so 2017-01-10 17:44:04 -08:00
James Truher [MSFT] c97ca777df Jameswtruher/travisdailybuild (#2958)
* Stifle progress output in build.psm1 for some operations

Modify test failure presentation to use platform available XML methods

* Add timeout support for returning runtime parsing errors

Some of the language/parser tests have been hanging in a non-reproducable manner which
causes the CI system to invalidate the entire run. This change adds support for timeout
which will fail a test if it runs to long, rather than invalidate the entire run.

current behavior is still supported, and is not done in a new session:
PS> get-runtimeerror -src '1/'
At line:1 char:3
+ 1/
+   ~
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

Adding a timeout will do the operation in a async powershell session
PS> get-runtimeerror -src '1/' -timeout 5
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

If the operation takes longer than the supplied timeout, a timeout error will be returned
PS> get-runtimeerror -src 'start-sleep 6' -timeout 2
get-runtimeerror : Operation Timed Out ('start-sleep 6')
At line:1 char:1
+ get-runtimeerror -src 'start-sleep 6' -timeout 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RuntimeError

* Modify native linux command tests to skip on Windows and pending on Mac

* remove verbose and progress output from help tests

* Be sure that Feature Counter tests only run on Windows

Also, only call add-type in CounterTestHelperFunctions.ps1 if we're going to actually run the tests

* do not run any get-computerinfo tests on non-windows systems

* suppress progress output from PowerShell Get tests

* remove -quiet from API and CRON Builds

Travis watches output from the build to ensure that it hasn't hung
we need to find a balance between too much output and not enough output.
A run which has too much output is killed because it looks like an error loop
A run which has too little output is killed because it looks like a hang

* Remove commented line in Import-Counter.Tests.ps1

Remove extraneous extra line in PowerShellGet.Tests.ps1

* Change `-as "type"` to `-as [type]` in build.psm1

Alter timeout to 10 seconds to be improve chances of not timing out for runtime parser checks
improve logic for counter tests to also skip for IoT

* use the existing function of SkipCounterTests rather than duplicate the logic in import-counter.tests.ps1
2017-01-10 14:42:27 -08:00
Mike Richmond 4eb1494442 Revert "Initial Support for Fedora 24" (#2970) 2017-01-06 13:09:40 -08:00
Naadir Jeewa 8262091b3a Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-06 10:04:18 -08:00
Manikyam Bavandla 3938cdb33a [Build] Update the logic to remove PSGetModuleInfo.xml from PowerShellGet module on Non-Windows platforms. (#2897) 2016-12-16 22:16:03 -08:00
Hemant Mahawar e26c2a8752 Adding windows server names to the windows packages + Misc formatting fixes (#2757)
* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Addressing review feedback

* Removed the $PackageVersion variable per review feedback

* Error message fix
2016-12-14 09:28:38 -08:00
Sergei Vorobev cb378be1c8 Create Start-PSRelease helper function (#2753) 2016-12-12 09:34:17 -08:00
Naadir Jeewa 32a8601f92 Rebase onto .NET Core 1.1 (#2737)
* Rebase onto .NET Core 1.1

Modify `Build.psm1` and `project.json` files to use .NET Core 1.1.

.NET Core 1.1 ships with an older dotnet/cli than has currently been used,
so we revert to use case-sensitive directory names for dependencies.

.NET Core 1.1 is a pre-requisite for supporting Fedora 24.

* PSReadLine: Bump major version of PSReadline to 6.0.0-*

* Microsoft.PowerShell.Commands.Utility: Bump major version of Microsoft.CodeAnalysis.Csharp

* Microsoft.PowerShell.SDK: Revert attempt to import netcoreapp1.1 instead of dnxcore

* build.psm1: Restore ability to specify version of dotnet-install.sh
2016-12-07 18:29:21 -08:00
James Truher [MSFT] 8e360bffb1 modify Start-PSPester to accept -Quiet to eliminate Pester output (#2795)
* modify Start-PSPester to accept -Quiet to eliminate Pester output

also modify travis.ps1 to include -Quiet for Pester args to reduce
stdout log size which should hopefully allow daily builds to run
without being cancelled due to too much output

* Add error detail information as part of Test-PSPesterResults

Test-PSPesterResults will now also emit information about the errors
found during a test run rather than just the number of failed tests.
Created a new errorlog function so the output of errors will be red.
2016-12-01 11:23:14 -08:00
Manikyam Bavandla 67e9bf6376 - Fixed failing PackageManagement related tests in daily-builds (#2759)
- Updated Restore-PSModule function to delete the PSGetModuleInfo.xml so that this file will not be included in the PowerShell release.
- Since PackageManagement module gets installed with PowerShellGet module, removed PackageManagement module name in Restore-PSModule command invocation.
2016-11-21 17:36:51 -08:00
Mike Richmond cac96e5fc9 Fixing powershell.exe lib paths and more thoroughly cleaning the powershell-native directory (#2758) 2016-11-21 16:55:03 -08:00
Mike Richmond bfd6d65458 Add x86 CrossGen support (#2726) 2016-11-20 12:59:50 -08:00
Sergei Vorobev 471594c6ab Make Start-PSBootstrap on macOS better
No errors if brew dependencies already present
2016-11-19 23:52:16 -08:00
Sergei Vorobev 5ff63e50b7 Make Restore-PSModule -Name parameter a [string[]] 2016-11-19 23:52:16 -08:00
Jianyun Tao 1fff6760b6 Removed PowerShellGet source and replaced with ones from myget 2016-11-19 23:52:16 -08:00
Jianyun Tao 9b27d4a23a add psmodulerestore in travis.ps1 2016-11-19 23:52:16 -08:00
Jianyun Tao bfe59b3495 # This is a combination of 3 commits.
# The first commit's message is:

Changed to PSModuleRestore switch, i.e., by default no PSModule install

# This is the commit message #2:

install PowerShell modules to publish folder as well as one level up

# This is the commit message #3:

removed workaround
2016-11-19 23:52:16 -08:00
Jianyun Tao 535f977d1a Update build.psm1 to pull PackageManagement assemblies 2016-11-19 23:52:16 -08:00
Mike Richmond c9fb03edf2 Add x86 support to the MSI installer 2016-11-18 16:35:16 -08:00
Mike Richmond e23b0b2002 Add runtime win7-x86 2016-11-18 16:35:16 -08:00
Mike Richmond 81b2339979 Add support to build x86 packages for PowerShell Core 2016-11-18 16:35:16 -08:00
Sergei Vorobev dbc084537a Remove default value for version from Install-Dotnet, so it's controlled only in Start-PSBootstrap 2016-11-14 11:27:38 -08:00