8000 build: Enable building for win-arm and win-arm64 by SteveL-MSFT · Pull Request #5524 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@SteveL-MSFT
Copy link
Member
@SteveL-MSFT SteveL-MSFT commented Nov 22, 2017

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
Member Author

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

@SteveL-MSFT
Copy link
Member Author

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

@SteveL-MSFT
Copy link
Member Author

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

build.psm1 Outdated
Copy link
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
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
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
Member

@SteveL-MSFT please update here when psrp.windows package is updated.

@daxian-dbw
Copy link
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 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
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 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
Member Author

Verified pwrshplugin.dll works on both arm and arm64. @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
Member
@adityapatwardhan adityapatwardhan left a comment

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
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
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
Member

@daxian-dbw Can you have a look too?

@SteveL-MSFT SteveL-MSFT requested a review from mirichmo December 7, 2017 01:26
@daxian-dbw
Copy link
Member

@adityapatwardhan Yes, will look tonight or first thing tomorrow morning.

build.psm1 Outdated
Copy link
Member
@daxian-dbw daxian-dbw Dec 7, 2017

Choose a reason for hiding this comment

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

8000

Question: @SteveL-MSFT Is it going to be required to use VS2017 to build the plugin dll?

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
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
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
Member Author

Choose a reason for hiding this comment

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

@daxian-dbw VS2017 is required to build arm64

Copy link
Member
@daxian-dbw daxian-dbw left a comment

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.

build.psm1 Outdated
Copy link
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
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
Member

Choose a reason for hiding this comment

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

@SteveL-MSFT Can you comment?

@SteveL-MSFT
Copy link
Member Author

@TravisEz13 @daxian-dbw @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
Member Author

@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-GA, 6.0.0-RC.2 Dec 7, 2017
Copy link
Member
@daxian-dbw daxian-dbw left a comment

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
Copy link
Member
@daxian-dbw daxian-dbw Dec 7, 2017

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
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
Member

Choose a reason f DEC0 or 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
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
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
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
Member

@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
Member Author

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

@adityapatwardhan
Copy link
Member

@daxian-dbw @TravisEz13 Any ideas why WIP might be blocking this?

@TravisEz13
Copy link
Member

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

@TravisEz13 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 adityapatwardhan merged commit eb25428 into PowerShell:master Dec 8, 2017
@SteveL-MSFT SteveL-MSFT deleted the win-arm branch December 9, 2017 01:43
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
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
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

0