@@ -197,7 +197,8 @@ function Start-OpenSSHBootstrap
197
197
Write-BuildMsg - AsVerbose - Message " $gitCmdPath already present in Path environment variable" - Silent:$silent
198
198
}
199
199
200
- $nativeMSBuildPath = Get-VS2015BuildToolPath
200
+ $VS2015Path = Get-VS2015BuildToolPath
201
+ $VS2017Path = Get-VS2017BuildToolPath
201
202
202
203
# Update machine environment path
203
204
if ($newMachineEnvironmentPath -ne $machinePath )
@@ -206,9 +207,24 @@ function Start-OpenSSHBootstrap
206
207
}
207
208
208
209
$vcVars = " ${env: ProgramFiles(x86)} \Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"
209
- $sdkPath = " ${env: ProgramFiles(x86)} \Windows Kits\8.1\bin\x86\register_app.vbs"
210
- $packageName = " vcbuildtools"
211
- If (($nativeMSBuildPath -eq $null ) -or (-not (Test-Path $VcVars )) -or (-not (Test-Path $sdkPath ))) {
210
+ $sdkPath = " ${env: ProgramFiles(x86)} \Windows Kits\8.1\bin\x86\register_app.vbs"
211
+ # use vs2017 build tool if exists
212
+ if ($VS2017Path -ne $null )
213
+ {
214
+ If (-not (Test-Path $sdkPath ))
215
+ {
216
+ $packageName = " windows-sdk-8.1"
217
+ Write-BuildMsg - AsInfo - Message " $packageName not present. Installing $packageName ..."
218
+ choco install $packageName - y -- force -- limitoutput -- execution- timeout 10000 2>&1 >> $script :BuildLogFile
219
+ }
220
+
221
+ if (-not (Test-Path $VcVars ))
222
+ {
223
+ Write-BuildMsg - AsError - ErrorAction Stop - Message " VC++ 2015.3 v140 toolset are not installed."
224
+ }
225
+ }
226
+ elseIf (($VS2015Path -eq $null ) -or (-not (Test-Path $VcVars )) -or (-not (Test-Path $sdkPath ))) {
227
+ $packageName = " vcbuildtools"
212
228
Write-BuildMsg - AsInfo - Message " $packageName not present. Installing $packageName ..."
213
229
choco install $packageName - ia " /InstallSelectableItems VisualCppBuildTools_ATLMFC_SDK;VisualCppBuildTools_NETFX_SDK;Win81SDK_CppBuildSKUV1" - y -- force -- limitoutput -- execution- timeout 10000 2>&1 >> $script :BuildLogFile
214
230
$errorCode = $LASTEXITCODE
@@ -234,24 +250,21 @@ function Start-OpenSSHBootstrap
234
250
Write-BuildMsg - AsError - ErrorAction Stop - Message " User choose not to restart the machine to apply the changes."
235
251
}
236
252
}
237
- else
253
+ elseif ( $errorCode -ne 0 )
238
254
{
239
- Write-BuildMsg - AsError - ErrorAction Stop - Message " $packageName installation failed with error code $errorCode "
255
+ Write-BuildMsg - AsError - ErrorAction Stop - Message " $packageName installation failed with error code $errorCode . "
240
256
}
241
257
}
242
258
else
243
259
{
244
260
Write-BuildMsg - AsVerbose - Message ' VC++ 2015 Build Tools already present.'
245
261
}
246
262
247
- if ($NativeHostArch.ToLower ().Startswith(' arm' ))
248
- {
249
- $nativeMSBuildPath = Get-VS2017BuildToolPath
250
- If ($nativeMSBuildPath -eq $null )
251
- {
252
- # todo, install vs 2017 build tools
253
- Write-BuildMsg - AsError - ErrorAction Stop - Message " The required msbuild 15.0 is not installed on the machine."
254
- }
263
+ if ($NativeHostArch.ToLower ().Startswith(' arm' ) -and ($VS2017Path -eq $null ))
264
+ {
265
+
266
+ # todo, install vs 2017 build tools
267
+ Write-BuildMsg - AsError - ErrorAction Stop - Message " The required msbuild 15.0 is not installed on the machine."
255
268
}
256
269
257
270
if ($OneCore -or ($NativeHostArch.ToLower ().Startswith(' arm' )))
@@ -268,7 +281,7 @@ function Start-OpenSSHBootstrap
268
281
# Ensure the VS C toolset is installed
269
282
if ($null -eq $env: VS140COMNTOOLS )
270
283
{
271
- Write-BuildMsg - AsError - ErrorAction Stop - Message " Cannot find Visual Studio 2015 Environment variable VS140COMNTOOlS"
284
+ Write-BuildMsg - AsError - ErrorAction Stop - Message " Cannot find Visual Studio 2015 Environment variable VS140COMNTOOlS. "
272
285
}
273
286
274
287
$item = Get-Item (Join-Path - Path $env: VS140COMNTOOLS - ChildPath ' ../../vc' )
@@ -314,7 +327,7 @@ function Copy-LibreSSLSDK
314
327
Copy-Item - Container - Path $sourcePath - Destination $PSScriptRoot - Recurse - Force - ErrorAction SilentlyContinue - ErrorVariable e
315
328
if ($e -ne $null )
316
329
{
317
- Write-BuildMsg - AsError - ErrorAction Stop - Message " Copy LibreSSLSDK from $sourcePath to $PSScriptRoot failed"
330
+ Write-BuildMsg - AsError - ErrorAction Stop - Message " Copy LibreSSLSDK from $sourcePath to $PSScriptRoot failed. "
318
331
}
319
332
}
320
333
@@ -330,7 +343,8 @@ function Start-OpenSSHPackage
330
343
[string ]$Configuration = " Release" ,
331
344
332
345
# Copy payload to DestinationPath instead of packaging
333
- [string ]$DestinationPath = " "
346
+ [string ]$DestinationPath = " " ,
347
+ [switch ]$NoOpenSSL
334
348
)
335
349
336
350
[System.IO.DirectoryInfo ] $repositoryRoot = Get-RepositoryRoot
@@ -390,7 +404,10 @@ function Start-OpenSSHPackage
390
404
391
405
# copy libcrypto dll
392
406
$libreSSLSDKPath = Join-Path $PSScriptRoot $script :libreSSLSDKStr
393
- Copy-Item - Path $ (Join-Path $libreSSLSDKPath " $NativeHostArch \libcrypto.dll" ) - Destination $packageDir - Force - ErrorAction Stop
407
+ if (-not $NoOpenSSL.IsPresent )
408
+ {
409
+ Copy-Item - Path $ (Join-Path $libreSSLSDKPath " $NativeHostArch \libcrypto.dll" ) - Destination $packageDir - Force - ErrorAction Stop
410
+ }
394
411
395
412
if ($DestinationPath -ne " " ) {
396
413
if (Test-Path $DestinationPath ) {
@@ -400,7 +417,7 @@ function Start-OpenSSHPackage
400
417
New-Item - ItemType Directory $DestinationPath - Force | Out-Null
401
418
}
402
419
Copy-Item - Path $packageDir \* - Destination $DestinationPath - Force - Recurse
403
- Write-BuildMsg - AsInfo - Message " Copied payload to $DestinationPath "
420
+ Write-BuildMsg - AsInfo - Message " Copied payload to $DestinationPath . "
404
421
}
405
422
else {
406
423
Remove-Item ($packageDir + ' .zip' ) - Force - ErrorAction SilentlyContinue
@@ -411,7 +428,7 @@ function Start-OpenSSHPackage
411
428
}
412
429
else
413
430
{
414
- Write-BuildMsg - AsInfo - Message " Packaged Payload not compressed."
431
+ Write-BuildMsg - AsInfo - Message " Packaged Payload not compressed."
415
432
}
416
433
}
417
434
Remove-Item $packageDir - Recurse - Force - ErrorAction SilentlyContinue
@@ -470,7 +487,7 @@ function Start-OpenSSHBuild
470
487
Remove-Item - Path $script :BuildLogFile - force
471
488
}
472
489
473
- Write-BuildMsg - AsInfo - Message " Starting Open SSH build; Build Log: $ ( $script :BuildLogFile ) "
490
+ Write-BuildMsg - AsInfo - Message " Starting Open SSH build; Build Log: $ ( $script :BuildLogFile ) . "
474
491
475
492
Start-OpenSSHBootstrap - OneCore:$OneCore
476
493
@@ -523,17 +540,25 @@ function Start-OpenSSHBuild
523
540
$xml.Project.PropertyGroup.WindowsSDKVersion = $win10SDKVer.ToString ()
524
541
$xml.Project.PropertyGroup.AdditionalDependentLibs = ' onecore.lib'
525
542
$xml.Project.PropertyGroup.MinimalCoreWin = ' true'
543
+
544
+ # Use onecore libcrypto binaries
545
+ $xml.Project.PropertyGroup ." LibreSSL-x86-Path" = ' $(SolutionDir)\LibreSSLSDK\onecore\x86\'
546
+ $xml.Project.PropertyGroup ." LibreSSL-x64-Path" = ' $(SolutionDir)\LibreSSLSDK\onecore\x64\'
547
+ $xml.Project.PropertyGroup ." LibreSSL-arm-Path" = ' $(SolutionDir)\LibreSSLSDK\onecore\arm\'
548
+ $xml.Project.PropertyGroup ." LibreSSL-arm64-Path" = ' $(SolutionDir)\LibreSSLSDK\onecore\arm64\'
549
+
526
550
$xml.Save ($PathTargets )
527
551
}
528
552
529
553
$solutionFile = Get-SolutionFile - root $repositoryRoot.FullName
530
- $cmdMsg = @ (" ${solutionFile} " , " /p:Platform=${NativeHostArch} " , " /p:Configuration=${Configuration} " , " /m" , " /noconlog" , " /nologo" , " /fl" , " /flp:LogFile=${ script:BuildLogFile } `;Append`;Verbosity=diagnostic" )
531
-
532
- if ($NativeHostArch.ToLower ().Startswith(' arm' ))
554
+ $cmdMsg = @ (" ${solutionFile} " , " /t:Rebuild" , " /p:Platform=${NativeHostArch} " , " /p:Configuration=${Configuration} " , " /m" , " /nologo" , " /fl" , " /flp:LogFile=${ script:BuildLogFile } `;Append`;Verbosity=diagnostic" )
555
+ if ($silent )
533
556
{
534
- $msbuildCmd = Get-VS2017BuildToolPath
557
+ $cmdMsg += " /noconlog "
535
558
}
536
- else
559
+
560
+ $msbuildCmd = Get-VS2017BuildToolPath
561
+ if ($msbuildCmd -eq $null )
537
562
{
538
563
$msbuildCmd = Get-VS2015BuildToolPath
539
564
}
0 commit comments