Skip to content
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

Added checks for main dependencies on runtime's build scripts #39052

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ function Get-Help() {

function Assert-InstalledDependency($dependencyName)
{
Write-Host "Checking for $dependencyName..."
if (((Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName -Match
$dependencyName).Length -le 0)
$envPath = $Env:Path
ericstj marked this conversation as resolved.
Show resolved Hide resolved
if (-Not $envPath -Match $dependencyName)
{
Write-Host "$dependencyName is required to build this repo. Make sure to install it and try again."
Write-Host "For a full list of requirements, see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md"
Expand All @@ -114,7 +113,6 @@ function Assert-InstalledDependency($dependencyName)

function Assert-GitLongPathsEnabled()
{
Write-Host "Ensuring Git Long Paths are enabled..."
# This needs to be in a variable. Otherwise, Invoke-Command complains about
# an incompatible cast.
$gitscript = [scriptblock]::Create("git config --get core.longpaths")
Expand All @@ -125,7 +123,6 @@ function Assert-GitLongPathsEnabled()
Write-Host "For a full list of requirements, see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md"
exit 1
}
Write-Host "Done!"
}

if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Expand All @@ -138,14 +135,9 @@ if ($subset -eq 'help') {
exit 0
}

Write-Host ""
Assert-InstalledDependency("Python 3")
Assert-InstalledDependency("CMake")
Assert-InstalledDependency("Git")
Copy link
Member

Choose a reason for hiding this comment

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

Git isn't a dependency. The repo should be buildable without any source control provider. #47298 tracks protecting this scenario in CI.

Assert-InstalledDependency("Visual Studio")
Assert-GitLongPathsEnabled
Write-Host "All dependencies fulfilled! Initiating Build..."
Write-Host ""
exit 0

if ($vs) {
Expand Down
4 changes: 0 additions & 4 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ showSubsetHelp()
assertInstalledDependency()
{
dependency="$(echo "$1" | awk '{print tolower($0)}')"
echo "Checking for $dependency..."

if ! which $dependency > /dev/null; then
echo "$dependency is required to build this repo. Make sure to install it and try again."
Expand All @@ -148,11 +147,8 @@ assertInstalledDependency()
fi
}

assertInstalledDependency 'python3'
assertInstalledDependency 'git'
assertInstalledDependency 'cmake'
echo "All dependencies fulfilled! Initiating build..."
exit 1

arguments=''
cmakeargs=''
Expand Down