Skip to content

Commit 8d3f9ae

Browse files
committed
FIXED: Windows MTL build system, update msys2_build.yml
FIXED: Windows MTL build system, update msys2_build.yml - added mandatory fixes fot windows build to work with DPDK - run all build cases using mingw64 environemnt - minor fixes to the code due to build failing UPADTE: updated to allow msys2_build.yml to use github hosted runner and set runner OS version to all 3 available windowses. Signed-off-by: Milosz Linkiewicz <milosz.linkiewicz@intel.com>
1 parent 40ff2c3 commit 8d3f9ae

File tree

5 files changed

+72
-55
lines changed

5 files changed

+72
-55
lines changed

.github/workflows/msys2_build.yml

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ on:
44
# allow manually trigger
55
workflow_dispatch:
66

7-
env:
8-
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
9-
# see https://github.com/msys2/MINGW-packages/issues/11864 and
10-
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
11-
MSYS: winjitdebug
12-
137
permissions:
148
contents: read
159

@@ -22,7 +16,7 @@ jobs:
2216
changed: ${{ steps.filter.outputs.msys2_build == 'true' }}
2317
steps:
2418
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25-
19+
2620
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
2721
id: filter
2822
with:
@@ -31,14 +25,16 @@ jobs:
3125
build:
3226
needs: changes
3327
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
34-
runs-on: windows-latest
28+
runs-on: ${{ matrix.win-ver }}
3529
strategy:
3630
fail-fast: false
3731
matrix:
38-
sys:
39-
- mingw64
40-
- ucrt64
41-
dpdk: [23.11, 23.07]
32+
include:
33+
- { sys: "mingw64", env: "x86_64", dpdk: "23.11", win-ver: "windows-2019" }
34+
- { sys: "mingw64", env: "x86_64", dpdk: "23.11", win-ver: "windows-2022" }
35+
- { sys: "mingw64", env: "x86_64", dpdk: "23.11", win-ver: "windows-2025" }
36+
# - { sys: "ucrt64", env: "ucrt-x86_64", dpdk: "23.11", win-ver: "windows-2022" }
37+
# - { sys: "clang64", env: "clang-x86_64", dpdk: "23.11", win-ver: "windows-2022" }
4238
defaults:
4339
run:
4440
shell: msys2 {0}
@@ -48,34 +44,49 @@ jobs:
4844
with:
4945
egress-policy: audit
5046

51-
- name: Install dependencies
47+
- name: Install msys2 dependencies
5248
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff # v2
5349
with:
54-
msystem: ${{ matrix.sys }}
50+
msystem: ${{matrix.sys}}
5551
update: true
5652
install: >-
57-
git
58-
base-devel
59-
unzip
53+
mingw-w64-${{matrix.env}}-openssl
54+
mingw-w64-${{matrix.env}}-gcc
55+
mingw-w64-${{matrix.env}}-autotools
56+
mingw-w64-${{matrix.env}}-cmake
57+
mingw-w64-${{matrix.env}}-make
58+
mingw-w64-${{matrix.env}}-ninja
59+
git
60+
base-devel
61+
unzip
62+
pactoys
6063
pacboy: >-
61-
pkgconf:p
62-
openssl:p
63-
gcc:p
64-
meson:p
65-
json-c:p
66-
libpcap:p
67-
gtest:p
68-
SDL2:p
69-
SDL2_ttf:p
70-
dlfcn:p
64+
toolchain:p
65+
pkgconf:p
66+
meson:p
67+
json-c:p
68+
libpcap:p
69+
gtest:p
70+
SDL2:p
71+
SDL2_ttf:p
72+
dlfcn:p
73+
74+
- name: Setup Python3 action
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: '3.13'
78+
79+
- name: Setup Python3 pip install action
80+
shell: cmd
81+
run: python3 -m pip install meson==1.7.2 ninja
7182

7283
- name: Install npcap-sdk
7384
run: |
7485
wget https://nmap.org/npcap/dist/npcap-sdk-1.12.zip
7586
unzip -d npcap-sdk npcap-sdk-1.12.zip
7687
cp npcap-sdk/Lib/x64/* ${MSYSTEM_PREFIX}/lib/
7788
78-
- name: Checkout IMTL code
89+
- name: Checkout MTL code
7990
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8091

8192
- name: Checkout mman-win32 code
@@ -130,29 +141,34 @@ jobs:
130141
git am ../patches/dpdk/${{matrix.dpdk}}/*.patch
131142
git am ../patches/dpdk/${{matrix.dpdk}}/windows/*.patch
132143
133-
- name: Build and install DPDK
144+
- name: Configure
134145
if: ${{ steps.cache-dpdk.outputs.cache-hit != 'true' }}
146+
shell: bash
135147
run: |
136148
cd dpdk
137-
meson setup build -Dplatform=generic
138-
meson install -C build
139-
140-
- name: Install cached DPDK
141-
if: ${{ steps.cache-dpdk.outputs.cache-hit == 'true' }}
149+
meson setup build
150+
meson compile -C build
151+
# export CMAKE_INSTALL_PREFIX="${MSYSTEM_PREFIX}"
152+
# CC=gcc CXX=g++ meson setup build --buildtype release
153+
# CC=gcc CXX=g++ meson compile -C build
154+
# DESTDIR="${MSYSTEM_PREFIX}" CC=gcc CXX=g++ ninja -C build install
155+
156+
- name: Install cached DPDK dependencies
142157
run: |
143158
cd dpdk
144-
meson install -C build --no-rebuild
159+
DESTDIR="${MSYSTEM_PREFIX}" meson install -C build --no-rebuild
145160
146-
- name: Build
147-
run: |
148-
./build.sh
161+
- name: Build MTL
162+
run: CMAKE_INSTALL_PREFIX="${MSYSTEM_PREFIX}" ./build.sh
149163

150164
- name: Build with debug
151165
run: |
166+
export CMAKE_INSTALL_PREFIX="${MSYSTEM_PREFIX}"
152167
rm build -rf
153168
./build.sh debugonly
154169
155170
- name: Build with TAP
156171
run: |
172+
export CMAKE_INSTALL_PREFIX="${MSYSTEM_PREFIX}"
157173
meson setup tap_build -Denable_tap=true
158174
meson install -C tap_build

.github/workflows/windows_build_with_gtest.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ name: win_gtest
33
on:
44
# allow manually trigger
55
workflow_dispatch:
6-
push:
7-
branches:
8-
- main
9-
- 'maint-**'
10-
pull_request:
11-
branches:
12-
- main
13-
- 'maint-**'
146

157
concurrency:
168
group: win-${{ github.head_ref || github.run_id }}
@@ -36,7 +28,7 @@ jobs:
3628
changed: ${{ steps.filter.outputs.windows_gtest == 'true' }}
3729
steps:
3830
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39-
31+
4032
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
4133
id: filter
4234
with:
@@ -45,17 +37,23 @@ jobs:
4537
Build_and_Test:
4638
needs: changes
4739
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
48-
runs-on: [Windows, self-hosted]
40+
runs-on: windows-2019
4941
timeout-minutes: 60
5042
defaults:
5143
run:
52-
shell: C:\msys64\msys2.cmd {0}
44+
shell: msys2.cmd {0}
5345
steps:
5446
- name: Harden Runner
5547
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
5648
with:
5749
egress-policy: audit
5850

51+
- name: Set up MSYS2
52+
uses: msys2/setup-msys2@v2
53+
with:
54+
msystem: UCRT64
55+
update: true
56+
5957
- name: Update dependencies
6058
run: |
6159
pacman --noconfirm -Syuu
@@ -79,12 +77,12 @@ jobs:
7977
ref: v${{ env.DPDK_VERSION }}
8078
path: dpdk
8179
clean: true
82-
80+
8381
- name: Apply patches for DPDK
8482
run: |
8583
cd dpdk
86-
git config user.name github-actions
87-
git config user.email github-actions@github.com
84+
"C:\Program Files\Git\bin\git.exe" config user.name github-actions
85+
"C:\Program Files\Git\bin\git.exe" config user.email github-actions@github.com
8886
for f in ../patches/dpdk/${{ env.DPDK_VERSION }}/*.patch; do patch -p1 < "$f"; done
8987
for f in ../patches/dpdk/${{ env.DPDK_VERSION }}/windows/*.patch; do patch -p1 < "$f"; done
9088

lib/src/mt_tap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,15 @@ static struct rte_flow* tap_create_flow(struct mt_cni_impl* cni, uint16_t port_i
366366
action[1].type = RTE_FLOW_ACTION_TYPE_END;
367367
memset(pkt_buf, 0, sizeof(pkt_buf));
368368
memset(msk_buf, 0, sizeof(msk_buf));
369-
snprintf(pkt_buf, 84, "%s",
369+
snprintf(pkt_buf, 85, "%s",
370370
"00000000000100000000000208060001080006040000000000000001010101010000000000020"
371371
"2020202");
372-
snprintf(pkt_buf, 12, "%02x%02x%02x%02x%02x%02x", tap_ctx->mac_addr.addr_bytes[0],
372+
snprintf(pkt_buf, 13, "%02x%02x%02x%02x%02x%02x", tap_ctx->mac_addr.addr_bytes[0],
373373
tap_ctx->mac_addr.addr_bytes[1], tap_ctx->mac_addr.addr_bytes[2],
374374
tap_ctx->mac_addr.addr_bytes[3], tap_ctx->mac_addr.addr_bytes[4],
375375
tap_ctx->mac_addr.addr_bytes[5]);
376376
info("Flow bind to mac address %12.12s \n", pkt_buf);
377-
snprintf(msk_buf, 84, "%s",
377+
snprintf(msk_buf, 85, "%s",
378378
"FFFFFFFFFFFF000000000000FFFF0000000000000000000000000000000000000000000000000"
379379
"0000000");
380380
memset(pattern, 0, sizeof(pattern));

tests/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ test_cpp_args += ['-Wvla']
5151
if is_windows
5252
test_c_args += ['-DWINDOWSENV']
5353
test_cpp_args += ['-DWINDOWSENV']
54+
test_c_args += ['-I' + '..\..\lib\windows']
5455
ws2_32_dep = cpp_c.find_library('ws2_32', required: true)
5556
else
5657
ws2_32_dep = [] # add this when the code uses hton/ntoh

tests/tools/RxTxApp/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ app_c_args += ['-Wunused-parameter']
6363
if is_windows
6464
app_c_args += ['-DWINDOWSENV']
6565
windows_include_dir = '..\..\lib\windows'
66+
windows_include_dir_2 = '..\..\..\..\lib\windows'
6667
app_c_args += ['-I' + windows_include_dir]
68+
app_c_args += ['-I' + windows_include_dir_2]
6769
endif
6870

6971
# simd build option, enable sse4.2 default, todo: do we need AVX2/AVX512 for app ?

0 commit comments

Comments
 (0)