From 982dbfe552b41ec3cd9b64f649849e8b942643d6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 12 Mar 2018 15:59:58 -0700 Subject: [PATCH] fix errors in start-psbootstrap during release builds (#6159) set Debian front end to non-interactive during apt-get commands, to avoid error with prompting add libffi-dev, which is required for ruby/fpm let fpm update to the latest --- build.psm1 | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/build.psm1 b/build.psm1 index a0e6a86dd1..43d9363ce1 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1575,12 +1575,21 @@ function Start-PSBootstrap { elseif ($Environment.IsUbuntu16) { $Deps += "libicu55" } # Packaging tools - if ($Package) { $Deps += "ruby-dev", "groff" } + if ($Package) { $Deps += "ruby-dev", "groff", "libffi-dev" } # Install dependencies - Start-NativeExecution { - Invoke-Expression "$sudo apt-get update -qq" - Invoke-Expression "$sudo apt-get install -y -qq $Deps" + # change the fontend from apt-get to noninteractive + $originalDebianFrontEnd=$env:DEBIAN_FRONTEND + $env:DEBIAN_FRONTEND='noninteractive' + try { + Start-NativeExecution { + Invoke-Expression "$sudo apt-get update -qq" + Invoke-Expression "$sudo apt-get install -y -qq $Deps" + } + } + finally { + # change the apt frontend back to the original + $env:DEBIAN_FRONTEND=$originalDebianFrontEnd } } elseif ($Environment.IsRedHatFamily) { # Build tools @@ -1590,7 +1599,7 @@ function Start-PSBootstrap { $Deps += "libicu", "libunwind" # Packaging tools - if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff" } + if ($Package) { $Deps += "ruby-devel", "rpm-build", "groff", 'libffi-devel' } $PackageManager = Get-RedHatPackageManager @@ -1611,7 +1620,7 @@ function Start-PSBootstrap { $Deps += "gcc", "cmake", "make" # Packaging tools - if ($Package) { $Deps += "ruby-devel", "rpmbuild", "groff" } + if ($Package) { $Deps += "ruby-devel", "rpmbuild", "groff", 'libffi-devel' } $PackageManager = "zypper --non-interactive install" $baseCommand = "$sudo $PackageManager" @@ -1647,8 +1656,8 @@ function Start-PSBootstrap { if ($Package) { try { # We cannot guess if the user wants to run gem install as root - Start-NativeExecution { gem install fpm -v 1.8.1 } - Start-NativeExecution { gem install ronn } + Start-NativeExecution { gem install fpm -v 1.9.3 } + Start-NativeExecution { gem install ronn -v 0.7.3 } } catch { Write-Warning "Installation of fpm and ronn gems failed! Must resolve manually." }