Skip to content

Remove crossgen'ed IL assemblies and then rename NI assemblies to the same as the corresponding IL images. - #2484

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:update-crossgen
Oct 18, 2016
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:update-crossgen

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

This is to make sure:

  1. The dependency existence check by powershell.exe will pass for all TPAs.
  2. CoreCLR by default will load the NI images even though it's using names of the IL images.

When the legacy APIs like "GetAssemblies" are back, we probably want to retire PSALC (to what extent is still unknown) and solely depend on the CoreCLR default load context, and this is the way to make sure the CoreCLR default load context will load the NI images produced in our post-build.

@msftclas

Hi Dongbo Wang (@daxian-dbw), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Dongbo Wang). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@daxian-dbw

Copy link
Copy Markdown
Member Author

Mike Richmond (@mirichmo) could you please review this? It's tightly related to the new dotnet.core package adoption. This alternative is also suggested by the CoreCLR team.

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.

Do I understand this right? Given a.dll and a.ni.dll we are 1) deleting a.dll and then 2) renaming a.ni.dll to a.dll?

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.

Reading the code that's what appears to be going on, and AFAIK that's what we (unfortunately) need to do; but I'm not quite sure if the comment made sense.

We should document this (and the crossgen procedure in general) in the docs/building/internals.md documentation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure we should do that. And I will update this comment to make it easy to understand.

… same as the corresponding IL images.

This is to make sure:
  1. The dependency existence check by powershell.exe will pass for all TPAs.
  2. CoreCLR by default will load the NI images even though it's using names of the IL images.
@daxian-dbw

Copy link
Copy Markdown
Member Author

The comment is updated to make it easy to understand.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 1d29d42 into PowerShell:master Oct 18, 2016
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the update-crossgen branch October 18, 2016 20:12
Comment thread build.psm1
Write-Verbose "PowerShell Ngen assemblies have been generated. Deploying ..." -Verbose
foreach ($assemblyName in $psCoreAssemblyList) {
# Remove the IL assembly and its symbols.
$assemblyPath = Join-Path $PublishPath $assemblyName

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.

It is a minor naming thing, but can you rename $assemblyPath and $symbolsPath to $assemblyFile and $symbolFile? In my mind, a name that ends in "path" implies that it is a path to a directory, not a file.

@daxian-dbw Dongbo Wang (daxian-dbw) Oct 18, 2016 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

By quickly looking at build.psm1, the pattern that *Path points to a file is used in many places, such as $outputBufferFilePath, $wixHeatExePath and $wixCandleExePath, and $AssemblyPath is used in 11 places in Start-CrossGen, all indicating the path to an assembly. We also have 8 cmdlets in powershell having -FilePath parameter. So I think it's fine to use *Path points to either a file or a directory, as long as it's clear in the context.

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
… same as the corresponding IL images. (PowerShell#2484)

* Remove crossgen'ed IL assemblies and then rename NI assemblies to the same as the corresponding IL images.
This is to make sure:
  1. The dependency existence check by powershell.exe will pass for all TPAs.
  2. CoreCLR by default will load the NI images even though it's using names of the IL images.

* Update the comment to make it easy to understand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants