Skip to content

Commit 46ff660

Browse files
vorsdaxian-dbw
authored andcommitted
Fix crypto libs patching logic to accomodate multiply files (PowerShell#2541)
Native library also changed from System.Security.Cryptography.Native.dylib to System.Security.Cryptography.Native.OpenSsl.dylib See discussion in PowerShell#2510
1 parent f4c1569 commit 46ff660

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ function Start-PSBuild {
242242
# This is the restored library used to build
243243
# This is allowed to fail since the user may have already restored
244244
Write-Warning ".NET Core links the incorrect OpenSSL, correcting NuGet package libraries..."
245-
find $env:HOME/.nuget -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib
246-
find $env:HOME/.nuget -name System.Net.Http.Native.dylib | xargs sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib
245+
find $env:HOME/.nuget -name System.Security.Cryptography.Native.OpenSsl.dylib | % { sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib $_ }
246+
find $env:HOME/.nuget -name System.Net.Http.Native.dylib | % { sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib $_ }
247247
}
248248
}
249249

@@ -885,7 +885,7 @@ function Install-Dotnet {
885885
# This is the library shipped with .NET Core
886886
# This is allowed to fail as the user may have installed other versions of dotnet
887887
Write-Warning ".NET Core links the incorrect OpenSSL, correcting .NET CLI libraries..."
888-
find $env:HOME/.dotnet -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib
888+
find $env:HOME/.dotnet -name System.Security.Cryptography.Native.dylib | % { sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib }
889889
}
890890
} elseif ($IsWindows) {
891891
Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet

0 commit comments

Comments
 (0)