8000 Build requirement checking by KirkMunro · Pull Request #4185 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Build requirement checking #4185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2017

Conversation

KirkMunro
Copy link
Contributor

After fighting with the build for a while, I finally figured out what was wrong -- my VS 2015 install did not have the MFC for C++ feature installed, so I was missing atlbase.h. Since that feature is required for the Windows build, I updated build.psm1 to check for it ahead of time and notify the user when it is missing.

build.psm1 Outdated
@@ -222,7 +222,15 @@ Fix steps:
throw 'Win 10 SDK not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk'
}

$vcVarsPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName
# atlbase.h is included in at least one project
$vcPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName
Copy link
Collaborator

Choose a reason for hiding this comment

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

More build diagnostics are good in my book. I just wish this weren't tied specifically to VS 2015. On at least one of my machines I have only VS 2017 installed. @KirkMunro this is not your issue. Just an observation on this build script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I completely agree. I kept it tied to 2015 to follow the script's current design, but it would be nice to see a separate PR that would allow it to work on the latest release version of VS, or a specific version if you tell it to.

Copy link
Member
@mirichmo mirichmo Jul 14, 2017

Choose a reason for hiding this comment

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

+1 on a separate PR to support VS 2017. I have both installed so I never noticed this pain point, but it keeps coming up more and more. If either of you guys want to tackle it, it would be a welcome contribution.

It is tracked as issue #3400

build.psm1 Outdated
@@ -222,7 +222,15 @@ Fix steps:
throw 'Win 10 SDK not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk'
}

$vcVarsPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName
# atlbase.h is included in at least one project
$vcPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName
Copy link
Member
@mirichmo mirichmo Jul 14, 2017

Choose a reason for hiding this comment

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

+1 on a separate PR to support VS 2017. I have both installed so I never noticed this pain point, but it keeps coming up more and more. If either of you guys want to tackle it, it would be a welcome contribution.

It is tracked as issue #3400

8000
build.psm1 Outdated
@@ -222,7 +222,15 @@ Fix steps:
throw 'Win 10 SDK not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk'
}

$vcVarsPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName
# atlbase.h is included in at least one project
Copy link
Member

Choose a reason for hiding this comment

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

Please move this comment down to the IF check. Also, can you please specify the project that requires it? It is most likely the native remoting plugin (pwershplugin.dll).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

build.psm1 Outdated
}

# vcvarsall.bat is used to setup environment variables
$vcVarsPath = $vcPath
Copy link
Member

Choose a reason for hiding this comment

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

The renaming and reassignment of this variable seems unnecessary. If you leave the name as-is, then this line is not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I leave the name as vcVarsPath, then the variable is not appropriately named anymore. But two variables are not needed, you're right about that. I reduced/simplified to one variable for that path, and stuck with the vcPath variable name.

Copy link
Member
@mirichmo mirichmo left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution

@mirichmo mirichmo merged commit 011271c into PowerShell:master Jul 17, 2017
@KirkMunro KirkMunro deleted the build-requirement-checking branch January 7, 2019 21:22
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
0