forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from dbosoft/dbosoft-mods
* Windows build for master branch (#8) * merged windows build * Update build-and-test.yml Removed windows steps from build-and-test workflow * Update build-windows.yml rename windows build workflow (no tests active) * fix json inlining (#9) restored ovs upstream json inline * remove pthreads code after build (#10) * improved windows build workflow (#12) * generate artificats for windows * fix install step in windows workflow * copy pthreads * added TargetVersion for Analyze configurations (#11) * Update README.rst * driver branding (#13) * Revert "driver branding (#13)" (#14) This reverts commit 8f437fd. * dbosoft branding (#15) * branding * branding: fixed check for extension * Update build-windows.yml (#16) * fixed version variable (#17) * Build with SSL enabled (#18) - Update build-windows.yml to download openssl - openssl 1.1 renamed libraries * update appveyor openssl download to openssl 1.1 * OpenSSL DLLs are missing in build output (#19) copy DLLs of openssl 1.1 to c:\openvswitch * fix BSOD in kernel driver (#20) In case OVS_KEY_ATTR_IN_PORT is not in netlink attributes a BSOD will occur. * Driver: windows server 2016 compatibility (#21) * lower driver build version for server 2016 * use ExAllocatePoolPriorityUninitialized * Update build-windows.yml * disable SSL build disable ssl to build server issue - cannot find headers * disable parallel build on windows option -j sometimes cause build errors currently
- Loading branch information
Showing
19 changed files
with
282 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -x | ||
|
||
CFLAGS_FOR_OVS="-g -O2" | ||
EXTRA_OPTS="--with-pthread=`realpath ./PTHREADS-BUILT | xargs cygpath -m`" | ||
|
||
function configure_ovs() | ||
{ | ||
./boot.sh | ||
./configure CC="./build-aux/cccl" LD="`which link`" \ | ||
LIBS="-lws2_32 -lShlwapi -liphlpapi -lwbemuuid -lole32 -loleaut32" \ | ||
CFLAGS="${CFLAGS_FOR_OVS}" $* || { cat config.log; exit 1; } | ||
} | ||
|
||
|
||
OPTS="${EXTRA_OPTS} ${OPTS} $*" | ||
configure_ovs $OPTS | ||
make || { cat config.log; exit 1; } | ||
|
||
if [ "$TESTSUITE" ]; then | ||
if ! make check RECHECK=yes; then | ||
# testsuite.log is necessary for debugging. | ||
cat ./tests/testsuite.log | ||
exit 1 | ||
fi | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
# clone and build pthreads4w | ||
git clone https://git.code.sf.net/p/pthreads4w/code pthreads4w-code | ||
cd pthreads4w-code | ||
nmake all install | ||
cd .. | ||
rm -rf pthreads4w-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Build for Windows | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-windows: | ||
name: windows ${{ join(matrix.*, ' ') }} | ||
env: | ||
OPTS: --with-vstudiotarget=${{ matrix.target }} --with-vstudiotargetver=Win10 --prefix=C:/openvswitch/usr --localstatedir=C:/ProgramData/openvswitch/var --sysconfdir=C:/ProgramData/openvswitch/etc --disable-ssl ${{ matrix.opts }} | ||
TESTSUITE: ${{ matrix.testsuite }} | ||
|
||
runs-on: windows-latest | ||
timeout-minutes: 60 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# run only one job for windows, as more than one be enough currently to verify | ||
# PRs | ||
# tests are not enabled as they take very long and a lot of them will fail | ||
- target: Release | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: install msys | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: UCRT64 | ||
update: true | ||
install: base-devel git mingw-w64-ucrt-x86_64-toolchain autotools | ||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
# pypiwin32 has to be installed with a Windows python version therefore | ||
# this step will configure python first on Windows and exports | ||
# its location for MSYS bash. | ||
- name: configure python in Windows cmdline | ||
shell: cmd | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pypiwin32 | ||
echo export pythonLocation="%pythonLocation%" > %RUNNER_TEMP%\msys64\home\%USERNAME%\.pythonenv.sh | ||
echo export PYTHONPATH="%pythonLocation%\Lib;%pythonLocation%\DLLs;%pythonLocation%\Lib\lib-tk" >> %RUNNER_TEMP%\msys64\home\%USERNAME%\.pythonenv.sh | ||
echo ".pythonenv.sh was generated in %RUNNER_TEMP%\msys64\home\%USERNAME%" | ||
- name: generate Visual Studio environment | ||
shell: cmd | ||
run: | | ||
powershell -c ./build-aux/envdiff.ps1 | ||
@call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
powershell -c ./build-aux/envdiff.ps1 > %RUNNER_TEMP%\msys64\home\%USERNAME%\.visualstudio.sh | ||
echo ".visualstudio.sh was generated in %RUNNER_TEMP%\msys64\home\%USERNAME%" | ||
- name: configure python for MSYS | ||
run: | | ||
source ~/.pythonenv.sh | ||
echo "using python from path $pythonLocation" | ||
mv /ucrt64/bin/python /ucrt64/bin/python_off | ||
mv /ucrt64/bin/python3 /ucrt64/bin/python3_off | ||
ln -s "$pythonLocation\python" /ucrt64/bin/python3 | ||
- name: prepare | ||
run: | | ||
[[ -f /usr/bin/link ]] && mv /usr/bin/link /usr/bin/link_off | ||
source ~/.visualstudio.sh | ||
./.ci/windows-prepare.sh | ||
- name: build | ||
run: | | ||
source ~/.visualstudio.sh | ||
source ~/.pythonenv.sh | ||
echo $PYTHONPATH | ||
./.ci/windows-build.sh | ||
- name: upload logs on failure | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: logs-windows-${{ join(matrix.*, '-') }} | ||
path: config.log | ||
- name: install | ||
run: | | ||
source ~/.visualstudio.sh | ||
source ~/.pythonenv.sh | ||
make install | ||
cp ./PTHREADS-BUILT/bin/pthreadVC3.dll /C/openvswitch/usr/sbin | ||
cp ./PTHREADS-BUILT/bin/pthreadVC3.dll /C/openvswitch/usr/bin | ||
mkdir /C/openvswitch/driver | ||
cp ./datapath-windows/x64/Win10${{ matrix.target }}/package/* /C/openvswitch/driver | ||
cp ./datapath-windows/x64/Win10${{ matrix.target }}/package.cer /C/openvswitch/driver | ||
cp ./datapath-windows/misc/* /C/openvswitch/driver | ||
cp ./datapath-windows/ovsext/x64/Win10${{ matrix.target }}/DBO_OVSE.pdb /C/openvswitch/driver | ||
- name: upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: openvswitch-windows-${{ join(matrix.*, '-') }} | ||
path: c:\openvswitch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# script to export windows environment variables to bash shell | ||
# This is useful to create bash environments from vcvars64.bat | ||
# based on the solution from this article https://anadoxin.org/blog/bringing-visual-studio-compiler-into-msys2-environment.html/ | ||
|
||
if((Test-Path "snapshot.env") -eq $false){ | ||
|
||
Get-ChildItem env: | Select-Object Key,Value | ConvertTo-Json | Set-Content "snapshot.env" | ||
Write-Host "Stored snapshot.env" | ||
return | ||
} | ||
|
||
$snapshotEnv = Get-Content "snapshot.env" | ConvertFrom-Json | ||
|
||
foreach($e in Get-ChildItem env:){ | ||
if($e.Key -contains '/') { | ||
# Sometimes Windows uses environment variables like i.e. | ||
# ProgramFiles(x86)=c:\... | ||
# but let's just skip this. | ||
continue; | ||
} | ||
$key = $e.Key | ||
$keyUpperCase = $e.Key.ToUpperInvariant() | ||
|
||
if($keyUpperCase -eq "PATH") { | ||
$path = $e.Value.Replace("c:", "/c").Replace("C:", "/c").Replace("\", "/").Replace(";", ":") | ||
Write-Output "export PATH=""`$PATH:$path""" | ||
continue | ||
} | ||
$valueEscaped = $e.value.replace("\", "\\"); | ||
|
||
$snapShotEntry = $snapshotEnv | Where-Object -Property Key -eq $key | Select-Object -First 1 | ||
|
||
if($null -ne $snapShotEntry){ | ||
Write-Output "# debug: key=$keyUpperCase" | ||
$oldValue = $snapShotEntry.Value | ||
if($oldValue -ne $e.Value) { | ||
Write-Output "export $key=""$valueEscaped"" #changed" | ||
} | ||
} | ||
else{ | ||
Write-Output "export $key=""$valueEscaped"" #new" | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.