2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

36 Commits

Author SHA1 Message Date
Ilya Maximets
69826ad639 appveyor: Fix python PATH for a new pywin32-309.
Pip is unable to install new pywin32 v309 with the following warning:

  WARNING: The scripts pywin32_postinstall.exe and pywin32_testall.exe
  are installed in 'C:\Python312-x64\Scripts' which is not on PATH.

This now fails all the windows builds.

It looks like this directory is generally required for pip and some
other packages to work properly, we just didn't hit the issue until
it became required for pywin32.

Let's add it to the PATH.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2025-03-11 23:07:01 +01:00
Ilya Maximets
85d19a5edd appveyor: Fix caching of OpenSSL installer.
Apparently, if the cache dependency is specified, the cache folder
is not checked at the end of a build and so the cache is never
updated unless we change appveyor.yml.  This makes the cache to not
actually work, because on each build we discover that the installer
is outdated, download the new one and it is not uploaded to the cache,
so it is still outdated on the next build.

Removing the dependency to get a normal cache behavior.  We're
manually comparing the hash of the cached binary with the most
latest one, so we will still catch any OpenSSL updates, but now
we will also upload the updated cache back.

Fixes: 9d8208484a35 ("appveyor: Build with OpenSSL 3.0.")
Reported-at: https://help.appveyor.com/discussions/problems/36144-cache-reports-up-to-date-while-it-is-not
Acked-by: Alin-Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2024-06-14 23:28:34 +02:00
Ilya Maximets
66a8430c70 appveyor: Fix too wide OpenSSL version regexp.
Current regexp is not good enough.  OpenSSL 3.3.0 is now available
and unfortunately the regexp is matching both 3.3.0 and 3.0.13.

All the AppVeyor runs are currently failing because of this.

Making it more restrictive by matching on the start of the string,
explicit dots and numbers after the last dot.  Hopefully, this is
good enough.

In addition, taking only the first result just in case it mismatches
again.

Fixes: 9d8208484a35 ("appveyor: Build with OpenSSL 3.0.")
Acked-by: Simon Horman <horms@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2024-04-12 11:41:25 +02:00
Simon Horman
b34dac4c68 appveyor: Remove reference to master branch.
The OvS primary development branch has been renamed main
so there is no longer any need for this CI configuration
to refer to master.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Simon Horman <horms@ovn.org>
2024-04-11 12:11:16 +01:00
Simon Horman
95ff912ede appveyor: Prepare for rename of primary development branch.
Recently OVS adopted a policy of using the inclusive naming word list v1
[1, 2].  And in keeping with this policy it is intended to rename the
primary development branch from master to main [3].

In order to help facilitate this change allow Appveyor to run
on the main as well as master branch. It is intended that
master branch will be removed from appveyor.yml after the primary branch
has been renamed.

Also, update the string included in artifacts from 'master' to 'main'.

[1] df5e5cf4318a ("Documentation: Add section on inclusive language.")
[2] https://inclusivenaming.org/word-lists/
[3] https://mail.openvswitch.org/pipermail/ovs-dev/2024-March/412686.html

Signed-off-by: Simon Horman <horms@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
2024-04-02 12:18:08 +01:00
Ilya Maximets
9d8208484a appveyor: Build with OpenSSL 3.0.
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.

Acked-by: Simon Horman <horms@ovn.org>
Acked-by: Alin-Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2024-03-04 22:16:07 +01:00
Ilya Maximets
11b62f5e0b appveyor: Move from MinGW 32bit to msys64.
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.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2024-02-12 17:11:16 +01:00
Ilya Maximets
cf984d5bec appveyor: Use previous image to unblock CI.
It may take a few days for AppVeyor to fix their broken
images [1], use the 'Previous' version of the image for now
to unblock CI.

We'll need to revert this once the issue is fixed.

[1] https://github.com/appveyor/ci/issues/3893

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-12-01 14:34:00 +01:00
Ilya Maximets
64cdc290ef appveyor: Silence the git clone of pthreads4w.
Git by default reports progress on stderr.  This doesn't fail
the build, but upsets the powershell:

 git : Cloning into 'c:\pthreads4w-code'...
 At line:3 char:1
 + git clone https://git.code.sf.net/p/pthreads4w/code c:\pthreads4w-cod ...
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified:
            (Cloning into 'c:\pthreads4w-code'...:String) [], RemoteException
     + FullyQualifiedErrorId : NativeCommandError

Silence the git clone to avoid the warning.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-06-02 10:57:54 +02:00
Alin Gabriel Serdean
80e74da4fd appveyor: Bump outdated links and add artifacts
Bump OpenSSL.

Add release and debug configuration.

Build and add Windows installer to generated artifacts.

Build and zip prebuilt version.

Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Jinjun Gao <jinjung@vmware.com>
Signed-off-by: Jinjun Gao <jinjung@vmware.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
2020-10-04 22:09:45 +03:00
Alin Gabriel Serdean
8596b131c3 windows: Update build with latest pthread project
pthreads-win32 has moved too PThreads4W.

This patch updates the build steps, CI (appveyor) and documentation.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
2020-10-04 22:09:44 +03:00
Timothy Redaelli
0c4d144a98 Remove dependency on python3-six
Since Python 2 support was removed in 1ca0323e7c29 ("Require Python 3 and
remove support for Python 2."), python3-six is not needed anymore.

Moreover python3-six is not available on RHEL/CentOS7 without using EPEL
and so this patch is needed in order to release OVS 2.13 on RHEL7.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-12-20 12:23:06 -08:00
Alin Gabriel Serdean
8009785273 appveyor: Update OpenSSL link and python3 to path
This patch fixes the appveyor build by adding the python version 3 to path
as per:
https://www.appveyor.com/docs/windows-images-software/#python

We also create a hardlink for python3 in the same directory to ease up scripts
which checks for its existence.

This patch also bumps the OpenSSL version from 1.0.2n to 1.0.2t.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: William Tu <u9012063@gmail.com>
2019-10-09 17:20:51 -07:00
Ben Pfaff
1ca0323e7c Require Python 3 and remove support for Python 2.
Python 2 reaches end-of-life on January 1, 2020, which is only
a few months away.  This means that OVS needs to stop depending
on in the next release that should occur roughly that same time.
Therefore, this commit removes all support for Python 2.  It
also makes Python 3 a mandatory build dependency.

Some of the interesting consequences:

- HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have
  been removed, since we now know that Python3 is available.

- $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always
  available.

- Many tests for Python 2 support have been removed, and the ones
  that depended on Python 3 now run unconditionally.  This allowed
  several macros in the testsuite to be removed, making the code
  clearer.  This does make some of the changes to the testsuite
  files large due to indentation level changes.

- #! lines for Python now use /usr/bin/python3 instead of
  /usr/bin/python.

- Packaging depends on Python 3 packages.

Acked-by: Numan Siddique <nusiddiq@redhat.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-09-27 09:23:50 -07:00
Ben Pfaff
4d8f04b3e9 util: Fix abs_file_name() bugs on Windows.
abs_file_name() believed that a file name that begins with / or contains :
is absolute and that any other file name is relative.  On Windows, this is
wrong in at least the following ways:

   * / and \ are interchangeable on Windows.

   * A name that begins with \\ or // is also absolute.

   * A name that begins with X: but not X:\ is not absolute.

   * A name with : in some position other than the second position is
     not absolute (although it might not be valid either?).

Furthermore, Windows has more than one current working directory (one per
volume letter), so trying to make a file name absolute by just prefixing
the current working directory for the current volume results in silliness.

This patch attempts to fix the problem.

This makes OVS link against shlwapi, which is needed to use
PathIsRelative().

Found by inspection.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-03 09:21:54 -07:00
Alin Gabriel Serdean
2a72edbb0a AppVeyor: Add Win10 compilation to the build
People from AppVeyor are nice and included the Windows 10 DDK (driver
development kit).

This patch allows AppVeyor to compile the Win10 target.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Shashank Ram <shashank08@gmail.com>
2018-03-05 15:42:23 +02:00
Shashank Ram
b1db9dd674 datapath-windows: Support to selectively compile targets
Adds support to selectively compile kernel driver for
target versions. This is useful when environments to
compile for all targets might not be available on the
user's machine, or if the user wants to only compile
some targets selectively.

Also once appveyor has support to build Win10 targets,
we will not pass the "--with-vstudiotargetver" to the
configure script.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
2018-03-02 01:02:55 +02:00
Alin Gabriel Serdean
cb9f3089bc appveyor: Bump OpenSSL version
The URL https://slproweb.com/download/Win32OpenSSL-1_0_2L.exe is
no longer valid.

Bump the version of OpenSSL to 1_0_2n.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2018-01-11 16:30:17 +02:00
Alin Serdean
16e9339869 appveyor: Fix broken URL
The commit 2e72898bbab40f48cc3fe77ce0273bb9bb66e9ac bumped the OpenSSL
version, but got the URL wrong.

Use uppercase `L` instead of lowercase `l`.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-07-15 15:50:45 -07:00
Alin Serdean
2e72898bba appveyor: Bump OpenSSL version
The URL https://slproweb.com/download/Win32OpenSSL-1_0_2k.exe is
no longer valid.

Bump the version of OpenSSL to 1_0_2l.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-07-13 16:35:40 -07:00
Alin Serdean
2f839c0257 appveyor: Add new make target
This patch adds the new make target 'datapath_windows_analyze' (static
analysis over the windows datapath code) to the appveyor build.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Anand Kumar <kumaranand@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2017-05-25 08:50:12 -07:00
Alin Serdean
0c3e381599 appveyor: Bump OpenSSL version
The URL https://slproweb.com/download/Win32OpenSSL-1_0_2j.exe is
no longer valid.

Bump to the variables to the latest version of OpenSSL version.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-01-31 14:31:48 -08:00
Alin Serdean
2974ce8e4a appveyor.yml: Install python "pypiwin32" module.
pypiwin32 is now required for the build.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2017-01-04 07:41:03 -08:00
Alin Serdean
da467899ab Windows: Add internal switch port per OVS bridge
This patch updates the following commands in the vswitch:
 ovs-vsctl add-br br-test
 ovs-vsctl del-br br-test

ovs-vsctl add-br br-test:
    This command will now create an internal port on the MSFT virtual switch
  using the WMI interface from Msvm_VirtualEthernetSwitchManagementService
  leveraging the method AddResourceSettings.
    Before creating the actual port, the switch will be queried to see if there
  is not a port already created (good for restarts when restarting the
  vswitch daemon). If there is a port defined it will return success and log
  a message.
    After checking if the port already exists the command will also verify
  if the forwarding extension (windows datapath) is enabled and on a single
  switch. If it is not activated or if it is activated on multiple switches
  it will return an error and a message will be logged.
    After the port was created on the switch, we will disable the adapter on
  the host and rename to the corresponding OVS bridge name for consistency.
    The user will enable and set the values he wants after creation.

ovs-vsctl del-br br-test
    This command will remove an internal port on the MSFT virtual switch
  using the Msvm_VirtualEthernetSwitchManagementService class and executing
  the method RemoveResourceSettings.

Both commands will be blocking until the WMI job is finished, this allows us
to guarantee that the ports are created and their name are set before issuing
a netlink message to the windows datapath.

This patch also includes helpers for normal WMI retrievals and initializations.
Appveyor and documentation has been modified to include the libraries needed
for COM objects.

This patch was tested individually using IMallocSpy and CRT heap checks
to ensure no new memory leaks are introduced.

Tested on the following OS's:
Windows 2012, Windows 2012r2, Windows 2016

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2016-12-20 12:21:24 -08:00
Alin Serdean
35f1085179 appveyor: Update OpenSSL version
OpenSSL version changed from 1.0.2h to 1.0.2j.

This patch bumps the version for the appveyor config.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2016-10-04 08:50:06 -07:00
Alin Serdean
4c8c2c9864 appveyor: Update OpenSSL version
OpenSSL version changed from 1.0.2g to 1.0.2h this patch bumps the
version.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-05-17 19:03:51 -07:00
Alin Serdean
9a4457eabc build windows: Update OpenSSL download link
This patch updates the appveyor dowload link for OpenSSL prebuilt binaries.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-03-23 13:53:15 -07:00
Alin Serdean
26fb1dd85f build windows: Update OpenSSL download link
This patch updates the appveyor dowload link for OpenSSL prebuilt binaries.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2016-02-12 07:37:22 -08:00
Ben Pfaff
808c73b4dd appveyor.yml: Install python "six" module.
It is now required for the build.

Thanks to Alin Gabriel Serdean for helping figure out the correct
solution here.

This adds --diable-pip-version-check because upgrading pip (as
suggested by the error that this option suppresses) causes pip
to fail, which is in turn a bug in pip that manifests only on
Windows: https://github.com/pypa/pip/issues/3383.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2016-01-20 17:27:04 -08:00
Alin Serdean
8f1beba75b Update appveyor OpenSSL link
The link of OpenSSL 1_0_2d is no longer available update it to the current
version.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2016-01-04 07:27:53 -08:00
Alin Serdean
d8ef07e709 appveyor: Renew SSL link.
1_0_2a version not available for download.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-08-28 14:41:36 -07:00
Alin Gabriel Serdean
d183efc22b This commit adds the windows installer to the OVS tree.
Requirements are the following:
Visual Studio Community 2013
WiX Toolset 3.9
Microsoft_VC120_CRT_x86.msm

More detailed information on the requirements and build instructions
can be found under:
https://github.com/cloudbase/ovs-windows-installer/blob/master/README.rst

To run and make the installer issue the following:

./boot.sh
./configure CC=./build-aux/cccl LD="`which link`" \
LIBS="-lws2_32 -liphlpapi" --prefix="C:/openvswitch/usr" \
--localstatedir="C:/openvswitch/var" --sysconfdir="C:/openvswitch/etc" \
--with-pthread="C:/pthread" --with-vstudiotarget="Release"

make clean && make -j16 windows_installer

To uninstall one could use the following Powershell commandlets:
$app = Get-WmiObject -Class Win32_Product | Where-Object `
 { $_.Name -match "Open Vswitch" }

$app.Uninstall()

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Alessandro Pilotti <apilotti@cloudbasesolutions.com>
Signed-off-by: Alessandro Pilotti <apilotti@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-07 14:40:52 -07:00
Gurucharan Shetty
332eafce79 appveyor: Add a newer ssl link.
The older version is no longer available for download.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com>
2015-06-05 14:24:39 -07:00
Alin Serdean
a216c3bd7e Link library updates for appveyor
Add the library iphlpapi to the appveyor.yml build script.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-05 13:16:19 -07:00
Gurucharan Shetty
274231631a appveyor: Build windows kernel datapath.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Nithin Raju <nithin@vmware.com>
2015-02-06 07:34:01 -08:00
Gurucharan Shetty
d8a2492726 appveyor: Provide a autobuild service for Windows.
The appveyor.yml file added through this commit lets
AppVeyor auto build service to run a build of OVS on
Windows platform.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-02-05 11:21:16 -08:00