@@ -439,6 +439,19 @@ function Start-BuildNativeUnixBinaries {
439439
440440 git clean - qfdX $Native
441441
442+ # the stat tests rely on stat(1). On most platforms, this is /usr/bin/stat,
443+ # but on alpine it is in /bin. Be sure that /usr/bin/stat exists, or
444+ # create a link from /bin/stat. If /bin/stat is missing, we'll have to fail the build
445+
446+ if ( ! (Test-Path / usr/ bin/ stat) ) {
447+ if ( Test-Path / bin/ stat ) {
448+ New-Item - Type SymbolicLink - Path / usr/ bin/ stat - Target / bin/ stat
449+ }
450+ else {
451+ throw " Cannot create symlink to stat(1)"
452+ }
453+ }
454+
442455 try {
443456 Push-Location $Native
444457 if ($BuildLinuxArm ) {
@@ -1927,7 +1940,7 @@ function Start-PSBootstrap {
19271940
19281941 # Install ours and .NET's dependencies
19291942 $Deps = @ ()
1930- if ($Environment.IsUbuntu ) {
1943+ if ($Environment.IsUbuntu -or $Environment .IsDebian ) {
19311944 # Build tools
19321945 $Deps += " curl" , " g++" , " cmake" , " make"
19331946
@@ -1985,7 +1998,8 @@ function Start-PSBootstrap {
19851998 }
19861999 } elseif ($Environment.IsSUSEFamily ) {
19872000 # Build tools
1988- $Deps += " gcc" , " cmake" , " make"
2001+ # we're using a flag which requires an up to date compiler
2002+ $Deps += " gcc7" , " cmake" , " make" , " gcc7-c++"
19892003
19902004 # Packaging tools
19912005 if ($Package ) { $Deps += " ruby-devel" , " rpmbuild" , " groff" , ' libffi-devel' }
@@ -2003,6 +2017,21 @@ function Start-PSBootstrap {
20032017 Start-NativeExecution {
20042018 Invoke-Expression " $baseCommand $Deps "
20052019 }
2020+
2021+ # After installation, create the appropriate symbolic links
2022+ foreach ($compiler in " gcc-7" , " g++-7" ) {
2023+ $itemPath = " /usr/bin/${compiler} "
2024+ $name = $compiler -replace " -7"
2025+ $linkPath = " /usr/bin/${name} "
2026+ $link = Get-Item - Path $linkPath - ErrorAction SilentlyContinue
2027+ if ($link ) {
2028+ if ($link.Target ) { # Symbolic link - remove it
2029+ Remove-Item - Force - Path $linkPath
2030+ }
2031+ }
2032+ New-Item - Type SymbolicLink - Target $itemPath - Path $linkPath
2033+ }
2034+
20062035 } elseif ($Environment.IsMacOS ) {
20072036 precheck ' brew' " Bootstrap dependency 'brew' not found, must install Homebrew! See http://brew.sh/"
20082037
0 commit comments