@@ -439,6 +439,19 @@ function Start-BuildNativeUnixBinaries {
439
439
440
440
git clean - qfdX $Native
441
441
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
+
442
455
try {
443
456
Push-Location $Native
444
457
if ($BuildLinuxArm ) {
@@ -1927,7 +1940,7 @@ function Start-PSBootstrap {
1927
1940
1928
1941
# Install ours and .NET's dependencies
1929
1942
$Deps = @ ()
1930
- if ($Environment.IsUbuntu ) {
1943
+ if ($Environment.IsUbuntu -or $Environment .IsDebian ) {
1931
1944
# Build tools
1932
1945
$Deps += " curl" , " g++" , " cmake" , " make"
1933
1946
@@ -1985,7 +1998,8 @@ function Start-PSBootstrap {
1985
1998
}
1986
1999
} elseif ($Environment.IsSUSEFamily ) {
1987
2000
# 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++"
1989
2003
1990
2004
# Packaging tools
1991
2005
if ($Package ) { $Deps += " ruby-devel" , " rpmbuild" , " groff" , ' libffi-devel' }
@@ -2003,6 +2017,21 @@ function Start-PSBootstrap {
2003
2017
Start-NativeExecution {
2004
2018
Invoke-Expression " $baseCommand $Deps "
2005
2019
}
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
+
2006
2035
} elseif ($Environment.IsMacOS ) {
2007
2036
precheck ' brew' " Bootstrap dependency 'brew' not found, must install Homebrew! See http://brew.sh/"
2008
2037
0 commit comments