Commit graph

572 commits

Author SHA1 Message Date
Aditya Patwardhan 91c9be996a
Ignore last exit code in the build step as dotnet may return error when SDK is not installed (#11972) 2020-02-27 17:23:55 -08:00
Dongbo Wang d4536cfb77
Make LTS package always not a preview (#11895) 2020-02-19 15:07:11 -08:00
Andrew 43c88a4ff1
Add WinCompat deny list support using a setting in powershell.… (#11726) 2020-02-04 16:33:26 -08:00
xtqqczze 2014ce66c1
Set StrictMode version 3.0 (#11563) 2020-02-03 09:44:10 -08:00
xtqqczze ba9a7b1948 Code Cleanup for environment data gathering in build.psm1 (#11572) 2020-01-15 11:03:48 -08:00
xtqqczze 4a9d70fdcd Correct case of $PWD special variable 2020-01-13 19:24:10 +00:00
xtqqczze 62aee9356a Correct case of $PSScriptRoot special variable 2020-01-13 19:21:53 +00:00
xtqqczze 42d50434f8 Correct case of $PSCmdlet special variable 2020-01-13 19:19:12 +00:00
xtqqczze 7dd922abe5 Correct case of $StackTrace special variable 2020-01-13 19:16:45 +00:00
xtqqczze 89e33f5772 Correct case of $Matches special variable 2020-01-13 19:15:17 +00:00
Aditya Patwardhan 0b97d6d5cf Fix symbolic links on Debian 10 packages (#11474) 2020-01-07 16:54:03 -08:00
Steve Lee 59db1f619e Fix symbolic links to libs on Debian 10 (#11390) 2019-12-27 17:14:51 -08:00
xtqqczze 7a7365279c Avoid variable names that conflict with automatic variables (#11392) 2019-12-20 12:09:03 -08:00
Aditya Patwardhan 8e76ad00e2 Bump .NET to 3.1.0 (#11260) 2019-12-04 13:17:16 -08:00
Travis Plunk 7fc67d0384
Only enable experimental features prior to RC (#11162) 2019-12-02 17:52:23 -08:00
Brendan Burns 2a76aa10ee Improve Ubuntu detection for Ubuntu derivatives like GalliumOS etc (#11155) 2019-11-26 15:27:06 -08:00
Travis Plunk 57a071e9e6
Add Debian 10, 11 and CentOS 8 packages (#11028) 2019-11-11 12:29:24 -08:00
Steve Lee ca68d9dbc5 Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow (#10899) 2019-11-01 10:05:32 -07:00
Dongbo Wang 0effc64534 Update the dotnet SDK install script URL in build.psm1 (#10927) 2019-10-28 15:50:07 -07:00
Aditya Patwardhan 74eaf1980f
Move to .NET Core 3.1 preview 1 (#10798) 2019-10-18 16:49:25 -07:00
Robert Holt 2a518fcfe2 Support the pipeline chain operators && and || in PowerShell language (#9849) 2019-10-17 14:43:46 -07:00
Dongbo Wang 48db3de03e
Make the event handler leaking test stable (#10790) 2019-10-16 09:55:41 -07:00
Lucius Q. User 273b4abd40 Add MacPorts support to the build system (#10736) 2019-10-09 17:02:05 -05:00
Travis Plunk 06aedae91e Merged PR 9996: Fix ExperimentalFeature list generation 2019-09-16 19:22:34 +00:00
Travis Plunk 60ffea59e3
Update PSDesiredStateConfiguration to 2.0.3 and bring new test… (#10516) 2019-09-12 14:39:11 -07:00
James Truher [MSFT] 3943f18c28 Alpine validation changes (#10428) 2019-08-24 11:35:34 -07:00
James Truher [MSFT] fe2cc6aca8 Additional Telemetry - Implementation of RFC0036 (#10336) 2019-08-15 16:13:53 -07:00
Steve Lee 882cbf367f Enable Experimental Features by default on Preview builds (#10228) 2019-08-08 11:37:25 -07:00
Dongbo Wang 0d817aa547 Update 'Microsoft.PowerShell.CoreCLR.Eventing' to resolve conflict with 'System.Diagnostics.EventLog' (#10305)
* Update 'Microsoft.PowerShell.CoreCLR.Eventing' to resolve conflicts
* Add reference to 'System.Diagnostics.EventLog' to build Microsoft.PowerShell.Commands.Diagnostics on Unix
* Stop compiling Get/New-WinEvent on Unix
2019-08-08 17:44:54 +05:00
Travis Plunk 6b2690ef8e
Fix macOS build break (#10207) 2019-07-22 15:21:38 -07:00
Aditya Patwardhan 540737ebe1 Split the fxdependent package on Windows into two packages (#10134) 2019-07-12 17:18:11 -07:00
Christoph Bergmeister [MVP] 3141405159 Update 'Start-PSBuild -Clean' logic of 'git clean' to ignore locked files from VS2019 (#10071) 2019-07-08 17:30:17 -07:00
Joel Sallow (/u/ta11ow) bf71b2c616 Start-PSBuild -Clean doeas not remove all untracked files (#10022) 2019-07-01 08:34:36 +05:00
Dongbo Wang 94b6b6f4f7 Clean up the use of 'SetProfileRoot' and 'StartProfile' in ConsoleHost (#9931)
* Clean up the use of 'SetProfileRoot' and 'StartProfile' in ConsoleHost
* Remove 'pwsh.pdb' from our component file list
2019-06-19 11:34:47 +05:00
Aditya Patwardhan 8ea15c9f13 Merged PR 8529: Add cleanup before building test package
Add cleanup before building test package
2019-05-29 00:31:14 +00:00
dependabot[bot] 9c8cdb50f6 Build(deps): Bump PackageManagement from 1.3.2 to 1.4 in /src/Modules (#9650)
* Build(deps): Bump PackageManagement from 1.3.2 to 1.4 in /src/Modules

Bumps PackageManagement from 1.3.2 to 1.4.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-21 17:36:17 -07:00
Steve Lee 29e21470d9 Port PowerShell to .NET Core 3.0 (#9597) 2019-05-21 13:43:51 +08:00
Steve Lee a96b4c0404 Update use of "PowerShell Core" to just "PowerShell" (#9513) 2019-05-10 15:34:27 -07:00
Steve Lee cb20154de8 Update to Pester 4.8.0 (#9510) 2019-05-02 09:56:16 +05:00
Aditya Patwardhan 9f429f0206 Build test packages for windows, linux-x64, linux-arm, linux-arm64 and macOS (#9476) 2019-04-26 15:41:07 -07:00
Steve Lee e81aa9882c Enable building on Kali Linux (#9471) 2019-04-26 14:11:56 -07:00
Dongbo Wang 687697bc90 Fix the failed test and update 'Publish-TestResults' to make AzDO fail the task when any tests failed (#9457) 2019-04-25 14:01:05 -07:00
Aditya Patwardhan 3ffd998c58 Create codecoverage and test packages for non-windows (#9373)
Refactor the `ci.psm1` to publish the code coverage and test packages.
Allow `CodeCoverage` configuration on non-windows.

## PR Context

We plan to run code coverage on Windows, Linux and macOS. These changes are needed to unblock those runs.
2019-04-16 15:13:30 -07:00
Travis Plunk cee1e54e75
Add ability to cross compile (#9374)
`-CrossGen` won`t work, but this gives basic ability to build for another platform.
This also means you cannot really package for another platform.
2019-04-16 14:14:29 -07:00
Travis Plunk 5913c88aaf
Mark tests in macOS CI which use applescript as pending/inconclusive (#9352)
Mark tests in macOS CI which use applescript as pending/inconclusive
2019-04-12 18:12:29 -07:00
Travis Plunk e2bfced875
Update repo for Ubuntu 14.04 EOL (#9324)
Update repo for Ubuntu 14.04 EOL
  - also remove a missed instance of Fedora 27
2019-04-09 17:54:13 -07:00
Aditya Patwardhan 4bd41e836c
Publish windows daily build to MyGet (#9288) 2019-04-03 13:22:51 -07:00
Travis Plunk 5e4b4d1351 Make command searcher not use wildcard search for execution (#9202) 2019-04-02 11:54:11 -07:00
James Truher [MSFT] 2f0d127ef8 Check to be sure that the test result file has actual results before uploading (#9253)
VSTS produces a warning if the result set is 0, we will skip uploading this to avoid the warning and better support automation scenarios.

## PR Context

We have automation which checks our test results and if the result set is 0 for that file, a warning is produced. This PR will avoid uploading that file into the test results (which is valid, as there are no run tests). We will still add the file to our artifact list for completeness.
2019-04-01 16:47:55 -07:00
Travis Plunk b632b60fca
Translate Skipped the test results into something Azure DevOps does NOT understand (#9124) 2019-03-20 13:25:39 -07:00
Travis Plunk 058a19028d
Refactor macOS CI so that tests run in parallel (#9056)
Refactor macOS CI so that tests run in parallel 
  - Also:
    - Fix bootstrap issue where curl was failing for a month (so obviously not needed)
    - Change Windows test stages to use PowerShell Core (where we can) to avoid compat issues

## PR Context

This allows running all tests in about the same about of clock time.
2019-03-11 13:00:22 -07:00
Aditya Patwardhan fb05169a51
Build Global tool for PowerShell and SDK container (#8984)
* Add shim dll to redirect to appropriate runtime
* Build updates for creating global tool package
* Add building global tool to nuget.yml
* Add azure upload of nuget packages
2019-02-26 12:56:29 -08:00
Dongbo Wang 5d54f1aa38
Make xUnit tests run sequentially to avoid race conditions caused by manipulating 'powershell.config.json' in tests (#8945) 2019-02-22 11:57:10 -08:00
Reece Dunham 9bfbd78a3e Remove Travis-CI mention in build.psm1 (#8888) 2019-02-19 17:47:35 -08:00
Travis Plunk a7f798575d
Parallelize the windows CI to enable us to run all tests all the time (#8868)
Split Windows CI into the following Jobs

1. Combine Build and xUnit, which published build artifact
1. Elevated CI tests
1. Unelevated CI test
1. Elevated everything else tests
1. Unelevated everything else tests
1. Package build and test
1. Verify xUnit result

## PR Context  

Before this test:

- A CI run would take ~14 minutes
- A Feature run would take ~30 minutes

After this change, it always runs all tests and takes ~20 minutes.
Job `Unelevated everything else tests` is the long poll, taking ~4 minutes longer than the next shortest job.  We should be able to get this back down to ~15 if we split that test job somehow.
2019-02-14 16:33:19 -08:00
Steve Lee 53ad39772c Use -ErrorAction Ignore instead of SilentlyContinue with Get-Command in build.psm1 (#8832) 2019-02-06 12:00:57 -08:00
James Truher [MSFT] bbcedd2590 Update Pester version to 4.4.4 (#8739) 2019-01-31 11:41:26 -08:00
Travis Plunk f416fd3815
Switch to 1.11 of FPM to fix FPM install issue (#8797)
Switch to 1.11 of FPM to fix FPM install issue
2019-01-30 11:08:08 -08:00
Travis Plunk b779b88c79
Merge `release-v6.2.0-preview.4'
# Conflicts:
#	test/Test.Common.props
#	tools/packaging/packaging.psm1
2019-01-28 13:50:00 -08:00
Reece Dunham e5897ba2f7 Fix broken reference (#8753) 2019-01-28 17:00:34 +05:00
xtqqczze 863528881f Use https in URLs where available (#8622)
Use https in URLS across the repository where the domain serves content by https.
2019-01-24 12:50:11 -08:00
Aditya Patwardhan ea0b4de90a
Merged PR 6442: Moved the cleanup logic to Restore-PSModuleToBuild
Moved the cleanup logic to Restore-PSModuleToBuild

# Conflicts:
#	build.psm1
2019-01-23 12:27:44 -08:00
Travis Plunk c4b2105a73 Merged PR 6648: Bump SDK and Runtime Versions
Bump SDK and Runtime Versions
  - Also, fix alpine docker file
  - Also, fix extra files being added to some Modules after these changes
2019-01-23 02:18:44 +00:00
Christoph Bergmeister [MVP] beae5691aa Do not ship fullclr binaries of PackageManagement (#8700)
## PR Summary

Related: #8699

## PR Context  

Because `PowerShellGet` does not support publishing/saving module on a per platform basis (see [this](https://github.com/PowerShell/PowerShellGet/issues/273) issue), PowerShell currently also ships the fullclr binaries of `PackageManagement`, which it does not need. Therefore removing it to minimise the package size, this saves 1.19 MB.
2019-01-22 12:55:22 -08:00
Travis Plunk f1218bd3d9
Remove Debian 8 references as it is EOL (#8678)
Remove Debian 8 references as it is EOL
2019-01-17 16:30:39 -08:00
Aditya Patwardhan f03cafbdd8 Build package build using ubuntu 18.04 image (#8666) 2019-01-16 15:10:39 -08:00
Travis Plunk 7bf4641444
Fix broken urls (#8653)
Fix broken URL
  - Also, move other static analysis tests into that CI.
  - Also, make the link analysis a pester test (partly to make sure the step fails in case of an error)
2019-01-15 16:20:45 -08:00
Dongbo Wang ab75626f22 Fix installing fpm and ronn in macOS CI by avoid installing docs for them (#8656) 2019-01-15 14:23:59 -08:00
Ilya a9f106da58 Move xUnit tests in new folder (#8356)
## Motivation

I have a PR where there are many new xUnit tests.
It would also be useful to create new xUnit tests for public APIs.
The number of xUnit tests will increase and their ordering is required.

## PR Summary

- Move C# xUnit tests in new folder. This allows to put new xUnit tests in directory structure in accordance with directory structure where cs files are.
- Use an xUnit TestCaseOrderer attribute to sequentially process tests for `powershell.config.json`.
- Update README.md
- A race condition was fixed which allowed  to run all XUnit tests in single batch job.
2018-12-13 14:22:07 -08:00
Alex Earl 74de391193 Add Linux ARM64 build support (#8016) 2018-12-05 10:55:09 -08:00
Dongbo Wang a11810bf33
Improve powershell startup time (#8341)
Major changes are as follows:
- Avoid `SecuritySupport.IsProductBinary` and unnecessary AMSI/suspicious code scan at startup time
   - Update `CompiledScriptBlockData.IsProductCode` to avoid unnecessary calls to `IsProductBinary`, which attempts to retrieve catalog signature of the target file.
   - Update `PerformSecurityChecks` to skip AMSI and suspicious code scan for the `.psd1` file that contains a safe `HashtableAst` only.
- Use customized `ReadOnlyBag` instead of `ImmutableHashSet` so that we can avoid loading the `System.Collections.Immutable.dll` completely.
- Replace `SHA1` with `CRC32` when generating module analysis cache file name
   - This remove the loading of `System.Security.Cryptography.Algorithms.dll` at startup
- Move `ConvertFrom-SddlString` to C# to remove the `Utility.psm1` file.
- Crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation
   - Even pwsh with crossgen assemblies spends a lot time in jitting at the startup, about `191.6ms` comparing with `24.7ms` for Windows PowerShell.
   - Jitting `Microsoft.ApplicationInsights.dll` takes about `51.6ms`.
   - By crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation, the jitting time drops to about `98.9ms`.
2018-12-02 12:52:39 -08:00
Aditya Patwardhan 3794a5e39f
Created a csproj to pin test modules and updated build.psm1 accordingly (#8350) 2018-11-30 11:49:38 -08:00
Aditya Patwardhan b0daa1e724 Build Alpine tar.gz package in release builds (#8340)
Enable building tar.gz package for Alpine in release builds.

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Change is not breaking](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` to the beginning of the title and remove the prefix when the PR is ready.
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] User-facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed - Issue link:
- **Testing - New and feature**
    - [x] Not Applicable or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
        - [ ] [Add `[feature]` if the change is significant or affects feature tests](https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr)
2018-11-27 10:45:49 -08:00
Aditya Patwardhan 9fda1d0e4f
Publish test package to AppVeyor daily build (#8273) 2018-11-26 10:44:42 -08:00
Andrew Menagarishvili 42cfa2c0b1 Merged PR 5863: Lowering Pester module version to avoid test infra failures on some Linux systems
Without this change package validation tests fail during Pester module import on some Linux systems.
2018-11-15 21:26:11 +00:00
John Eismeier 4118fd2829 Propose fix some typos (#8206) 2018-11-09 08:33:24 +05:00
Aditya Patwardhan e1d8765f9e Add function to create a new nuget.config file (#8170)
Add a function to create a NuGet.config file to consume packages  from the specified feed URL using the specified credentials.  

  - Also, exclude the `nuget.config` file under `src/Modules` from being clean by `Start-PSBuild -clean`
2018-11-05 10:48:05 -08:00
Andrew Schwartzmeyer 54874180ce Remove build and doc references to Git submodules (#8177)
As of #7892, the PowerShell repository no longer uses Git submodules.
This is fantastic from a workflow standpoint, and so all the notes about
how to deal with submodules (and all the build steps explicitly
initializing and updating submodules) can be safely removed.
2018-11-05 10:39:29 -08:00
PRASOON KARUNAN V 35f1ed0011 Use approved verb instead of Generate-CrossGenAssembly (#8151) 2018-10-31 15:45:33 +05:00
kwkam a4d4c31390 build: fix Start-PSBuild -Output (#7504)
Make Start-PSBuild -Output $OutDir output the build to the directory properly.
2018-10-29 17:43:41 -07:00
Aditya Patwardhan d7c7fa504f
Filter the TestPackage artifact upload by name to avoid other zip files being uploaded (#8116) 2018-10-29 14:13:05 -07:00
Aditya Patwardhan 05e9f78bcb
Publish test package at AGENT_WORKFOLDER if TEMP is not available (#8108) 2018-10-23 16:31:04 -07:00
Steve Lee ef504e5212 Fix psmodulerestore path when built in VSCode (#8075) 2018-10-20 11:38:15 -07:00
Aditya Patwardhan 487073e57b
Add functionality to create a test package (#8087) 2018-10-19 14:56:58 -07:00
James Truher [MSFT] ddaffe23c6 Update Pester to use latest version (#8015) 2018-10-12 15:31:33 -07:00
Christoph Bergmeister [MVP] fe731eda14 Use dotnet test since the dotnet xunit test runner has been deprecated (#7980) 2018-10-09 20:55:41 -07:00
PRASOON KARUNAN V 112b485798 Converting aliases to cmdlets in 'build.psm1' (#7964) 2018-10-08 23:16:50 -07:00
Steve Lee abaf18680a Change default of Start-PSBuild to include -PSModuleRestore (#7881) 2018-10-03 12:49:24 -07:00
Aditya Patwardhan b42c001700 Cleanup all native code from repository (#7892)
Native code for PowerShell has been moved to repository PowerShell/PowerShell-Native.

Hence, removing all the native code and related build components.
2018-10-02 12:48:42 -07:00
Robert Holt 649d342a07 Replace test certificates with self-signed certificate generating command (#7875) 2018-10-01 14:40:48 -07:00
Aditya Patwardhan 8d4dd1e58f Remove packaging, building and installation scripts for Ubuntu 17.10 (#7773) 2018-09-17 14:48:23 -07:00
Aditya Patwardhan abad087fa1 Build and package framework dependent package (#7729)
Add the functionality to build a framework dependent (shared framework) package for PowerShell.

The changes create two packages, one for Windows and other for Linux, due to #if code.
2018-09-10 12:47:32 -07:00
Travis Plunk 2141c2a8e3
Add daily build non-windows platforms (#7683)
Add daily build non-windows platforms
  - Also, make the [Feature] tag work in VSTS for non-windows
  - Also, add a way to force feature tests to run
  - Also, fix an issue where `-workingdirectory` didn't work when running async
2018-09-06 12:27:49 -07:00
zhenggu 358e8abefe Fix Set-Service -Status Stopped to stop services with dependencies (#5525) 2018-08-28 11:03:12 -07:00
Dan Travison 1abf290f83 Add symbolic links for libssl and libcrypto to Debian 9 builds to make remoting work. (#7609)
On Debian 9, libmi cannot resolve libssl and libcrypto. This change adds symbolic links to packaging and build to the $PSHOME directory to resolve the issue.

The fix was verified interactively connecting to office 365, importing the session, and ensuring Get-MailBox and Get-User succeed.

Fix #7598
2018-08-24 15:20:22 -07:00
Travis Plunk 40532d9a2e
Add VSTS CI for Windows (#7536)
- Add VSTS CI for Windows
    - Disable `Access-denied test for Get-Item C:\windows\appcompat\Programs\Install -ErrorAction Stop`, because the path does not always exist
        - https://github.com/PowerShell/PowerShell/issues/7553
    - Disable `Should give .sys file if the fullpath is specified with hidden and force parameter`, because pagefile.sys doesn't always exist and other files don't meet test's requirement.
        - https://github.com/PowerShell/PowerShell/issues/7554
    - Disable some `Test-Connection` tests for same reasons they failed on VSTS Linux
        - https://github.com/PowerShell/PowerShell/issues/7555
    - Disable `Test-FileCatalog should pass when catalog is in the same folder as files being tested`, because the CmdLet does not work in that scenario
         - Also, give details needed to investigate when the test fails
         - https://github.com/PowerShell/PowerShell/issues/7556
    - Update `appveyor.psm1` to work with VSTS
    - Update `HelpersRemoting.psm1` `New-RemoteSession` to work for CimSession (discovered an issue during the investigation)
    - Update `Test wildcard with drive relative directory path` to work when there are multiple drives
         - Disable on non-windows machines since the test is assuming drive letters
    - Update `New-CimSession` Tests to requireAdmin
         - Also, make sure session name is a string
    - Add functions to save and restore psoptions
    - update `.gitatttributes` so files clone like they do on appveyor
2018-08-17 22:06:51 -07:00
Travis Plunk bfd46b1a3f
make sure we continue with retry loop when we get an error (#7550)
Improve logging
2018-08-16 17:24:41 -07:00
Aditya Patwardhan 4866b5f326 Fix typo on environment checker for RedHat (#7549) 2018-08-16 16:44:20 -07:00
Aditya Patwardhan 5232bb4890 Fix typo in environment checker (#7547)
Fix error in environment checking logic for RedHat family.
2018-08-16 16:18:34 -07:00
Travis Plunk 01634e4b2e Retry restore on failure (#7544)
* switch to using a retry
2018-08-16 14:23:30 -07:00