From patchwork Tue Feb 13 19:40:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1898391 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TZBWS4Dwhz23hT for ; Wed, 14 Feb 2024 06:40:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BFD5D60E56; Tue, 13 Feb 2024 19:40:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NtTyPREy7Pg1; Tue, 13 Feb 2024 19:40:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7D26A60E50 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 7D26A60E50; Tue, 13 Feb 2024 19:40:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70F28C0072; Tue, 13 Feb 2024 19:40:33 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 10F22C0DCE for ; Tue, 13 Feb 2024 19:40:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7D3A660E1E for ; Tue, 13 Feb 2024 19:40:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rwSRji1vZYPI for ; Tue, 13 Feb 2024 19:40:25 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.183.200; helo=relay7-d.mail.gandi.net; envelope-from=i.maximets@ovn.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org BDD8B60E33 Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BDD8B60E33 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp3.osuosl.org (Postfix) with ESMTPS id BDD8B60E33 for ; Tue, 13 Feb 2024 19:40:24 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id B958220002; Tue, 13 Feb 2024 19:40:22 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Tue, 13 Feb 2024 20:40:18 +0100 Message-ID: <20240213194050.1590143-5-i.maximets@ovn.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213194050.1590143-1-i.maximets@ovn.org> References: <20240213194050.1590143-1-i.maximets@ovn.org> MIME-Version: 1.0 X-GND-Sasl: i.maximets@ovn.org Cc: Ilya Maximets Subject: [ovs-dev] [PATCH 4/4] appveyor: Build with OpenSSL 3.0. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" OpenSSL 1.0.2u is long deprecated and not available for download. So, our CI never actually downloads it and uses whatever is in the OpenSSL-Win64 folder provided by AppVeyor. Luckily, it happens to be OpenSSL 1.0.2u today. The oldest supported version of OpenSSL upstream today is 3.0. And it is an LTS version. 3.1 and 3.2 are not LTS. Use OpenSSL 3.0 for testing instead. This commit does a few things to achieve that: 1. Removes the folder provided by AppVeyor. This way we will fail the build if something goes wrong instead of silently using OpenSSL version provided by AppVeyor. 2. Obtains the JSON description of available releases and downloads the latest minor version of OpenSSL 3.0 64-bit. With this approach we should not need to update the download link that frequently. New minor releases will be picked up automatically. They should not have any breaking changes, so should be fine to use in CI. OpenSSL 3.0 is supported until at least Sep 2026. The JSON file is an official file referenced on the: https://slproweb.com/products/Win32OpenSSL.html So, it should be safe to use. 3. Executes the downloaded installer with 'Start-Process -Wait' to properly wait for installation to finish instead of just sleeping for 30 seconds. 4. Caches the downloaded installer, so we're not downloading 300 MB on each CI run as that is not nice to do. We know the hash of the latest version, so we will re-download only when the binary changes, i.e. on a new minor release. For the cache to work we need to introduce the 'install' phase, because caches are populated after 'init', but before 'install'. Alternatively, we could have just renamed 'init' to 'install', but I think it's a little nicer to have separate phases, and we can also move 'windows-prepare.sh' to the install phase. Cache is also invalidated whenever appveyor.yml changes. Signed-off-by: Ilya Maximets Acked-by: Simon Horman --- appveyor.yml | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 373f01a43..29cc44d6c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,28 +8,60 @@ configuration: - Release clone_folder: C:\openvswitch_compile shallow_clone: true + init: - ps: $env:PATH ="C:\Python312-x64;"+$env:PATH - ps: New-Item -Type HardLink -Path "C:\Python312-x64\python3.exe" -Value "C:\Python312-x64\python.exe" + +cache: +- C:\ovs-build-downloads -> appveyor.yml + +install: - ps: | - mkdir C:\ovs-build-downloads + Remove-Item -Recurse -Force -Path C:/OpenSSL-Win64 + New-Item -ItemType Directory -Force -Path C:\ovs-build-downloads + + # Find and download the latest stable OpenSSl 3.0. + $URL = "https://raw.githubusercontent.com/slproweb/opensslhashes/master/win32_openssl_hashes.json" + $webData = (Invoke-WebRequest -Uri $URL).content | ConvertFrom-Json + $source = ($webData.files.PSObject.Properties | Where-Object { + $_.Value.basever -match "3.0.*" -and + $_.Value.bits -eq "64" -and + $_.Value.arch -eq "INTEL" -and + $_.Value.installer -eq "exe" -and + -not $_.Value.light + } | Select-Object Value).PSObject.Properties.Value + + Write-Host "Latest OpenSSL 3.0:" ($source | Format-List | Out-String) + + $destination = "C:\ovs-build-downloads\Win64OpenSSL.exe" + if (Test-Path $destination) { + $fileHash = (Get-FileHash $destination -Algorithm SHA256).Hash.ToLower() + if ($fileHash -ne $source.sha256) { + Write-Host "Cache miss:" $fileHash "!=" $source.sha256 + Remove-Item -Path $destination + } + } - $source = "https://slproweb.com/download/Win64OpenSSL-1_0_2u.exe" - $destination = "C:\ovs-build-downloads\Win64OpenSSL-1_0_2u.exe" - Invoke-WebRequest $source -OutFile $destination + if (Test-Path $destination) { + Write-Host "Using cached:" $destination + } else { + Write-Host "Downloading:" $source.url + Invoke-WebRequest $source.url -OutFile $destination + } + + Write-Host "Installing:" $destination + Start-Process -FilePath $destination ` + -ArgumentList "/silent /verysilent /sp- /suppressmsgboxes" -Wait - cd C:\ovs-build-downloads - .\Win64OpenSSL-1_0_2u.exe /silent /verysilent /sp- /suppressmsgboxes - Start-Sleep -s 30 - cd C:\openvswitch_compile - ps: git clone -q https://git.code.sf.net/p/pthreads4w/code c:\pthreads4w-code - ps: python3 -m pip install pypiwin32 --disable-pip-version-check - -build_script: - '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"' - ps: C:\msys64\msys2_shell.cmd -here -defterm -no-start -use-full-path -c ".ci/windows-prepare.sh 2>&1" + +build_script: - ps: C:\msys64\msys2_shell.cmd -here -defterm -no-start -use-full-path -c ".ci/windows-build.sh $env:CONFIGURATION 2>&1" - ps: cp C:\PTHREADS-BUILT\bin\pthreadVC3.dll C:\openvswitch\usr\bin