1 # In the interest of reliability and performance, please avoid installing
2 # external dependencies here, e.g. via tools/*-setup.sh, apt, dnf, or yum.
3 # Do so in the appropriate Dockerfile at
4 # https://gitlab.com/wireshark/wireshark-containers/ instead.
5 # The resulting images can be found at
6 # https://gitlab.com/wireshark/wireshark-containers/container_registry
17 # Ensure that checkouts are a) fast and b) have a reachable tag. In a
18 # brighter, more glorious future we might be able to use --shallow-since:
19 # https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3460
20 # In the mean time, fetching the last 5000 commits does the job.
21 # Ensure that all variables are string
23 GIT_FETCH_EXTRA_FLAGS: "--depth=5000"
24 CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
25 # Enable color output in various tools.
26 # CMake, Ninja, and others: https://bixense.com/clicolors/
32 # Skip irrelevant SAST scanners:
33 SAST_EXCLUDED_ANALYZERS: "brakeman,eslint,security-code-scan,semgrep,spotbugs"
37 # Automatically cancel pipelines if new changes are pushed to a branch
38 # and the job is interruptible. Jobs are not interruptible by default.
39 on_new_commit: interruptible
41 # Scheduled builds additionally set SCHEDULE_TYPE, which can be one of:
42 # - 2x-daily: Twice daily at 07:00 and 19:00 UTC
43 # - daily: Daily at 10:00 UTC
44 # - weekly: Sunday at 14:00 UTC
45 # - coverity-visual-c++: Monday, Wednesday, & Friday at 12:00 UTC
46 # - coverity-gcc: Sunday, Tuesday, Thursday & Saturday at 12:00 UTC
49 # These must currently be including using "!reference tags". "extends:" and
50 # YAML anchors won't work:
51 # https://gitlab.com/gitlab-org/gitlab/-/issues/322992
53 # Commits that have been approved and merged. Run automatically in the main
54 # repo and allow manual runs in the web UI and in forks.
55 # Release builds: CI_PIPELINE_SOURCE=api
57 # Regular commits: CI_PIPELINE_SOURCE=push, CI_COMMIT_BRANCH=master
58 - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
59 # "Run pipeline" button commits, cherry picks
60 - if: '$CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
61 # Tagged release builds: CI_PIPELINE_SOURCE=api (should be "web"?)
62 - if: '$CI_PIPELINE_SOURCE == "api"'
63 - if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_URL !~ /.*gitlab.com\/wireshark\/wireshark/'
65 # Merged commits for runners which are only available in
66 # wireshark/wireshark, e.g. wireshark-windows-*. Run automatically in
67 # the main repo and allow manual runs in the web UI.
69 - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
70 - if: '$CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
71 - if: '$CI_PIPELINE_SOURCE == "api"'
72 # Incoming merge requests.
74 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
76 # Incoming non-detached merge requests. Must be used for runners which are only
77 # available in wireshark/wireshark, e.g. wireshark-windows-*
78 .if-w-w-only-merge-request:
79 - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
81 # Scheduled jobs. Care should be taken when changing this since the scheduler
82 # often doesn't report errors.
84 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "weekly"'
86 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "daily"'
87 .if-2x-daily-schedule:
88 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "2x-daily"'
89 # Fuzz jobs. Care should be taken when changing this since the scheduler
90 # often doesn't report errors.
92 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "fuzz"'
97 - saas-linux-small-amd64
99 - printf "\e[0Ksection_start:%s:ci_env_section[collapsed=true]\r\e[0KCI environment variables" "$(date +%s)"
100 - env | grep ^CI | sort
101 - printf "\e[0Ksection_end:%s:ci_env_section\r\e[0K" "$(date +%s)"
103 - for builddir in build/packaging/rpm/BUILD/wireshark-*/build build/packaging/rpm/BUILD/wireshark-* build obj-*; do [ ! -d "$builddir/run" ] || break; done
104 - if [[ "$CI_JOB_NAME" == "build:rpm-opensuse-"* ]]; then export LD_LIBRARY_PATH=$builddir/run; fi
105 - if [ -f $builddir/run/tshark ]; then $builddir/run/tshark --version; fi
111 - saas-linux-small-amd64
116 extends: .build-linux
117 image: registry.gitlab.com/wireshark/wireshark-containers/ubuntu-dev
119 # https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/
121 # XXX Use ${CI_JOB_NAME}-${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} instead?
122 key: ${CI_JOB_NAME}-master
126 - printf "\e[0Ksection_start:%s:ci_env_section[collapsed=true]\r\e[0KCI environment variables" "$(date +%s)"
127 - env | grep ^CI | sort
128 - printf "\e[0Ksection_end:%s:ci_env_section\r\e[0K" "$(date +%s)"
130 - export LANG=en_US.UTF-8
131 - export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark
133 - ccache --show-stats
134 - export DEB_BUILD_OPTIONS="nocheck parallel=$(( $(getconf _NPROCESSORS_ONLN) + 2 ))"
136 - export MAKEFLAGS=--silent
137 - NUM_COMMITS=$(curl --silent $CI_API_V4_URL/projects/$CI_MERGE_REQUEST_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/commits | jq length)
138 - echo "$NUM_COMMITS commit(s) in this MR"
142 # setcap restricts our library paths
143 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
144 - CFLAGS=-Wl,-rpath=$(pwd)/run CXXFLAGS=-Wl,-rpath=$(pwd)/run cmake -GNinja -DENABLE_CCACHE=ON $CMAKE_ARGS ..
145 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
149 # The cache should be large enough to be useful but it shouldn't take
150 # too long to restore+save each run.
151 - cd "$CI_PROJECT_DIR"
152 - ccache --max-size $( du --total --summarize --block-size=1M *build*/ | awk 'END {printf ("%dM", $1 * 1.5)}' )
155 extends: .build-linux
156 rules: !reference [.if-2x-daily-schedule]
158 # Hack to let ninja make full use of the system on Fedora and Rocky.
159 - export RPM_BUILD_NCPUS=$(( $( getconf _NPROCESSORS_ONLN ) + 2 ))
160 - git config --global user.email "you@example.com"
161 - git config --global user.name "Your Name"
164 - ../tools/make-version.py --set-release ..
165 - mv -v ../wireshark-*.tar.* .
168 - build/packaging/rpm/RPMS
175 rules: !reference [.if-2x-daily-schedule]
181 - if (-Not (Test-Path C:\Development)) { New-Item -Path C:\Development -ItemType "directory" }
182 - $env:WIRESHARK_BASE_DIR = "C:\Development"
183 - $env:Configuration = "RelWithDebInfo"
184 - $env:Path += ";C:\Program Files\CMake\bin"
185 - $env:CMAKE_PREFIX_PATH = "C:\qt\6.8.0\msvc2022_64"
186 # https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
187 - cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat`" && set " | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
188 # Testing / debugging only.
189 # - cmd.exe /c "set CI_PIPELINE_SOURCE"
190 # - cmd.exe /c "set CI_PROJECT_URL"
193 #- $env:path.split(";")
200 # macOS runners are still beta:
201 # https://about.gitlab.com/blog/2021/08/23/build-cloud-for-macos-beta/
202 # https://docs.gitlab.com/ee/ci/runners/saas/macos/environment.html#vm-images
203 # https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/macstadium/orka/-/blob/main/toolchain/monterey.yml
206 tags: [ saas-macos-medium-m1 ] # https://docs.gitlab.com/ee/ci/runners/saas/macos/environment.html
208 # https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/
210 key: ${CI_JOB_NAME}-master
214 HOMEBREW_NO_AUTO_UPDATE: "1"
215 HOMEBREW_DISPLAY_INSTALL_TIMES: "1"
216 HOMEBREW_NO_INSTALL_CLEANUP: "1"
217 HOMEBREW_NO_INSTALL_UPGRADE: "1"
218 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
219 HOMEBREW_NO_UPDATE_REPORT_NEW: "1"
221 - printf "\e[0Ksection_start:%s:ci_env_section[collapsed=true]\r\e[0KCI environment variables" "$(date +%s)"
222 - env | grep ^CI | sort
223 - printf "\e[0Ksection_end:%s:ci_env_section\r\e[0K" "$(date +%s)"
225 - printf "\e[0Ksection_start:%s:brew_section[collapsed=true]\r\e[0KInstalling prerequisites" "$( date +%s)"
226 - ./tools/macos-setup-brew.sh --install-optional --install-test-deps
227 - printf "\e[0Ksection_end:%s:brew_section\r\e[0K" "$( date +%s)"
228 - python3 -m venv $CI_PROJECT_DIR/.venv
229 - source $CI_PROJECT_DIR/.venv/bin/activate
230 - pip3 install pytest pytest-xdist
231 - export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark
233 - ccache --show-stats
237 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
238 - cmake -G Ninja -DENABLE_CCACHE=ON -DTEST_EXTRA_ARGS=--disable-capture ..
239 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
241 - ninja test-programs
242 - pytest --disable-capture
244 # The cache should be large enough to be useful but it shouldn't take
245 # too long to restore+save each run.
246 - ccache --max-size $( gdu --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
251 image: registry.gitlab.com/wireshark/wireshark-containers/mingw-dev
253 - saas-linux-small-amd64
255 # XXX Use ${CI_JOB_NAME}-${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} instead?
256 key: ${CI_JOB_NAME}-master
260 - printf "\e[0Ksection_start:%s:ci_env_section[collapsed=true]\r\e[0KCI environment variables" "$(date +%s)"
261 - env | grep ^CI | sort
262 - printf "\e[0Ksection_end:%s:ci_env_section\r\e[0K" "$(date +%s)"
264 - ccache --show-stats
268 - mingw64-cmake -G Ninja -DENABLE_CCACHE=Yes -DFETCH_lua=Yes ..
271 # The cache should be large enough to be useful but it shouldn't take
272 # too long to restore+save each run.
273 - ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
277 extends: .build-ubuntu
280 - !reference [.if-w-w-only-merged]
281 - !reference [.if-2x-daily-schedule]
283 - ../tools/make-version.py --set-release --version-file=wireshark_version.txt ..
284 - ../tools/update-appdata.py
285 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
286 - cmake -G Ninja $CMAKE_ARGS ..
287 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
289 - build/packaging/source/git-export-release.sh -d .
291 - ninja release_notes
292 - WIRESHARK_VERSION=$(< wireshark_version.txt)
293 - cp -v doc/release-notes.html ../release-notes-${WIRESHARK_VERSION}.html
294 - cp -v doc/release-notes.txt ../release-notes-${WIRESHARK_VERSION}.txt
296 - zstdcat --threads=0 wireshark-${WIRESHARK_VERSION}.tar.zst | xz --threads=0 > wireshark-${WIRESHARK_VERSION}.tar.xz
298 # - ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
299 - if [ "$CI_JOB_STATUS" != "success" ]; then exit 0 ; fi
300 - if [ -n "$SCHEDULE_TYPE" ] ; then exit 0 ; fi
301 - stat --format="%n %s bytes" wireshark-*.tar.*
302 - for digest in sha512 sha256 sha1 ; do openssl $digest wireshark-*.tar.* ; done
303 - if [ -n "$MC_DESTINATION_DIST" ] ; then mc --quiet cp wireshark-*.tar.* "$MC_DESTINATION_DIST/" ; fi
304 - if [ -n "$MC_DESTINATION_RELEASE" ] ; then mc --quiet cp release-notes-*.{txt,html} "$MC_DESTINATION_RELEASE/" ; fi
308 - release-notes-*.html
309 - release-notes-*.txt
311 # Job to generate packages for Debian stable
312 Debian Stable APT Package:
313 extends: .build-linux
314 rules: !reference [.if-2x-daily-schedule]
315 image: registry.gitlab.com/wireshark/wireshark-containers/debian-stable-dev
317 - ln --symbolic --no-dereference --force packaging/debian
318 - tools/make-version.py --set-release .
319 # Shared GitLab runners limit the log size to 4M, so reduce verbosity. See
320 # https://gitlab.com/gitlab-com/support-forum/issues/2790
321 - export DEB_BUILD_OPTIONS="nocheck parallel=$(( $(getconf _NPROCESSORS_ONLN) + 2 ))"
323 - export MAKEFLAGS=--silent
324 - CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ dpkg-buildpackage -b --no-sign -jauto -zfast
325 # Please don't add a Lintian step unless you can guarantee that someone
326 # will fix any breakages that invariably pop up.
327 - mkdir debian-packages
328 - mv -v ../*.deb debian-packages/
331 - debian-packages/*.deb
334 Debian Stable APT Test:
336 rules: !reference [.if-2x-daily-schedule]
337 image: registry.gitlab.com/wireshark/wireshark-containers/debian-stable-dev
340 - DEBIAN_FRONTEND=noninteractive apt-get install ./debian-packages/*.deb -y
344 needs: [ 'Debian Stable APT Package' ]
348 image: registry.gitlab.com/wireshark/wireshark-containers/fedora-dev
350 # Shared GitLab runners limit the log size to 4M, so reduce verbosity. See
351 # https://gitlab.com/gitlab-com/support-forum/issues/2790
352 - export FORCE_CMAKE_NINJA_NON_VERBOSE=1
353 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
355 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
356 - ninja wireshark_rpm
362 # - dnf install -y build/packaging/rpm/RPMS/x86_64/*.rpm
364 # needs: [ 'Fedora RPM Package' ]
366 openSUSE 15.6 RPM Package:
368 image: registry.gitlab.com/wireshark/wireshark-containers/opensuse-15.6-dev
370 - source /gcc-latest.env
371 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
373 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
374 - ninja wireshark_rpm
376 openSUSE 15.6 RPM Test:
378 image: registry.gitlab.com/wireshark/wireshark-containers/opensuse-15.6-dev
380 - zypper --no-gpg-checks --no-remote install -y build/packaging/rpm/RPMS/x86_64/*.rpm
382 needs: [ 'openSUSE 15.6 RPM Package' ]
384 Rocky Linux 9 RPM Package:
386 image: registry.gitlab.com/wireshark/wireshark-containers/rockylinux-9-dev
388 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
389 - cmake -G Ninja -DUSE_qt6=OFF ..
390 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
391 - ninja wireshark_rpm
393 Rocky Linux 9 RPM Test:
395 image: registry.gitlab.com/wireshark/wireshark-containers/rockylinux-9-dev
397 - dnf --nogpgcheck localinstall -y build/packaging/rpm/RPMS/x86_64/*.rpm
399 needs: [ 'Rocky Linux 9 RPM Package' ]
402 extends: .build-ubuntu
403 rules: !reference [.if-2x-daily-schedule]
405 # build-ubuntu puts us in `build`.
407 - ln --symbolic --no-dereference --force packaging/debian
408 - CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ MAKE=ninja dpkg-buildpackage -us -uc -rfakeroot -jauto -zfast
409 # Please don't add a Lintian step unless you can guarantee that someone
410 # will fix any breakages that invariably pop up.
411 - mkdir ubuntu-packages
412 - mv ../*.deb ubuntu-packages/
414 # dpkg-buildpackage builds in obj-<triplet>, so we need to override
415 # .build-ubuntu. We also build more stuff, so decrease our multiplier.
416 - ccache --max-size $( du --summarize --block-size=1M --total "$CI_PROJECT_DIR"/obj-* | awk '/total$/ {printf ("%dM", $1 * 1.25)}' )
419 - ubuntu-packages/*.deb
424 rules: !reference [.if-2x-daily-schedule]
425 image: registry.gitlab.com/wireshark/wireshark-containers/ubuntu-dev
428 - DEBIAN_FRONTEND=noninteractive apt-get install ./ubuntu-packages/*.deb -y
432 needs: [ 'Ubuntu APT Package' ]
435 extends: .build-linux
436 rules: !reference [.if-2x-daily-schedule]
437 image: registry.gitlab.com/wireshark/wireshark-containers/arch-dev
439 - COMMON_PACMAN_ARGS="--sync --refresh --sysupgrade --needed --noconfirm"
440 - ./tools/make-version.py --set-release --version-file=wireshark_version.txt .
441 - WIRESHARK_VERSION=$(cat wireshark_version.txt)
442 - WIRESHARK_PREFIX="/opt/wireshark-$WIRESHARK_VERSION"
443 # There are no falcosecurity/libs or falcosecurity/plugins packages for Arch,
444 # so just build them ourselves for now.
446 # falcosecurity/plugins
447 - pacman $COMMON_PACMAN_ARGS go
448 - git clone https://github.com/falcosecurity/plugins.git falco-plugins
449 - pushd /tmp/falco-plugins/plugins/cloudtrail
452 - pushd /tmp/falco-plugins/plugins/gcpaudit
456 - pacman $COMMON_PACMAN_ARGS uthash libelf onetbb jsoncpp re2
457 - export LDFLAGS=-Wl,-rpath,'$ORIGIN/../lib'
458 - git clone https://github.com/falcosecurity/libs.git falco-libs
460 - git switch -c 0.18.1 0.18.1
461 - printf "\e[0Ksection_start:%s:fslibs_cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
462 - cmake -B build -G Ninja -DBUILD_SHARED_LIBS=on -DMINIMAL_BUILD=on -DBUILD_DRIVER=off -DENABLE_ENGINE_KMOD=off -DBUILD_LIBSCAP_EXAMPLES=off -DUSE_BUNDLED_DEPS=off -DUSE_BUNDLED_VALIJSON=on -DCREATE_TEST_TARGETS=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib' -DCMAKE_INSTALL_PREFIX=$WIRESHARK_PREFIX
463 - printf "\e[0Ksection_end:%s:fslibs_cmake_section\r\e[0K" "$( date +%s)"
465 - ninja -C build install
466 - sed -i -e 's/-linstall_lib_link_libraries-NOTFOUND/-lscap_platform -lscap_platform_util/g' $WIRESHARK_PREFIX/lib/pkgconfig/libscap.pc
468 - export CMAKE_PREFIX_PATH=$WIRESHARK_PREFIX
471 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
472 - cmake -G Ninja -DBUILD_stratoshark=on -DBUILD_sshdig=on -DBUILD_falcodump=on -DFALCO_PLUGINS="/tmp/falco-plugins/plugins/cloudtrail/libcloudtrail.so;/tmp/falco-plugins/plugins/gcpaudit/libgcpaudit.so" -DCMAKE_INSTALL_PREFIX=$WIRESHARK_PREFIX ..
473 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
476 - install -v -D -m 755 -t $WIRESHARK_PREFIX/lib/stratoshark/plugins/4.5/epan run/plugins/4.5/epan/falco-bridge.so
477 - install -v -D -m 755 -t $WIRESHARK_PREFIX/lib/stratoshark/plugins/falco run/plugins/falco/*.so
478 # XXX Need to add an install prereqs script
479 - tar -C / -cJf $CI_PROJECT_DIR/wireshark-arch-$WIRESHARK_VERSION.tar.xz opt/wireshark-$WIRESHARK_VERSION
482 - $CI_PROJECT_DIR/wireshark-arch-*.tar.xz
485 extends: .build-windows
486 rules: !reference [.if-w-w-only-merged]
488 - wireshark-windows-x64-package
490 - $env:WIRESHARK_BASE_DIR = "C:\Development"
491 - $env:Configuration = "RelWithDebInfo"
492 - $env:CMAKE_PREFIX_PATH = "C:\Qt\6.8.0\msvc2022_64"
493 # https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
494 - cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat`" && set" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
498 - C:\Windows\py.exe ..\tools\make-version.py --set-release --version-file=wireshark_version.txt ..
499 - cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off -DBUILD_stratoshark=on -DBUILD_sshdig=on -DBUILD_falcodump=on -DENABLE_SIGNED_NSIS=on ..
500 - msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
501 - msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
502 - msbuild /verbosity:minimal /maxcpucount wireshark_nsis_prep.vcxproj
503 - msbuild /verbosity:minimal /maxcpucount stratoshark_nsis_prep.vcxproj
504 - msbuild /verbosity:minimal /maxcpucount wireshark_wix_prep.vcxproj
505 - C:\gitlab-builds\bin\sign-files.ps1 -Recurse -Path run\RelWithDebInfo
506 - msbuild /verbosity:minimal wireshark_nsis.vcxproj
507 - msbuild /verbosity:minimal stratoshark_nsis.vcxproj
508 # No need for explicit signing of NSIS installer here. The signing is done by makensis.
509 - msbuild /verbosity:minimal wireshark_wix.vcxproj
510 - C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\wix\Wireshark-*.msi
511 - msbuild /verbosity:minimal wireshark_portableapps.vcxproj
512 - C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\portableapps\WiresharkPortable*.exe
513 - $plugins = Get-ChildItem run\RelWithDebInfo\plugins\*\*.dll ; signtool verify /q /pa /all run\RelWithDebInfo\*.exe run\RelWithDebInfo\extcap\wireshark\*.exe $plugins run\RelWithDebInfo\libwireshark.dll run\RelWithDebInfo\libwiretap.dll run\RelWithDebInfo\libwsutil.dll packaging\nsis\Wireshark-*-x64.exe packaging\nsis\Stratoshark-*-x64.exe packaging\wix\Wireshark-*-x64.msi packaging\portableapps\WiresharkPortable??_*.paf.exe
514 - msbuild /verbosity:minimal pdb_zip_package.vcxproj
515 - C:\gitlab-builds\bin\mse-scan.ps1
516 - run\RelWithDebInfo\tshark --version
517 - $packages = Get-ChildItem "packaging\nsis\Wireshark-*-x64.exe", "packaging\nsis\Stratoshark-*-x64.exe", "packaging\wix\Wireshark-*-x64.msi", "packaging\portableapps\WiresharkPortable??_*.paf.exe", "Wireshark-pdb-*x64.zip"
518 - foreach ($package in $packages) { Write-Host $package.name $(Get-Filehash -Algorithm SHA256 $package).Hash $package.length "bytes" }
519 - if (Test-Path env:MC_DESTINATION_WINDOWS_X64) { C:\gitlab-builds\bin\mc --quiet cp $packages "$env:MC_DESTINATION_WINDOWS_X64/" }
520 - $nsisSha256 = (Get-FileHash -Algorithm SHA256 .\packaging\nsis\Wireshark-*-x64.exe).Hash
521 - $wiresharkVersion = Get-Content .\wireshark_version.txt
522 - Set-Content -Path release-info-$($wiresharkVersion)-windows-x64.ini -Value ("[DEFAULT]`nnsis_sha256 = $nsisSha256")
523 - if (Test-Path env:MC_DESTINATION_RELEASE) { C:\gitlab-builds\bin\mc --quiet cp release-info-$($wiresharkVersion)-windows-x64.ini "$env:MC_DESTINATION_RELEASE/" }
524 - C:\Windows\py.exe -m pytest
527 - build/release-info-*.ini
529 Windows Arm64 Package:
530 extends: .build-windows
531 rules: !reference [.if-w-w-only-merged]
533 - wireshark-windows-arm64-package
535 - $env:WIRESHARK_BASE_DIR = "C:\Development"
536 - $env:Configuration = "RelWithDebInfo"
537 - $env:CMAKE_PREFIX_PATH = "C:\Qt\6.8.0\msvc2022_arm64"
538 # https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
539 - cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsarm64.bat`" && set" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
543 - C:\Windows\py.exe ..\tools\make-version.py --set-release --version-file=wireshark_version.txt ..
544 - cmake -G "Visual Studio 17 2022" -A arm64 -DENABLE_LTO=off -DBUILD_stratoshark=on -DBUILD_sshdig=on -DBUILD_falcodump=on -DENABLE_SIGNED_NSIS=on ..
545 - msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
546 - msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
547 - msbuild /verbosity:minimal /maxcpucount wireshark_nsis_prep.vcxproj
548 - msbuild /verbosity:minimal /maxcpucount stratoshark_nsis_prep.vcxproj
549 - C:\gitlab-builds\bin\sign-files.ps1 -Recurse -Path run\RelWithDebInfo
550 - msbuild /verbosity:minimal wireshark_nsis.vcxproj
551 - msbuild /verbosity:minimal stratoshark_nsis.vcxproj
552 - $plugins = Get-ChildItem run\RelWithDebInfo\plugins\*\*.dll ; signtool verify /q /pa /all run\RelWithDebInfo\*.exe run\RelWithDebInfo\extcap\wireshark\*.exe $plugins run\RelWithDebInfo\libwireshark.dll run\RelWithDebInfo\libwiretap.dll run\RelWithDebInfo\libwsutil.dll packaging\nsis\Wireshark-*-arm64.exe packaging\nsis\Stratoshark-*-arm64.exe
553 - msbuild /verbosity:minimal pdb_zip_package.vcxproj
554 - C:\gitlab-builds\bin\mse-scan.ps1
555 - run\RelWithDebInfo\tshark --version
556 - $packages = Get-ChildItem "packaging\nsis\Wireshark-*-arm64.exe", "packaging\nsis\Stratoshark-*-arm64.exe", "Wireshark-pdb-*arm64.zip"
557 - foreach ($package in $packages) { Write-Host $package.name $(Get-Filehash -Algorithm SHA256 $package).Hash $package.length "bytes" }
558 - if (Test-Path env:MC_DESTINATION_WINDOWS_ARM64) { C:\gitlab-builds\bin\mc --quiet cp $packages "$env:MC_DESTINATION_WINDOWS_ARM64/" }
559 - $nsisSha256 = (Get-FileHash -Algorithm SHA256 .\packaging\nsis\Wireshark-*-arm64.exe).Hash
560 - $wiresharkVersion = Get-Content .\wireshark_version.txt
561 - Set-Content -Path release-info-$($wiresharkVersion)-windows-arm64.ini -Value ("[DEFAULT]`nnsis_sha256 = $nsisSha256")
562 - if (Test-Path env:MC_DESTINATION_RELEASE) { C:\gitlab-builds\bin\mc --quiet cp release-info-$($wiresharkVersion)-windows-arm64.ini "$env:MC_DESTINATION_RELEASE/" }
563 - C:\Windows\py.exe -m pytest
566 - build/release-info-*.ini
568 Windows MinGW-w64 Package:
569 extends: .build-mingw
570 rules: !reference [.if-w-w-only-merged]
572 - mingw64-cmake -G Ninja -DENABLE_CCACHE=Yes -DFETCH_lua=Yes ..
574 - ninja user_guide_html
575 - ninja wireshark_nsis_prep
576 - ninja wireshark_nsis
579 - build/packaging/nsis/wireshark-*.exe
584 rules: !reference [.if-w-w-only-merged]
586 CODE_SIGN_IDENTITY: "Wireshark Foundation"
588 - wireshark-macos-arm-package
591 - export CMAKE_PREFIX_PATH=/usr/local/Qt-6.5.3
592 # Not needed for Falco libs 0.19?
593 - export CXXFLAGS="-isystem /usr/local/include/falcosecurity"
594 - export PATH="$PATH:$HOME/bin"
597 - ../tools/make-version.py --set-release --version-file=wireshark_version.txt ..
598 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
599 - cmake -DENABLE_CCACHE=ON -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DBUILD_stratoshark=on -DBUILD_sshdig=on -DBUILD_falcodump=on -DFALCO_PLUGINS=/usr/local/lib/falco-plugins/libcloudtrail.so -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
600 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
603 - security find-identity -v -s "$CODE_SIGN_IDENTITY"
604 - ninja wireshark_dmg
605 - ninja stratoshark_dmg
607 - xcrun notarytool submit Wireshark?[1-9]*.dmg --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" --wait --timeout 10m
608 - xcrun stapler staple Wireshark?[1-9]*.dmg
609 - xcrun notarytool submit Stratoshark?[0-9]*.dmg --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" --wait --timeout 10m
610 - xcrun stapler staple Stratoshark?[0-9]*.dmg
611 - spctl --assess --type open --context context:primary-signature --verbose=2 Wireshark?[1-9]*.dmg Stratoshark?[0-9]*.dmg
612 - stat -f "%N %z bytes" Wireshark*.dmg Stratoshark*.dmg
613 - for digest in sha512 sha256 sha1 ; do openssl $digest Wireshark*.dmg Stratoshark*.dmg ; done
615 if [ -n "$S3_DESTINATION_MACOS_ARM64" ] ; then
616 aws s3 cp Wireshark?[1-9]*Arm*.dmg "$S3_DESTINATION_MACOS_ARM64/"
617 aws s3 cp Wireshark?dSYM*Arm*.dmg "$S3_DESTINATION_MACOS_ARM64/"
618 aws s3 cp Stratoshark?[0-9]*Arm*.dmg "$S3_DESTINATION_MACOS_ARM64/"
619 aws s3 cp Stratoshark?dSYM*Arm*.dmg "$S3_DESTINATION_MACOS_ARM64/"
621 - SPARKLE_SIGNATURE=$( age --decrypt --identity="$MACOS_AGE_IDENTITY" "$MACOS_SPARKLE_BLOB" | /usr/local/Sparkle-2.2.2/bin/sign_update --ed-key-file - Wireshark?[1-9]*.dmg )
622 - $CI_PROJECT_DIR/build/run/tshark --version
623 - DMG_SHA256=$( shasum --algorithm 256 Wireshark?[1-9]*.dmg | awk '{print $1}' )
624 - WIRESHARK_VERSION=$(< ../wireshark_version.txt)
625 - printf '[DEFAULT]\nsparkle_signature = %s\ndmg_sha256 = %s\n' "$SPARKLE_SIGNATURE" "$DMG_SHA256" > release-info-${WIRESHARK_VERSION}-macos-arm64.ini
626 - if [[ -n "$S3_DESTINATION_RELEASE" ]] ; then aws s3 cp release-info-${WIRESHARK_VERSION}-macos-arm64.ini "$S3_DESTINATION_RELEASE/" ; fi
631 - build/run/release-info-*.ini
636 rules: !reference [.if-w-w-only-merged]
638 CODE_SIGN_IDENTITY: "Wireshark Foundation"
640 - wireshark-macos-intel-package
643 - export CMAKE_PREFIX_PATH=/usr/local/Qt-6.5.3
644 # Not needed for Falco libs 0.19?
645 - export CXXFLAGS="-isystem /usr/local/include/falcosecurity"
646 - export PATH="$PATH:$HOME/bin"
649 - ../tools/make-version.py --set-release --version-file=wireshark_version.txt ..
650 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
651 - cmake -DENABLE_CCACHE=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DBUILD_stratoshark=on -DBUILD_sshdig=on -DBUILD_falcodump=on -DFALCO_PLUGINS=/usr/local/lib/falco-plugins/libcloudtrail.so -DTEST_EXTRA_ARGS=--enable-release -G Ninja ..
652 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
655 - security find-identity -v -s "$CODE_SIGN_IDENTITY"
656 - ninja wireshark_dmg
657 - ninja stratoshark_dmg
659 - xcrun notarytool submit Wireshark?[1-9]*.dmg --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" --wait --timeout 10m
660 - xcrun stapler staple Wireshark?[1-9]*.dmg
661 - xcrun notarytool submit Stratoshark?[0-9]*.dmg --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD" --wait --timeout 10m
662 - xcrun stapler staple Stratoshark?[0-9]*.dmg
663 - spctl --assess --type open --context context:primary-signature --verbose=2 Wireshark?[1-9]*.dmg Stratoshark?[0-9]*.dmg
664 - stat -f "%N %z bytes" Wireshark*.dmg Stratoshark*.dmg
665 - for digest in sha512 sha256 sha1 ; do openssl $digest Wireshark*.dmg Stratoshark*.dmg ; done
667 if [ -n "$S3_DESTINATION_MACOS_INTEL64" ] ; then
668 aws s3 cp Wireshark?[1-9]*Intel*.dmg "$S3_DESTINATION_MACOS_INTEL64/"
669 aws s3 cp Wireshark?dSYM*Intel*.dmg "$S3_DESTINATION_MACOS_INTEL64/"
670 aws s3 cp Stratoshark?[0-9]*Intel*.dmg "$S3_DESTINATION_MACOS_INTEL64/"
671 aws s3 cp Stratoshark?dSYM*Intel*.dmg "$S3_DESTINATION_MACOS_INTEL64/"
673 - SPARKLE_SIGNATURE=$( age --decrypt --identity="$MACOS_AGE_IDENTITY" "$MACOS_SPARKLE_BLOB" | /usr/local/Sparkle-2.2.2/bin/sign_update --ed-key-file - Wireshark?[1-9]*.dmg )
674 - $CI_PROJECT_DIR/build/run/tshark --version
675 - DMG_SHA256=$( shasum --algorithm 256 Wireshark?[1-9]*.dmg | awk '{print $1}' )
676 - WIRESHARK_VERSION=$(< ../wireshark_version.txt)
677 - printf '[DEFAULT]\nsparkle_signature = %s\ndmg_sha256 = %s\n' "$SPARKLE_SIGNATURE" "$DMG_SHA256" > release-info-${WIRESHARK_VERSION}-macos-intel64.ini
678 - if [[ -n "$S3_DESTINATION_RELEASE" ]] ; then aws s3 cp release-info-${WIRESHARK_VERSION}-macos-intel64.ini "$S3_DESTINATION_RELEASE/" ; fi
683 - build/run/release-info-*.ini
686 # Build the User's Guide and Developer's Guide
688 extends: .build-linux
689 image: registry.gitlab.com/wireshark/wireshark-containers/ubuntu-dev
691 - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
695 - if: '$CI_PIPELINE_SOURCE == "push"'
699 # XXX We might want to move this to wireshark-ubuntu-dev or debian-setup.sh.
700 - DEBIAN_FRONTEND=noninteractive apt-get update
701 - DEBIAN_FRONTEND=noninteractive apt-get --yes install ruby-asciidoctor-pdf ruby-coderay ruby-dev
702 - NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install asciidoctor-epub3
705 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
707 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
708 - ninja all_guides faq_html
710 - for HTML_DIR in ws[ud]g_html{,_chunked} ; do zip -9 -r "$HTML_DIR.zip" "$HTML_DIR" ; done
712 - if [ -n "$MC_DESTINATION_DOCS" ] ; then mc --quiet cp ws[ud]g_html{,_chunked}.zip Wireshark*Guide.{epub,pdf} faq.html.gz "$MC_DESTINATION_DOCS/" ; fi
713 - mv -v ws[ud]g_html{,_chunked}.zip Wireshark*Guide.{epub,pdf} faq.html.gz ../..
715 - if [ "$CI_JOB_STATUS" != "success" ]; then exit 0 ; fi
719 - wsug_html_chunked.zip
721 - wsdg_html_chunked.zip
722 - "Wireshark User's Guide.pdf"
723 - "Wireshark Developer's Guide.pdf"
724 - "Wireshark User's Guide.epub"
725 - "Wireshark Developer's Guide.epub"
730 # https://docs.gitlab.com/ee/user/gitlab_com/index.html#linux-shared-runners
733 extends: .build-ubuntu
734 rules: !reference [.if-merge-request]
736 GITLAB_REPO: "$CI_MERGE_REQUEST_PROJECT_URL"
738 # build-ubuntu puts us in `build`.
741 # We have the following options for displaying information in a merge request
742 # from a pipleline job:
744 # - The Notes API, which requires a valid GitLab CI_JOB_TOKEN variable, which
745 # isn't available for outside projects:
746 # https://gitlab.com/gitlab-org/gitlab/-/issues/464591.
748 # - Code Quality, which requires extra configuration, using a special container
749 # image, and writing a custom plugin:
750 # https://docs.gitlab.com/ee/ci/testing/code_quality.html.
752 # - Unit test reports, which must be formatted as JUnit XML:
753 # https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html
754 # https://www.ibm.com/docs/en/developer-for-zos/14.2?topic=formats-junit-xml-format
756 # Let's generate a unit test report using tools/wrap-ci-test.py.
757 - REPORT_FILE=commit_checks.xml
758 - TEST_SUITE=commit_checks
760 - ./tools/wrap-ci-test.py --file $REPORT_FILE --suite $TEST_SUITE --case num_commits --command "[ $NUM_COMMITS -lt 2 ] || (echo 'ℹ️ This merge request has more than one commit. Please squash any trivial ones:\n'; git log --oneline --no-decorate --max-count=$NUM_COMMITS ; false)" || true
761 - ./tools/wrap-ci-test.py --file $REPORT_FILE --suite $TEST_SUITE --case tools/pre-commit ./tools/pre-commit $( git log --max-count=$NUM_COMMITS --pretty=format:%h ) || EXIT_CODE=1
762 - ./tools/wrap-ci-test.py --file $REPORT_FILE --suite $TEST_SUITE --case tools/validate-commit ./tools/validate-commit.py $( git log --max-count=$NUM_COMMITS --pretty=format:%h ) || EXIT_CODE=1
763 - ./tools/wrap-ci-test.py --file $REPORT_FILE --suite $TEST_SUITE --case tools/checklicenses ./tools/checklicenses.py || EXIT_CODE=1
764 - ./tools/wrap-ci-test.py --file $REPORT_FILE --suite $TEST_SUITE --case tools/check_help_urls ./tools/check_help_urls.py || EXIT_CODE=1
771 junit: commit_checks.xml
774 extends: .build-ubuntu
775 rules: !reference [.if-merge-request]
779 needs: [ 'Commit Check' ]
781 - source /gcc-latest.env
782 # build-ubuntu puts us in `build`.
784 - mv build "🦈 build 🦈"
786 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
787 # Test release build.
788 - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=on ..
789 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
790 - script --command ninja --flush --quiet --return ../gcc_report.txt
791 - ansi2html < ../gcc_report.txt > ../gcc_report.html
792 - ninja test-programs
794 - if [ -f run/dumpcap ]; then setcap cap_net_raw,cap_net_admin+eip run/dumpcap; fi
795 - if [ -f run/dumpcap ]; then su user -c "run/dumpcap -D" ; fi
796 - su user -c "pytest-3 --junitxml=../ubuntu_tests.xml"
797 # Test CMake install code and CPack config code. Select any one of the archive generators.
798 - ninja user_guide_html
799 - ninja developer_guide_html
801 - ls wireshark-*.tar.zst{,.sha256}
807 junit: ubuntu_tests.xml
810 extends: .build-ubuntu
812 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
816 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
819 needs: [ 'Commit Check' ]
821 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
822 - cmake -G Ninja -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -DUSE_qt6=OFF ..
823 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
828 extends: .build-mingw
829 rules: !reference [.if-merge-request]
830 needs: [ 'Commit Check' ]
833 extends: .build-ubuntu
835 - saas-linux-medium-amd64
836 rules: !reference [.if-merge-request]
837 needs: [ 'Commit Check' ]
839 - source /clang-latest.env
840 - apt-get update && apt-get --yes install python3-venv
841 - python3 -m venv $CI_PROJECT_DIR/.venv
842 - source $CI_PROJECT_DIR/.venv/bin/activate
843 # build-ubuntu puts us in `build`.
846 - ./tools/cppcheck/cppcheck.sh -l $NUM_COMMITS | tee cppcheck/cppcheck_report.txt
847 - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then ./tools/cppcheck/cppcheck.sh -l $NUM_COMMITS -x > cppcheck/cppcheck_report.xml ; fi
848 - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then cppcheck-htmlreport --file cppcheck/cppcheck_report.xml --report-dir cppcheck ; fi
850 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
851 # We don't have an "All options" job, so build fuzzshark and tfshark here.
852 - cmake -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DCMAKE_C_CLANG_TIDY=clang-tidy-$CLANG_VERSION -DCMAKE_CXX_CLANG_TIDY=clang-tidy-$CLANG_VERSION -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_stratoshark=ON -DENABLE_DEBUG=ON -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -G Ninja ..
853 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
854 - printf "\e[0Ksection_start:%s:asn1_section[collapsed=false]\r\e[0KRegenerating ASN.1 dissectors" "$( date +%s)"
856 - git diff --exit-code ${CI_COMMIT_SHA} ..
857 - printf "\e[0Ksection_end:%s:asn1_section\r\e[0K" "$( date +%s)"
858 - printf "\e[0Ksection_start:%s:pidl_section[collapsed=true]\r\e[0KRegenerating PIDL dissectors" "$( date +%s)"
859 - ninja pidl-dissectors
860 - ninja idl2wrs-dissectors
861 - git diff --exit-code ${CI_COMMIT_SHA} ..
862 - printf "\e[0Ksection_end:%s:pidl_section\r\e[0K" "$( date +%s)"
864 - script --command ninja --flush --quiet --return ../tmp_clang_report.txt
865 - ansi2txt < ../tmp_clang_report.txt > ../clang_report.txt
866 - ansi2html < ../tmp_clang_report.txt > ../html/clang_report.html
867 - ./run/tshark -v 2> >(tee ../checkhf_conflict.txt)
868 - ../tools/validate-clang-check.sh -c $CLANG_VERSION 2> >(tee ../tmp_clang_analyzer_check.txt)
869 - ansi2txt < ../tmp_clang_analyzer_check.txt > ../clang_analyzer_check.txt
870 - ansi2html < ../tmp_clang_analyzer_check.txt > ../html/clang_analyzer_check.html
874 - pip3 install pyspellchecker
875 - ./tools/check_spelling.py --no-wikipedia --comments --commits $NUM_COMMITS | tee spelling_check.txt
876 - ./tools/check_typed_item_calls.py --consecutive --label --mask --check-bitmask-fields --commits $NUM_COMMITS | tee item_calls_check.txt
877 - ./tools/check_tfs.py --check-value-strings --commits $NUM_COMMITS | tee tfs_check.txt
878 - ./tools/check_val_to_str.py --commits $NUM_COMMITS | tee val_to_str_check.txt
879 - ./tools/check_col_apis.py --commits $NUM_COMMITS | tee col_apis_check.txt
883 - clang_analyzer_check.txt
886 - item_calls_check.txt
888 - val_to_str_check.txt
890 - checkhf_conflict.txt
894 extends: .build-ubuntu
895 rules: !reference [.if-merge-request]
896 needs: [ 'Commit Check' ]
898 cmake -GNinja -DENABLE_CCACHE=ON \
899 -DENABLE_BROTLI=OFF -DENABLE_CAP=OFF -DENABLE_CHECKHF_CONFLICT=ON -DENABLE_GNUTLS=OFF \
900 -DENABLE_KERBEROS=OFF -DENABLE_LIBXML2=OFF -DENABLE_ILBC=OFF -DENABLE_LUA=OFF -DENABLE_LZ4=OFF \
901 -DENABLE_MINIZIP=OFF -DENABLE_NETLINK=OFF -DENABLE_NGHTTP2=OFF -DENABLE_NGHTTP3=OFF \
902 -DENABLE_BCG729=OFF -DENABLE_OPUS=OFF -DENABLE_PCAP=OFF -DENABLE_PLUGIN_IFDEMO=ON \
903 -DENABLE_PLUGINS=OFF -DENABLE_SBC=OFF -DENABLE_SMI=OFF -DENABLE_SNAPPY=OFF -DENABLE_SPANDSP=OFF \
904 -DENABLE_ZLIB=OFF -DENABLE_ZSTD=OFF -DBUILD_mmdbresolve=OFF ..
907 # Windows runners are still beta, at least technically:
908 # https://docs.gitlab.com/ee/user/gitlab_com/index.html#windows-shared-runners-beta
910 extends: .build-windows
911 rules: !reference [.if-w-w-only-merge-request]
913 - wireshark-windows-merge-req
914 needs: [ 'Commit Check' ]
916 # lib{sinsp,scap} don't support Configuration=Debug, so we can't enable
917 # BUILD_stratoshark or BUILD_falcodump here just yet.
918 - cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off ..
919 - msbuild /verbosity:minimal /maxcpucount /property:Configuration=Debug Wireshark.sln
920 - msbuild /verbosity:minimal /maxcpucount /property:Configuration=Debug test-programs.vcxproj
921 - C:\Windows\py.exe -m pytest --disable-gui --build-type=Debug --junitxml=../windows_tests.xml
925 junit: windows_tests.xml
928 extends: .build-macos
929 rules: !reference [.if-w-w-only-merge-request]
931 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
932 - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CCACHE=ON -DTEST_EXTRA_ARGS=--disable-capture ..
933 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
935 - ninja test-programs
936 - pytest --disable-capture --junitxml=../macos_tests.xml
940 junit: macos_tests.xml
941 needs: [ 'Commit Check' ]
943 # Adapted from https://www.synopsys.com/blogs/software-security/integrating-coverity-scan-with-gitlab-ci/
944 # and https://gitlab.gnome.org/GNOME/glib/-/blob/8f57a5b9/.gitlab-ci.yml#L481
946 image: registry.gitlab.com/wireshark/wireshark-containers/ubuntu-dev
948 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "coverity-gcc"'
954 # cov-build doesn’t handle GLIB_DEPRECATED_ENUMERATOR
955 CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
956 CXXFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
958 - curl --output /tmp/cov-analysis-linux64.tar.gz --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN https://scan.coverity.com/download/linux64
959 - tar --directory=/tmp --extract --gzip --file /tmp/cov-analysis-linux64.tar.gz
963 - /tmp/cov-analysis-linux64-*/bin/cov-build --return-emit-failures --dir ../cov-int ninja
965 - tar --create --gzip --file cov-int.tar.gz cov-int
966 - echo "export ARTIFACT_JOB_URL=$CI_JOB_URL" > job_environment_variables.sh
967 - echo "export GIT_DESCRIPTION=$( git describe --tags )" >> job_environment_variables.sh
971 - job_environment_variables.sh
974 image: curlimages/curl
976 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "coverity-gcc"'
979 - . job_environment_variables.sh
980 - echo $ARTIFACT_JOB_URL
981 - echo $GIT_DESCRIPTION
982 - curl --fail --data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN&email=$GITLAB_USER_EMAIL&url=$ARTIFACT_JOB_URL/artifacts/raw/cov-int.tar.gz&version=$GIT_DESCRIPTION&description=Ubuntu $GIT_DESCRIPTION $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID" https://scan.coverity.com/builds
983 needs: [ 'Coverity GCC Scan' ]
985 Coverity Visual C++ Scan:
986 extends: .build-windows
988 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "coverity-visual-c++"'
990 - wireshark-windows-merge-req
994 - $gitDescription = (( git describe --tags ) | Out-String).Trim()
995 - C:\Windows\System32\curl --output $env:temp\cov-analysis-win64.zip --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN https://scan.coverity.com/download/win64
996 - C:\ProgramData\chocolatey\tools\7z x "$env:temp\cov-analysis-win64.zip" -y -r -o"$env:temp"
997 - cmake -DTEST_EXTRA_ARGS=--enable-release -DENABLE_LTO=off -G "Visual Studio 17 2022" -A x64 ..
998 - $covAnalysisWin64 = (Get-ChildItem -Path $env:temp -Filter "cov-analysis-win64-*" -Directory)[0].FullName
999 - Invoke-Expression "& $covAnalysisWin64\bin\cov-build.exe --return-emit-failures --dir ..\cov-int msbuild /verbosity:minimal `"/consoleloggerparameters:PerformanceSummary;NoSummary`" /maxcpucount:1 Wireshark.sln"
1001 - C:\ProgramData\chocolatey\tools\7z a -tzip cov-int.zip cov-int
1002 - '"export ARTIFACT_JOB_URL=$env:CI_JOB_URL" | Out-File -Encoding ascii job_environment_variables.sh'
1003 - '"export GIT_DESCRIPTION=$gitDescription" | Out-File -Encoding ascii -Append job_environment_variables.sh'
1007 - job_environment_variables.sh
1009 Coverity Visual C++ Submit:
1010 image: curlimages/curl
1012 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "coverity-visual-c++"'
1015 - sed -i -e 's/\r//' job_environment_variables.sh
1016 - . job_environment_variables.sh
1017 - echo $ARTIFACT_JOB_URL
1018 - echo $GIT_DESCRIPTION
1019 - curl --fail --data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN&email=$GITLAB_USER_EMAIL&url=$ARTIFACT_JOB_URL/artifacts/raw/cov-int.zip&version=$GIT_DESCRIPTION&description=Windows $GIT_DESCRIPTION $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID" https://scan.coverity.com/builds
1020 needs: [ 'Coverity Visual C++ Scan' ]
1022 Clang Static Analyzer:
1023 extends: .build-ubuntu
1024 rules: !reference [.if-daily-schedule]
1028 - source /clang-latest.env
1029 - scan-build-${CLANG_VERSION} --exclude tools cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=OFF -G Ninja ..
1030 - scan-build-${CLANG_VERSION} --exclude tools -o ../sbout ninja
1032 - RAW_DIR=$( find ../sbout -type d -name "20??-??-??-*" -printf "%P\n" | head )
1033 - SB_DIR="scan-build-$RAW_DIR"
1034 - mv "$RAW_DIR" "$SB_DIR"
1035 - if [ -d logs ] ; then mv logs $SB_DIR ; fi
1036 - chmod -R u=rwX,go=rX "$SB_DIR"
1037 - zip -9 -r "${SB_DIR}.zip" "$SB_DIR"
1038 - if [ -n "$MC_DESTINATION_ANALYSIS" ] ; then mc --quiet cp "${SB_DIR}.zip" "$MC_DESTINATION_ANALYSIS/" ; fi
1040 # Windows runners are still beta, at least technically:
1041 # https://docs.gitlab.com/ee/user/gitlab_com/index.html#windows-shared-runners-beta
1042 Visual Studio Code Analysis:
1043 extends: .build-windows
1045 - wireshark-windows-dev
1047 # The wireshark-windows-* tags are only available in wireshark/wireshark.
1048 - if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "daily" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
1050 - py -m venv sarif-tools.venv
1051 - sarif-tools.venv\Scripts\pip.exe install sarif-tools
1052 - New-Item -Path C:\MinIO -Type "directory"
1053 - Invoke-Webrequest -OutFile C:\MinIO\mc.exe https://dl.min.io/client/mc/release/windows-amd64/archive/mc.RELEASE.2024-07-03T20-17-25Z
1054 - if ($( Get-FileHash -Algorithm SHA256 -Path C:\MinIO\mc.exe ).Hash -ne "A379139FB32C0ADDB6C05786782602B5106D13402759AC1B4A88285A4D5EAAD3" ) { Exit 1 }
1055 - $env:caexcludepath = "C:\Qt;$env:INCLUDE"
1056 - cmake -DENABLE_CODE_ANALYSIS=ON -G "Visual Studio 17 2022" -A x64 -DENABLE_LTO=off ..
1057 - msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount:2 Wireshark.sln
1058 - $report = "visual-c++-analyze-" + (Get-Date -format "yyyy-MM-dd") + ".html"
1059 - sarif-tools.venv\Scripts\sarif html --output $report
1060 - if (Test-Path env:MC_DESTINATION_ANALYSIS) { C:\MinIO\mc --quiet cp "$report" "$env:MC_DESTINATION_ANALYSIS/" }
1062 # Build all doxygen docs
1064 extends: .build-ubuntu
1065 rules: !reference [.if-daily-schedule]
1067 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
1069 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
1070 - ninja wsar_html_zip 2>&1 > doxygen_output.txt | tee doxygen_errors.txt
1071 - mv wsar_html.zip doxygen_{output,errors}.txt ..
1073 - if [ -n "$MC_DESTINATION_DOCS" ] ; then mc --quiet cp wsar_html.zip "$MC_DESTINATION_DOCS/" ; fi
1075 - if [ "$CI_JOB_STATUS" != "success" ]; then exit 0 ; fi
1078 - doxygen_errors.txt
1079 - doxygen_output.txt
1083 Code Lines and Data:
1084 extends: .build-ubuntu
1085 rules: !reference [.if-daily-schedule]
1088 CLOC_OUT: /tmp/cloc.txt
1089 SCC_OUT: /tmp/scc.txt
1090 SLOC_OUT: /tmp/sloccount.txt
1091 TOKEI_OUT: /tmp/tokei.txt
1093 - DEBIAN_FRONTEND=noninteractive apt-get update
1094 - DEBIAN_FRONTEND=noninteractive apt-get --yes install sloccount cloc curl unzip
1096 - curl -L -O https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip
1097 - unzip scc-3.0.0-x86_64-unknown-linux.zip
1098 - curl -L -O https://github.com/XAMPPRocky/tokei/releases/download/v12.1.2/tokei-x86_64-unknown-linux-gnu.tar.gz
1099 - tar -xf tokei-x86_64-unknown-linux-gnu.tar.gz
1101 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
1103 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
1106 - echo -n "cloc version:\ "
1108 - cloc --quiet . | tee $CLOC_OUT
1109 - /tmp/scc --version
1110 - /tmp/scc --not-match 'qt/.*.ts' . | tee $SCC_OUT
1111 - echo -n "SLOCCount version:\ "
1112 - sloccount --version
1113 - sloccount . | awk "/^Computing results/ { results=1 } { if (results) print }" | tee $SLOC_OUT
1114 - /tmp/tokei --version
1115 - /tmp/tokei --exclude 'qt/*.ts' . | tee $TOKEI_OUT
1118 # This file was generated by TShark $(git describe --tags | sed -e 's/^v//') with the
1119 # command \`tshark -G manuf\`. Its canonical location is
1121 # https://www.wireshark.org/download/automated/data/manuf.gz
1123 # The first column contains the MAC address block (24, 28 or 36 bits wide,
1124 # per IEEE allocation sizes), the second column contains the shortened name
1125 # used by Wireshark for address name resolution and the third column contains the
1126 # full vendor name from the registry.
1129 - build/run/tshark -G manuf | sed -e 's,:00:00:00/24,,' >> manuf
1130 - gzip --best --keep manuf
1131 - if [ -n "$MC_DESTINATION_ANALYSIS" ] ; then mc --quiet cp "$CLOC_OUT" "$SCC_OUT" "$SLOC_OUT" "$TOKEI_OUT" "$MC_DESTINATION_ANALYSIS/" ; fi
1132 - if [ -n "$MC_DESTINATION_DATA" ] ; then mc --quiet cp manuf manuf.gz "$MC_DESTINATION_DATA/" ; fi
1139 # Fuzz TShark using ASAN and valgrind.
1141 extends: .build-ubuntu
1143 rules: !reference [.if-fuzz-schedule]
1145 - wireshark-ubuntu-fuzz
1146 resource_group: fuzz-master
1148 INSTALL_PREFIX: "$CI_PROJECT_DIR/_install"
1152 - source /clang-latest.env
1153 - DEBIAN_FRONTEND=noninteractive apt-get update
1154 # Use DPkg::options::="--force-overwrite" until
1155 # https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-15/+bug/2008755
1156 # https://github.com/llvm/llvm-project/issues/62104
1158 - DEBIAN_FRONTEND=noninteractive apt-get --yes --option DPkg::options::="--force-overwrite" install llvm-$CLANG_VERSION
1164 # The cache should be large enough to be useful but it shouldn't take
1165 # too long to restore+save each run.
1166 - ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
1167 - if [ "$CI_JOB_STATUS" == "canceled" ]; then exit 0 ; fi
1168 - . /tmp/fuzz_result.sh
1169 - if $FUZZ_PASSED ; then exit 0 ; fi
1170 - echo Fuzzing failed. Generating report.
1171 - FUZZ_CAPTURE=$( find /tmp/fuzz -name "fuzz-*.pcap" -o -name "randpkt-*.pcap" | head -n 1 )
1172 - FUZZ_ERRORS="/tmp/fuzz/$( basename "$FUZZ_CAPTURE" .pcap ).err"
1173 - printf "\nfuzz-test.sh stderr:\n" >> "$FUZZ_ERRORS"
1174 - cat fuzz-test.err >> "$FUZZ_ERRORS"
1175 - if [ -n "$MC_DESTINATION_FUZZ" ] ; then mc --quiet cp "$FUZZ_CAPTURE" "$FUZZ_ERRORS" "$MC_DESTINATION_FUZZ/" ; fi
1177 ASan Menagerie Fuzz:
1178 extends: .fuzz-ubuntu
1181 WIRESHARK_LOG_FATAL: "critical"
1183 - MAX_SECONDS=$(( 6 * 60 * 60 ))
1184 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
1185 - cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON -DENABLE_WERROR=Off ..
1186 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
1191 # /var/menagerie contains captures harvested from wireshark.org's mailing list, wiki, issues, etc.
1192 # We have more captures than we can fuzz in $MAX_SECONDS, so we shuffle them each run.
1193 - ./tools/fuzz-test.sh -a -2 -P $MIN_PLUGINS -b $INSTALL_PREFIX/bin -d /tmp/fuzz -t $MAX_SECONDS $( shuf -e /var/menagerie/*/* ) 2> fuzz-test.err || FUZZ_PASSED=false
1194 # Signal after_script, which runs in its own shell.
1195 - echo "export FUZZ_PASSED=$FUZZ_PASSED" > /tmp/fuzz_result.sh
1199 extends: .fuzz-ubuntu
1202 WIRESHARK_LOG_FATAL: "critical"
1204 # XXX Reuse fuzz-asan?
1205 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
1206 - cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON -DENABLE_WERROR=Off ..
1207 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
1212 - ./tools/randpkt-test.sh -a -b $INSTALL_PREFIX/bin -d /tmp/fuzz -p $MAX_PASSES 2> fuzz-test.err || FUZZ_PASSED=false
1213 - echo "export FUZZ_PASSED=$FUZZ_PASSED" > /tmp/fuzz_result.sh
1215 needs: [ 'ASan Menagerie Fuzz' ]
1217 Valgrind Menagerie Fuzz:
1218 extends: .fuzz-ubuntu
1219 stage: fuzz-valgrind
1220 resource_group: fuzz-master-valgrind
1222 # Use DWARF-4 debug info. Valgrind does not support Clang 14 with DWARF-5.
1223 # https://gitlab.com/wireshark/wireshark/-/issues/18191
1224 # https://www.mail-archive.com/valgrind-users@lists.sourceforge.net/msg07239.html
1226 WIRESHARK_LOG_FATAL: "critical"
1228 - DEBIAN_FRONTEND=noninteractive apt-get update
1229 - DEBIAN_FRONTEND=noninteractive apt-get --yes install valgrind
1230 - MAX_SECONDS=$(( 3 * 60 * 60 ))
1231 - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
1232 - cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON -DENABLE_WERROR=Off ..
1233 - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
1238 - ./tools/fuzz-test.sh -g -P $MIN_PLUGINS -b $INSTALL_PREFIX/bin -d /tmp/fuzz -t $MAX_SECONDS $( shuf -e /var/menagerie/*/* ) 2> fuzz-test.err || FUZZ_PASSED=false
1239 - echo "export FUZZ_PASSED=$FUZZ_PASSED" > /tmp/fuzz_result.sh
1241 needs: [ 'ASan randpkt Fuzz' ]
1245 - template: Security/SAST.gitlab-ci.yml