Skip to content

Enable crossgen for PowerShell binaries on Windows and Linux - #1571

Merged
sergei (vors) merged 8 commits into
masterfrom
frangom/crossgen
Aug 3, 2016
Merged

sergei (vors) merged 8 commits into
masterfrom
frangom/crossgen

Conversation

@Francisco-Gamino

Copy link
Copy Markdown
Contributor
  • Resolves issue

Native Image Generation for PowerShell libraries #1211

To generate ngen binaries for PowerShell, do the following:
ipmo .\build.psm1 -Force
Start-PSBuild -Publish -RemoveILs -CrossGen

This outputs:
publish: Published to C:\Users\frangom\Documents\GitHub\PowerShell\src\powershell-win-core\bin\Debug\netcoreapp1.0\win10-x64\publish
Published 1/1 projects successfully
Generating assembly Microsoft.PowerShell.Commands.Utility.ni.dll ...
Generating assembly Microsoft.PowerShell.Commands.Management.ni.dll ...
Generating assembly Microsoft.PowerShell.Security.ni.dll ...
Generating assembly Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.ni.dll ...
Generating assembly Microsoft.PowerShell.CoreCLR.Eventing.ni.dll ...
Generating assembly Microsoft.PowerShell.ConsoleHost.ni.dll ...
Generating assembly Microsoft.PowerShell.LocalAccounts.ni.dll ...
Generating assembly Microsoft.PowerShell.Commands.Diagnostics.ni.dll ...
Generating assembly Microsoft.Management.Infrastructure.CimCmdlets.ni.dll ...
Generating assembly System.Management.Automation.ni.dll ...
PowerShell.exe with ngen binaries is available at C:\Users\frangom\Documents\GitHub\PowerShell/src/powershell-win-core\bin\Debug\netcoreapp1.0\win10-x64\publish\powershell.exe

After this, start PowerShell.exe from the following location: C:\Users\frangom\Documents\GitHub\PowerShell/src/powershell-win-core\bin\Debug\netcoreapp1.0\win10-x64\publish\powershell.exe

  • Code is rebased on origin/master.
    Yes
  • Add tests that fail without your changes.
    No tests needed for this code change
  • Update all relevant documentation.

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use ParameterSetName=Publish. CrossGen is a feature of Publish mode, not vice-verce

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed.

@vors

Copy link
Copy Markdown
Collaborator

Please, update appveyor.yml (and later .travis.yml) to call CrossGen.

@vors

Copy link
Copy Markdown
Collaborator

🕐

@lzybkr Jason Shirk (lzybkr) added the WG-Maintainers-Build specific to affecting the build label Jul 29, 2016
Comment thread build.psm1 Outdated

@vors sergei (vors) Jul 30, 2016 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch with Mandatory=$true rarelly makes sense.
Please remove Mandatory for both $CrossGen and $RemoveILs

@Francisco-Gamino Francisco Gamino (Francisco-Gamino) changed the title Enable crossgen for PowerShell binaries on Windows Enable crossgen for PowerShell binaries on Windows and Linux Aug 2, 2016
Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this parameter should be mandatory

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@vors

sergei (vors) commented Aug 2, 2016 •

Copy link
Copy Markdown
Collaborator

Update AppVeyor.yml and travis.sh to use this funcitonality
🕐

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be reverting sergei (@vors) changes from #1605

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyleejordan

Copy link
Copy Markdown
Member

Fixed for OS X.

@andyleejordan
Andy Jordan (andyleejordan) force-pushed the frangom/crossgen branch 2 times, most recently from 499fc05 to 08e8966 Compare August 3, 2016 20:16
Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about consistent bracket. I suggest to ever fix it everywhere in the file or don't do this entirely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did just fix it everywhere.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I misread the diff

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might have pushed it just as you commented.

@vors

Copy link
Copy Markdown
Collaborator

LGTM

@andyleejordan

Copy link
Copy Markdown
Member

We are a go! :shipit:

Comment thread build.psm1
# Add Windows specific libraries
if ($IsWindows) {
$psCoreAssemblyList += @(
"Microsoft.WSMan.Management.dll",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a TODO to enable this once they are available on Linux.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, as sergei (@vors) commented previously, these libraries will not come to Linux. They are explicitly Windows specific.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Then, we should be good to go.

@vors
sergei (vors) merged commit 13b2da5 into master Aug 3, 2016
@vors
sergei (vors) deleted the frangom/crossgen branch August 3, 2016 21:15
@TravisEz13 Travis Plunk (TravisEz13) added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Review - Waiting on Author labels May 27, 2020
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Enable crossgen for PowerShell binaries on Windows and Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept WG-Maintainers-Build specific to affecting the build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants