From patchwork Fri Feb 9 20:47:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1897217 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=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4TWmBc4qfdz23hc for ; Sat, 10 Feb 2024 07:47:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A79064214D; Fri, 9 Feb 2024 20:47:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YciHKv6vr6lf; Fri, 9 Feb 2024 20:47: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 smtp4.osuosl.org 3012F42048 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3012F42048; Fri, 9 Feb 2024 20:47:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 11427C0072; Fri, 9 Feb 2024 20:47:33 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3E668C0037 for ; Fri, 9 Feb 2024 20:47:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 213DE843A5 for ; Fri, 9 Feb 2024 20:47:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iDLtwGVemWM5 for ; Fri, 9 Feb 2024 20:47:31 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.183.196; helo=relay4-d.mail.gandi.net; envelope-from=i.maximets@ovn.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 72F2B8439D Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 72F2B8439D Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.osuosl.org (Postfix) with ESMTPS id 72F2B8439D for ; Fri, 9 Feb 2024 20:47:29 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2C25CE0009; Fri, 9 Feb 2024 20:47:26 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 9 Feb 2024 21:47:26 +0100 Message-ID: <20240209204808.1170753-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-GND-Sasl: i.maximets@ovn.org Cc: Ilya Maximets Subject: [ovs-dev] [PATCH] appveyor: Move from MinGW 32bit to msys64. 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" AppVeyor is planning to remove support for MinGW 32bit soon. And we had a couple of incidents where it wasn't available already, so we moved to a 'Previous' image. Move to msys64 instead. While at it making the CI scripts a little nicer, moving the non-Windows parts of the preparation and build to separate files. MSYS2 has its own version of python. However, we do not support building on Windows with non-Windows python build. The main issue is the delimiter symbol in PYTHONPATH. In Windows version it has to be ';', while the python supplied with MSYS2 uses ':' as on Linux, while we detect Windows and pass ';' during the build. Renaming the binary, so the Windows version is used. Additionally switched to Python 3.12, 3.7 reached EoL some time back, though it's still available in AppVeyor. The stderr has to be redirected to stdout for scripts, because any message on stderr is treated as fatal failure by powershell. Scripts are running with 'set -e', so a failure of individual commands will fail the script. The OpenSSL download is still failing, but it is out of scope for this change. Signed-off-by: Ilya Maximets Acked-by: Alin Gabriel Serdean Signed-off-by: Alin Gabriel Serdean --- .ci/windows-build.sh | 17 ++++++++++++ .ci/windows-prepare.sh | 11 ++++++++ Makefile.am | 2 ++ appveyor.yml | 59 ++++++++++++++++-------------------------- 4 files changed, 53 insertions(+), 36 deletions(-) create mode 100644 .ci/windows-build.sh create mode 100644 .ci/windows-prepare.sh diff --git a/.ci/windows-build.sh b/.ci/windows-build.sh new file mode 100644 index 000000000..22994fcdd --- /dev/null +++ b/.ci/windows-build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -ex + +CONFIGURATION=$1 + +./boot.sh +./configure CC=build-aux/cccl LD="$(which link)" \ + LIBS="-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32" \ + --prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var \ + --sysconfdir=C:/openvswitch/etc --with-pthread=c:/PTHREADS-BUILT/ \ + --enable-ssl --with-openssl=C:/OpenSSL-Win64 \ + --with-vstudiotarget="${CONFIGURATION}" + +make -j4 +make datapath_windows_analyze +make install +make windows_installer diff --git a/.ci/windows-prepare.sh b/.ci/windows-prepare.sh new file mode 100644 index 000000000..2d76add71 --- /dev/null +++ b/.ci/windows-prepare.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ex + +mkdir -p /var/cache/pacman/pkg/ +pacman -S --noconfirm --needed automake autoconf libtool make patch + +# Use an MSVC linker and a Windows version of Python. +mv $(which link) $(which link)_copy +mv $(which python3) $(which python3)_copy + +cd /c/pthreads4w-code && nmake all install diff --git a/Makefile.am b/Makefile.am index 94f488d18..45fce1243 100644 --- a/Makefile.am +++ b/Makefile.am @@ -81,6 +81,8 @@ EXTRA_DIST = \ .ci/linux-prepare.sh \ .ci/osx-build.sh \ .ci/osx-prepare.sh \ + .ci/windows-build.sh \ + .ci/windows-prepare.sh \ .cirrus.yml \ .editorconfig \ .github/workflows/build-and-test.yml \ diff --git a/appveyor.yml b/appveyor.yml index 5903b90d0..373f01a43 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 1.0.{build} -image: Previous Visual Studio 2019 +image: Visual Studio 2019 branches: only: - master @@ -7,54 +7,41 @@ configuration: - Debug - Release clone_folder: C:\openvswitch_compile +shallow_clone: true init: -- ps: $env:PATH ="C:\Python37;"+$env:PATH -- ps: New-Item -Type HardLink -Path "C:\Python37\python3.exe" -Value "C:\Python37\python.exe" -- ps: >- +- 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" +- ps: | mkdir C:\ovs-build-downloads - mkdir C:\openvswitch\driver - $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 cd C:\ovs-build-downloads - .\Win64OpenSSL-1_0_2u.exe /silent /verysilent /sp- /suppressmsgboxes - Start-Sleep -s 30 - - cd C:\openvswitch - - git clone -q https://git.code.sf.net/p/pthreads4w/code c:\pthreads4w-code - - python3 -m pip install pypiwin32 --disable-pip-version-check - 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"' -- C:\MinGW\msys\1.0\bin\bash -lc "echo \"C:/MinGW /mingw\" > /etc/fstab" -- C:\MinGW\msys\1.0\bin\bash -lc "mv /bin/link.exe /bin/link_copy.exe" -# Build pthreads -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/pthreads4w-code && nmake all install" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && ./boot.sh" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32\" --prefix=C:/openvswitch/usr --localstatedir=C:/openvswitch/var --sysconfdir=C:/openvswitch/etc --with-pthread=c:/PTHREADS-BUILT/ --enable-ssl --with-openssl=C:/OpenSSL-Win64 --with-vstudiotarget=\"%CONFIGURATION%\"" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && make -j 4" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && make datapath_windows_analyze" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && make install" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch_compile && make windows_installer" -- cp C:\PTHREADS-BUILT\bin\pthreadVC3.dll C:\openvswitch\usr\bin -- cp C:\PTHREADS-BUILT\bin\pthreadVC3.dll C:\openvswitch\usr\sbin -- ps: cp C:\openvswitch_compile\datapath-windows\x64\Win10$env:CONFIGURATION\package\* C:\openvswitch\driver -- ps: cp C:\openvswitch_compile\datapath-windows\x64\Win10$env:CONFIGURATION\package.cer C:\openvswitch\driver -- ps: cp C:\openvswitch_compile\datapath-windows\misc\* C:\openvswitch\driver -- cp c:\openvswitch_compile\windows\ovs-windows-installer\bin\x64\Release\OpenvSwitch.msi c:\OpenvSwitch-%CONFIGURATION%.msi +- ps: C:\msys64\msys2_shell.cmd -here -defterm -no-start -use-full-path -c + ".ci/windows-prepare.sh 2>&1" +- 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 +- ps: cp C:\PTHREADS-BUILT\bin\pthreadVC3.dll C:\openvswitch\usr\sbin +- ps: mkdir C:\openvswitch\driver +- ps: cp datapath-windows\x64\Win10$env:CONFIGURATION\package\* C:\openvswitch\driver +- ps: cp datapath-windows\x64\Win10$env:CONFIGURATION\package.cer C:\openvswitch\driver +- ps: cp datapath-windows\misc\* C:\openvswitch\driver +- ps: cp windows\ovs-windows-installer\bin\x64\Release\OpenvSwitch.msi + c:\OpenvSwitch-$env:CONFIGURATION.msi after_build: - - ps: 7z a C:\ovs-master-$env:CONFIGURATION.zip C:\openvswitch - - ps: Push-AppveyorArtifact C:\ovs-master-$env:CONFIGURATION.zip - - ps: Push-AppveyorArtifact C:\OpenvSwitch-$env:CONFIGURATION.msi +- ps: 7z a C:\ovs-master-$env:CONFIGURATION.zip C:\openvswitch +- ps: Push-AppveyorArtifact C:\ovs-master-$env:CONFIGURATION.zip +- ps: Push-AppveyorArtifact C:\OpenvSwitch-$env:CONFIGURATION.msi