From 6307158b0436b01ba93f9e194ac40e5dd37cfe4d Mon Sep 17 00:00:00 2001 From: Tomer Lev Date: Thu, 27 Oct 2022 11:21:16 +0300 Subject: [PATCH] Updating dependencies in the dockerfile and removing redundant from conanfile.txt --- ci/windows/CMakePresets.json | 67 ------------------------- ci/windows/Dockerfile | 7 ++- ci/windows/Initialize-MSVC.ps1 | 73 ---------------------------- ci/windows/Install-Prerequisites.ps1 | 12 ----- ci/windows/conanfile_windows.txt | 1 - 5 files changed, 3 insertions(+), 157 deletions(-) delete mode 100644 ci/windows/CMakePresets.json delete mode 100644 ci/windows/Initialize-MSVC.ps1 delete mode 100644 ci/windows/Install-Prerequisites.ps1 diff --git a/ci/windows/CMakePresets.json b/ci/windows/CMakePresets.json deleted file mode 100644 index 515f9df339..0000000000 --- a/ci/windows/CMakePresets.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "version": 2, - "configurePresets": [ - { - "name": "base", - "hidden": true, - "description": "Base preset", - "generator": "Ninja", - "binaryDir": "${sourceDir}/out/build/${presetName}", - "cacheVariables": { - "CMAKE_C_COMPILER": "cl.exe", - "CMAKE_CXX_COMPILER": "cl.exe" - }, - "architecture": { - "value": "x64", - "strategy": "external" - }, - "toolset": { - "value": "host=x64,version=16.11", - "strategy": "external" - } - }, - { - "name": "x64-Debug", - "inherits": "base", - "displayName": "x64 Debug", - "description": "Sets debug build type and x64 arch", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "x64-Release", - "displayName": "x64 Release", - "description": "Sets release build type", - "inherits": "x64-Debug", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - } - ], - "buildPresets": [ - { - "name": "default-debug-build", - "displayName": "Debug Build", - "configurePreset": "x64-Debug" - }, - { - "name": "verbose-debug-build", - "displayName": "Verbose Debug Build", - "configurePreset": "x64-Debug", - "nativeToolOptions": [ "-v" ] - }, - { - "name": "default-release-build", - "displayName": "Release Build", - "configurePreset": "x64-Release" - }, - { - "name": "verbose-release-build", - "displayName": "Verbose Release Build", - "configurePreset": "x64-Release", - "nativeToolOptions": [ "-v" ] - } - ], - "testPresets": [] -} \ No newline at end of file diff --git a/ci/windows/Dockerfile b/ci/windows/Dockerfile index 8e93fdd8af..86d204ca50 100644 --- a/ci/windows/Dockerfile +++ b/ci/windows/Dockerfile @@ -12,13 +12,12 @@ RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePoin # Install prerequisites RUN choco install -y --no-progress visualstudio2019buildtools --version=16.11.11.0 RUN choco install -y --no-progress visualstudio2019-workload-vctools --version=1.0.0 --package-parameters '--add Microsoft.VisualStudio.Component.VC.ATLMFC' -RUN choco install powershell-core -y RUN choco install conan -y RUN choco install sed -y -RUN choco install winflexbison -y -# Can't install a proper msys2 because it caused console hanging in the container during docker build. +RUN choco install winflexbison3 -y RUN choco install msysgit -y RUN choco install python -y +RUN choco install openssl -y # Set working environment. SHELL [ "cmd", "/c" ] @@ -28,4 +27,4 @@ RUN mkdir C:\build WORKDIR C:\build # This entry point starts the developer command prompt and launches the PowerShell shell. -ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=x64", "&&", "pwsh.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"] \ No newline at end of file +ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=x64", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"] \ No newline at end of file diff --git a/ci/windows/Initialize-MSVC.ps1 b/ci/windows/Initialize-MSVC.ps1 deleted file mode 100644 index 28b4a9611e..0000000000 --- a/ci/windows/Initialize-MSVC.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -param ( - [string] $Architecture='x64' -) - -if (!(Get-Module VSSetup)) -{ - Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force - Install-Module VSSetup -Force -} - -function Get-VSInstallPath { - [CmdletBinding()] - param ( - [Parameter(Mandatory=$true)] - [int] $MaxVersion - ) - $latest = Get-VSSetupInstance ` - | where { $_.InstallationVersion.Major -le $MaxVersion } ` - | Select-VSSetupInstance -Require Microsoft.VisualStudio.VC.CMake -Latest - - if (!$latest) - { - throw [System.IO.FileNotFoundException]::new("No Visual Studio installation found that matches max version: $MaxVersion!") - } - return $latest.InstallationPath -} - -function Where-Program { - [CmdletBinding()] - param ( - [Parameter(Mandatory=$true,ValueFromPipeline=$true)] - [string] $Program - ) - process - { - return Get-Command $Program | select Source -ExpandProperty source | Split-Path -Parent - } -} - -function Persist-EnvironmentVariable { - [CmdletBinding()] - param ( - [Parameter(Mandatory=$true,ValueFromPipeline=$true)] - [string] $Name - ) - process - { - $value=[System.Environment]::GetEnvironmentVariable($Name) - [System.Environment]::SetEnvironmentVariable($Name, $value, [System.EnvironmentVariableTarget]::Machine) - } -} - -$VsInstallationPath = Get-VSInstallPath -MaxVersion 16 -Write-Host "Found VS installation: $VsInstallationPath" - -[array] $originalEnv = [System.Environment]::GetEnvironmentVariables().Keys - -Import-Module "$VsInstallationPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -Enter-VsDevShell -VsInstallPath $VsInstallationPath -SkipAutomaticLocation -DevCmdArguments "-arch=$Architecture" - -$Programs = 'cmake', 'Ninja', 'cl' -$programsPath = $Programs | Where-Program -Write-Host "Found paths for $($Programs -join ', '): $($programsPath -join ', ')" - -$newPath = "$($programsPath -join ';');${env:Path}" -Write-Host "Persisting new PATH: $newPath" -[System.Environment]::SetEnvironmentVariable('PATH', $newPath, [System.EnvironmentVariableTarget]::Machine) - -[array] $vsEnv = [System.Environment]::GetEnvironmentVariables().Keys -[array] $newEnv = $vsEnv | where { $_ -notin $originalEnv -and $_ -ne 'PATH' } - -Write-Host "Persisting new environment variables: $($newEnv -join ', ')" -$newEnv | Persist-EnvironmentVariable diff --git a/ci/windows/Install-Prerequisites.ps1 b/ci/windows/Install-Prerequisites.ps1 deleted file mode 100644 index 2d15cb9b35..0000000000 --- a/ci/windows/Install-Prerequisites.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 -iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - -choco install conan -y -choco install sed -y -choco install winflexbison -y -if (!(Get-Command python)) -{ - choco install python -y -} - -[System.Environment]::SetEnvironmentVariable('PATH', "C:\Program Files\Git\bin;${env:PATH}", [System.EnvironmentVariableTarget]::Machine) \ No newline at end of file diff --git a/ci/windows/conanfile_windows.txt b/ci/windows/conanfile_windows.txt index 79db1eccc4..cb4bc35ada 100644 --- a/ci/windows/conanfile_windows.txt +++ b/ci/windows/conanfile_windows.txt @@ -1,5 +1,4 @@ [requires] -openssl/1.1.1i zlib/1.2.11 libpcap/1.10.1 c-ares/1.18.1