Skip to content

build: Enable building for win-arm and win-arm64 - #5524

Merged
Aditya Patwardhan (adityapatwardhan) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:win-arm
Dec 8, 2017
Merged

Aditya Patwardhan (adityapatwardhan) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:win-arm

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Nov 22, 2017 •

Copy link
Copy Markdown
Member

Requires VS2017 latest preview to build for arm64. Validated win-arm build on Win10 IOT with remoting, but current install script doesn't work correctly on Win10 IOT, need to update.

Also fixed issue with pwrshplugin.dll not validating path before using them.

Fix #5286

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Waiting on mmi.dll to be published for win-arm and win-arm64

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Confirmed that basic PSCore6 works on win-arm, I think we can merge this.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Aditya Patwardhan (@adityapatwardhan) hold off on merging this, looks like I need to build pwshplugin.dll for arm

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.

!$env:PROCESSOR_ARCHITECTURE -match "arm"

!$env:PROCESSOR_ARCHITECTURE will be evaluated first in this case.

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.

Will fix

@daxian-dbw

Copy link
Copy Markdown
Member

Once the changes to building pwshplugin.dll is done, the psrp.windows package needs to be updated, and make sure the arm version plugin dll is signed before creating a new nuget package.

@adityapatwardhan

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) please update here when psrp.windows package is updated.

@daxian-dbw

Copy link
Copy Markdown
Member

Note that PR #5617 would also require psrp.windows nuget package to be refreshed, so it's better to coordinate them to avoid duplicate work.

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title enable building for win-arm and win-arm64 [Don't Merge] enable building for win-arm and win-arm64 Dec 6, 2017
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Have some paths hardcoded to validate build. Will update, but requires user to have VS2017 latest installed to build for win-arm.

fix finding vs2017 dynamically
@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title [Don't Merge] enable building for win-arm and win-arm64 Enable building for win-arm and win-arm64 Dec 6, 2017
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Verified pwrshplugin.dll works on both arm and arm64. Aditya Patwardhan (@adityapatwardhan) can you re-review this PR as I've made substantial changes for the native compilation?

…er than reg.exe so that error doesn't show on success

fix formatting issue in cmake.defs

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.

LGTM with minor comment.


# Clean up
Remove-Item .\$fileName
New-Item $regKey -Force

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.

New-Item $regKey -Force > $null

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.

Will change

@adityapatwardhan

Copy link
Copy Markdown
Member

Dongbo Wang (@daxian-dbw) Can you have a look too?

@daxian-dbw

Copy link
Copy Markdown
Member

Aditya Patwardhan (@adityapatwardhan) Yes, will look tonight or first thing tomorrow morning.

Comment thread build.psm1 Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Dec 7, 2017 •

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.

Question: Steve Lee (@SteveL-MSFT) Is it going to be required to use VS2017 to build the plugin 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.

Dongbo Wang (@daxian-dbw) The build worker image we use in AppVeyor is Visual Studio 2015. Do we need to update that?

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.

Actually we are using Visual Studio 2017 through the AppVeyor.yml

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.

We don't build the native binaries in CI, so it shouldn't matter. Maybe we should switch to an image that doesn't have VS pre-installed.

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.

Dongbo Wang (@daxian-dbw) VS2017 is required to build arm64

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

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.

LGTM. Left a question comment.

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.

x64_arm and x64_arm64 seems weird to me. Why are we combining two architectures?

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.

I'll add a comment. This is the form that the Visual Studio build environment expects for cross compilation. The first is the host and the second the target. VS supports x86_arm64, for example which I'm not supporting here.

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.

Steve Lee (@SteveL-MSFT) Can you comment?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Travis Plunk (@TravisEz13) Dongbo Wang (@daxian-dbw) Aditya Patwardhan (@adityapatwardhan) please review the change to the pwrshplugin config reader to address #5286

Decided to do that as part of this PR since I'm publishing a new drop to myget might as well do it once rather than twice.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

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.

A few non-blocking comments.

if (*slashIter != L'\\')
CloseHandle(dirHandle);
this->pathToPowerShellAssemblies = psHomeDir;
if (this->pathToPowerShellAssemblies.size() > 0) // Found a match

@daxian-dbw Dongbo Wang (daxian-dbw) Dec 7, 2017 •

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 seems the size() > 0 check should be moved to before the CreateFileW call.
Or maybe the size() > 0 is not needed, because if getValueFromLine returns an empty string, I think CreateFileW will fail.

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.

Wrote a small program to test this and an empty string does return an invalid handle. I can remove the size check.

slashIter--;
if (*slashIter != L'\\')
CloseHandle(dirHandle);
this->coreClrDirectory = this->getValueFromLine(line, coreClrDirTag);

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.

Why calling this->getValueFromLine(line, coreClrDirTag); again instead of use coreClrDir?

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.

Mistake, should have been coreClrDir. Will fix.

if (*slashIter != L'\\')
CloseHandle(dirHandle);
this->coreClrDirectory = this->getValueFromLine(line, coreClrDirTag);
if (this->coreClrDirectory.size() > 0) // Found a match

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.

Same comment about the size() check here.

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.

same as above

@daxian-dbw

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Making those changes means we need to create a new psrp.windows package. But that work doesn't block merging this PR.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) yeah, I realize that. After this is merged, I'll create one called RC2.

@adityapatwardhan

Copy link
Copy Markdown
Member

Dongbo Wang (@daxian-dbw) Travis Plunk (@TravisEz13) Any ideas why WIP might be blocking this?

@TravisEz13

Copy link
Copy Markdown
Member

it hasn't run, edit the title and it will run.

@TravisEz13 Travis Plunk (TravisEz13) changed the title Enable building for win-arm and win-arm64 build: Enable building for win-arm and win-arm64 Dec 8, 2017
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit eb25428 into PowerShell:master Dec 8, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the win-arm branch December 9, 2017 01:43
Travis Plunk (TravisEz13) pushed a commit to TravisEz13/PowerShell that referenced this pull request Dec 9, 2017
* enable win-arm and win-arm64 builds

* fix using arm64 tools for build
fix finding vs2017 dynamically

* change install-powershellremoting.ps1 script to use reg provider rather than reg.exe so that error doesn't show on success
fix formatting issue in cmake.defs

* add check that path being read from config file is valid
address PR feedback

* fix copying of PowerShell.Core.Instrumentation as VS2017 puts it in $HOME/source
address PR feedback
Travis Plunk (TravisEz13) pushed a commit that referenced this pull request Dec 10, 2017
* enable win-arm and win-arm64 builds

* fix using arm64 tools for build
fix finding vs2017 dynamically

* change install-powershellremoting.ps1 script to use reg provider rather than reg.exe so that error doesn't show on success
fix formatting issue in cmake.defs

* add check that path being read from config file is valid
address PR feedback

* fix copying of PowerShell.Core.Instrumentation as VS2017 puts it in $HOME/source
address PR feedback
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
* enable win-arm and win-arm64 builds

* fix using arm64 tools for build
fix finding vs2017 dynamically

* change install-powershellremoting.ps1 script to use reg provider rather than reg.exe so that error doesn't show on success
fix formatting issue in cmake.defs

* add check that path being read from config file is valid
address PR feedback

* fix copying of PowerShell.Core.Instrumentation as VS2017 puts it in $HOME/source
address PR feedback
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
* enable win-arm and win-arm64 builds

* fix using arm64 tools for build
fix finding vs2017 dynamically

* change install-powershellremoting.ps1 script to use reg provider rather than reg.exe so that error doesn't show on success
fix formatting issue in cmake.defs

* add check that path being read from config file is valid
address PR feedback

* fix copying of PowerShell.Core.Instrumentation as VS2017 puts it in $HOME/source
address PR feedback
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.

Pwrshplugin Config File Paths Should be Validated Before Use

5 participants