2020-12-09 21:23:24 +00:00
|
|
|
# In the interest of reliability and performance, please avoid installing
|
|
|
|
# external dependencies here, e.g. via tools/*-setup.sh, apt, dnf, or yum.
|
|
|
|
# Do so in the appropriate Dockerfile at
|
|
|
|
# https://gitlab.com/wireshark/wireshark-containers/ instead.
|
|
|
|
# The resulting images can be found at
|
|
|
|
# https://hub.docker.com/r/wireshark/wireshark-centos-7-dev
|
|
|
|
# https://hub.docker.com/r/wireshark/wireshark-debian-stable-dev
|
|
|
|
# https://hub.docker.com/r/wireshark/wireshark-fedora-dev
|
|
|
|
# https://hub.docker.com/r/wireshark/wireshark-opensuse-15.1-dev
|
|
|
|
# https://hub.docker.com/r/wireshark/wireshark-ubuntu-dev
|
|
|
|
|
2021-05-07 19:43:16 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- fuzz-asan
|
|
|
|
- fuzz-randpkt
|
|
|
|
- fuzz-valgrind
|
|
|
|
|
2021-05-04 22:36:22 +00:00
|
|
|
variables:
|
|
|
|
# Ensure that checkouts are a) fast and b) have a reachable tag. In a
|
|
|
|
# brighter, more glorious future we might be able to use --shallow-since:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3460
|
|
|
|
# In the mean time, fetching the last 2000 commits does the job.
|
|
|
|
GIT_DEPTH: "1"
|
|
|
|
GIT_FETCH_EXTRA_FLAGS: "--depth=2000"
|
|
|
|
CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
|
2021-05-08 16:30:33 +00:00
|
|
|
CLANG_VERSION: 10
|
2021-05-04 22:36:22 +00:00
|
|
|
|
|
|
|
# Common rule stanzas
|
|
|
|
# These must currently be including using "!reference tags". "extends:" and
|
|
|
|
# YAML anchors won't work:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/322992
|
|
|
|
#
|
|
|
|
# Commits that have been approved and merged. Run automatically in the main
|
2021-05-07 18:49:51 +00:00
|
|
|
# repo and allow manual runs in the web UI and in forks.
|
2021-05-04 22:36:22 +00:00
|
|
|
.if-merged:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
|
|
|
|
when: always
|
2021-05-07 18:49:51 +00:00
|
|
|
- if: '$CI_PIPELINE_SOURCE == "web"'
|
|
|
|
when: always
|
2021-05-04 22:36:22 +00:00
|
|
|
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_URL !~ /.*gitlab.com\/wireshark\/wireshark/'
|
|
|
|
when: manual
|
|
|
|
# Incoming merge requests.
|
|
|
|
.if-merge-request:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
|
|
when: always
|
|
|
|
# Incoming non-detached merge requests. Must be used for runners which are only
|
|
|
|
# available in wireshark/wireshark, e.g. wireshark-windows-*
|
|
|
|
.if-attached-merge-request:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
|
|
|
|
when: always
|
2021-05-07 19:43:16 +00:00
|
|
|
# Fuzz jobs. Care should be taken when changing this since the scheduler
|
|
|
|
# often doesn't report errors.
|
|
|
|
.if-fuzz-schedule:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "fuzz"'
|
|
|
|
when: always
|
2021-05-04 22:36:22 +00:00
|
|
|
|
|
|
|
.build:
|
2019-04-10 10:52:52 +00:00
|
|
|
stage: build
|
|
|
|
after_script:
|
2020-03-11 22:18:21 +00:00
|
|
|
- for builddir in build/packaging/rpm/BUILD/wireshark-*/build build/packaging/rpm/BUILD/wireshark-* build obj-*; do [ ! -d "$builddir/run" ] || break; done
|
|
|
|
- if [[ "$CI_JOB_NAME" == "build:rpm-opensuse-"* ]]; then export LD_LIBRARY_PATH=$builddir/run; fi
|
2019-04-10 10:52:52 +00:00
|
|
|
- if [ -f $builddir/run/tshark ]; then $builddir/run/tshark --version; fi
|
2019-05-04 21:02:33 +00:00
|
|
|
|
2021-05-04 22:36:22 +00:00
|
|
|
.build-ubuntu:
|
|
|
|
extends: .build
|
2019-05-04 21:02:33 +00:00
|
|
|
image: wireshark/wireshark-ubuntu-dev
|
2018-06-08 08:36:16 +00:00
|
|
|
retry: 1
|
2020-09-01 21:41:02 +00:00
|
|
|
# https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/
|
|
|
|
cache:
|
|
|
|
# XXX Use ${CI_JOB_NAME}-${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} instead?
|
2020-10-22 18:17:13 +00:00
|
|
|
key: ${CI_JOB_NAME}-release-3.4
|
2020-09-01 21:41:02 +00:00
|
|
|
paths:
|
|
|
|
- ccache/
|
2018-06-08 08:36:16 +00:00
|
|
|
before_script:
|
2019-04-12 14:32:32 +00:00
|
|
|
- useradd user
|
|
|
|
- locale-gen en_US.UTF-8
|
|
|
|
- export LANG=en_US.UTF-8
|
|
|
|
- export PYTEST_ADDOPTS=--skip-missing-programs=dumpcap,rawshark
|
2020-09-01 21:41:02 +00:00
|
|
|
- mkdir -p ccache
|
|
|
|
- export CCACHE_BASEDIR=${PWD}
|
|
|
|
- ccache --show-stats
|
|
|
|
- export DEB_BUILD_OPTIONS=nocheck
|
2020-09-09 20:20:46 +00:00
|
|
|
- export DH_QUIET=1
|
|
|
|
- export MAKEFLAGS=--silent
|
2018-06-08 08:36:16 +00:00
|
|
|
- mkdir build
|
|
|
|
- cd build
|
2019-05-12 20:33:34 +00:00
|
|
|
script:
|
2020-12-09 17:13:42 +00:00
|
|
|
# setcap restricts our library paths
|
2021-06-02 19:48:56 +00:00
|
|
|
- CFLAGS=-Wl,-rpath=$(pwd)/run CXXFLAGS=-Wl,-rpath=$(pwd)/run cmake -GNinja -DENABLE_CCACHE=ON ..
|
2019-05-12 20:33:34 +00:00
|
|
|
- ninja
|
|
|
|
- ninja test-programs
|
|
|
|
- chown -R user .
|
2019-05-13 07:06:35 +00:00
|
|
|
- if [ -f run/dumpcap ]; then setcap cap_net_raw,cap_net_admin+eip run/dumpcap; fi
|
2020-12-09 17:13:42 +00:00
|
|
|
- if [ -f run/dumpcap ]; then su user -c "run/dumpcap -D" ; fi
|
2019-05-12 20:33:34 +00:00
|
|
|
- su user -c pytest-3
|
|
|
|
|
2021-05-04 22:36:22 +00:00
|
|
|
.build-rpm:
|
|
|
|
extends: .build
|
|
|
|
rules: !reference [.if-merged]
|
2019-01-17 09:13:09 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- build/packaging/rpm/RPMS
|
|
|
|
expire_in: 3 days
|
2019-05-12 20:33:34 +00:00
|
|
|
|
2021-05-04 22:36:22 +00:00
|
|
|
.test-rpm:
|
|
|
|
rules: !reference [.if-merged]
|
|
|
|
stage: test
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
|
gitlab-ci: remove unnecessary jobs, upgrade versions
The point of testing multiple compiler versions is to catch bugs that
only occur in one particular version. After an analysis of 800+ failed
builds, it appears that a lot of the checks are redundant. Changes:
* Drop GCC 6 and keep GCC 5, Ubuntu 16.04 default GCC is 5.3. Fixes for
warnings in old compilers: commit 829d2c3752 (GCC 5 + 6), commit
e451ea0a4d (Clang 5, GCC 4 + 5). Maybe GCC 5 can also be dropped since
Ubuntu 18.04 is around for a while.
* Drop clang-nopcap, all errors caught by Clang were also caught by GCC.
One change caught by gcc-8-nopcap but not Clang: commit 036c3d6bc7.
* Remove Clang 5: even though it triggers some unique failures, no major
distro ships with it so remove it.
* Drop old Clang versions, newer versions catch all warnings from older.
* Upgrade to Clang 8 which is already installed in the Docker image.
* Remove EOL Fedora 28 and 29, use latest (31).
* Remove EOL openSUSE Leap 42.3, keep 15.1 as the latest.
Reduces from 20 jobs (15 build, 5 test) to 10 jobs (7 build, 3 test).
Change-Id: I4a355dd1a90cbbef9525bd63a8544fa3e22369a2
Reviewed-on: https://code.wireshark.org/review/36281
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-05 01:54:04 +00:00
|
|
|
# Rely on fedora:latest and debian-stable jobs for testing a recent GCC version.
|
2021-05-07 19:48:31 +00:00
|
|
|
Clang 10:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-merged]
|
2019-05-12 20:33:34 +00:00
|
|
|
variables:
|
2021-05-08 16:30:33 +00:00
|
|
|
CC: "clang-$CLANG_VERSION"
|
|
|
|
CXX: "clang++-$CLANG_VERSION"
|
2021-03-10 21:15:15 +00:00
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
Source Package:
|
2020-12-22 00:05:27 +00:00
|
|
|
extends: .build-ubuntu
|
2021-05-04 22:36:22 +00:00
|
|
|
rules: !reference [.if-merged]
|
2020-12-22 00:05:27 +00:00
|
|
|
script:
|
|
|
|
- perl ../tools/make-version.pl --set-release || ../perl make-version.pl --set-release
|
|
|
|
- cmake -G Ninja $CMAKE_ARGS -DENABLE_CCACHE=ON ..
|
2020-12-22 10:59:00 +00:00
|
|
|
- cd $CI_PROJECT_DIR
|
|
|
|
- build/packaging/source/git-export-release.sh -d .
|
2020-12-22 00:05:27 +00:00
|
|
|
after_script:
|
|
|
|
# - ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
|
|
|
|
- for digest in sha256 rmd160 sha1 ; do openssl $digest wireshark-*.tar.* ; done
|
|
|
|
# This will break if we produce multiple tarballs, which is arguably a good thing.
|
|
|
|
- if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ] && [ -n "$S3_DESTINATION_DIST" ] ; then aws s3 cp wireshark-*.tar.* "$S3_DESTINATION_DIST/" ; fi
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- wireshark-*.tar.*
|
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
CentOS 7 RPM Package:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-rpm
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-centos-7-dev
|
2018-06-08 09:49:50 +00:00
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmake3 -GNinja ..
|
|
|
|
- ninja-build rpm-package
|
2021-05-07 19:48:31 +00:00
|
|
|
CentOS 7 RPM Test:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .test-rpm
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-centos-7-dev
|
2019-04-10 10:52:52 +00:00
|
|
|
script:
|
|
|
|
- yum --nogpgcheck localinstall -y build/packaging/rpm/RPMS/x86_64/*.rpm
|
|
|
|
- tshark --version
|
2021-05-07 19:48:31 +00:00
|
|
|
dependencies: [ 'CentOS 7 RPM Package' ]
|
2021-05-04 22:36:22 +00:00
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
openSUSE 15.1 RPM Package:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-rpm
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-opensuse-15.1-dev
|
2018-06-08 11:53:24 +00:00
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
2019-01-17 13:08:07 +00:00
|
|
|
- cmake -GNinja ..
|
|
|
|
- ninja rpm-package
|
2021-05-07 19:48:31 +00:00
|
|
|
openSUSE 15.1 RPM Test:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .test-rpm
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-opensuse-15.1-dev
|
2019-04-10 10:52:52 +00:00
|
|
|
script:
|
|
|
|
- zypper --no-gpg-checks install -y build/packaging/rpm/RPMS/x86_64/*.rpm
|
|
|
|
- tshark --version
|
2021-05-07 19:48:31 +00:00
|
|
|
dependencies: [ 'openSUSE 15.1 RPM Package' ]
|
2020-10-27 17:09:40 +00:00
|
|
|
|
|
|
|
# Disabled for now due to issues with Fedora 33.
|
2021-05-07 19:48:31 +00:00
|
|
|
.Fedora RPM Package:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-rpm
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-fedora-dev
|
2018-06-17 21:01:01 +00:00
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmake3 -GNinja ..
|
|
|
|
- ninja-build rpm-package
|
2020-10-27 17:09:40 +00:00
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
# .Fedora RPM Test:
|
2021-05-04 22:36:22 +00:00
|
|
|
# extends: .test-rpm
|
|
|
|
# image: fedora
|
|
|
|
# script:
|
|
|
|
# - dnf install -y build/packaging/rpm/RPMS/x86_64/*.rpm
|
|
|
|
# - tshark --version
|
2021-05-07 19:48:31 +00:00
|
|
|
# dependencies: [ 'Fedora RPM Package' ]
|
2019-05-10 19:25:54 +00:00
|
|
|
|
|
|
|
# Job to generate packages for Debian stable
|
2021-05-07 19:48:31 +00:00
|
|
|
Debian Stable APT Package:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build
|
|
|
|
rules: !reference [.if-merged]
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-debian-stable-dev
|
2019-05-10 19:25:54 +00:00
|
|
|
script:
|
|
|
|
# Shared GitLab runners limit the log size to 4M, so reduce verbosity. See
|
|
|
|
# https://gitlab.com/gitlab-com/support-forum/issues/2790
|
2021-05-04 22:36:22 +00:00
|
|
|
- export DH_QUIET=1
|
|
|
|
- export MAKEFLAGS=--silent
|
2020-09-09 20:20:46 +00:00
|
|
|
- dpkg-buildpackage -b --no-sign -jauto
|
2019-05-10 19:25:54 +00:00
|
|
|
- mkdir debian-packages
|
|
|
|
- mv ../*.deb debian-packages/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- debian-packages/*.deb
|
|
|
|
expire_in: 3 days
|
2021-05-07 19:48:31 +00:00
|
|
|
Debian Stable APT Test:
|
2021-05-04 22:36:22 +00:00
|
|
|
rules: !reference [.if-merged]
|
2020-12-10 03:00:27 +00:00
|
|
|
image: wireshark/wireshark-debian-stable-dev
|
2020-05-31 21:34:00 +00:00
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- DEBIAN_FRONTEND=noninteractive apt-get install ./debian-packages/*.deb -y
|
|
|
|
- tshark --version
|
2021-06-02 19:48:56 +00:00
|
|
|
after_script:
|
|
|
|
# Used for https://www.wireshark.org/docs/dfref/
|
|
|
|
- TSHARK_VERSION=$( tshark --version | head -n 1 | sed -e 's/.*(v//' -e 's/)$//' )
|
|
|
|
- tshark -G fields > dfilter-list-${TSHARK_VERSION}.txt
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dfilter-list-*.txt
|
2020-05-31 21:34:00 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2021-05-07 19:48:31 +00:00
|
|
|
dependencies: [ 'Debian Stable APT Package' ]
|
2020-08-18 23:00:32 +00:00
|
|
|
|
2021-06-20 00:17:09 +00:00
|
|
|
Win64 Package:
|
|
|
|
stage: build
|
|
|
|
rules: !reference [.if-merged]
|
|
|
|
tags:
|
|
|
|
- wireshark-win64-package
|
|
|
|
before_script:
|
|
|
|
- $env:WIRESHARK_BASE_DIR = "C:\Development"
|
|
|
|
- $env:Configuration = "RelWithDebInfo"
|
|
|
|
- $env:Path += ";C:\Program Files\CMake\bin"
|
|
|
|
- $env:Path += ";C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin"
|
|
|
|
- $env:Path += ";C:\qt\5.15.2\msvc2019_64\bin"
|
|
|
|
- $env:Path += ";C:\Program Files (x86)\NSIS"
|
|
|
|
- $env:Path += ";C:\Program Files (x86)\WiX Toolset v3.11\bin"
|
|
|
|
- $env:Path += ";C:\Program Files\Amazon\AWSCLIV2"
|
|
|
|
# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
|
|
|
|
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
|
|
|
|
- Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
script:
|
|
|
|
- perl ../tools/make-version.pl --set-release
|
|
|
|
- cmake -G "Visual Studio 16 2019" -A x64 -DDISABLE_WERROR=OFF -DTEST_EXTRA_ARGS=--enable-release -DENABLE_LTO=off ..
|
|
|
|
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount nsis_package_prep.vcxproj
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount wix_package_prep.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Recurse -Path run\RelWithDebInfo
|
|
|
|
- msbuild /verbosity:minimal nsis_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\nsis
|
|
|
|
- msbuild /verbosity:minimal wix_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\wix
|
|
|
|
- $plugins = Get-ChildItem run\RelWithDebInfo\plugins\*\*.dll ; signtool verify /v /pa /all run\RelWithDebInfo\*.exe run\RelWithDebInfo\extcap\*.exe $plugins run\RelWithDebInfo\libwireshark.dll run\RelWithDebInfo\libwiretap.dll run\RelWithDebInfo\libwsutil.dll packaging\nsis\Wireshark-win??-*.exe packaging\wix\Wireshark-win??-*.msi
|
|
|
|
- msbuild /verbosity:minimal pdb_zip_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\mse-scan.ps1
|
|
|
|
- $packages = Get-ChildItem "packaging\nsis\Wireshark-win??-*.exe", "packaging\wix\Wireshark-win??-*.msi"
|
|
|
|
- foreach ($package in $packages) { certutil -hashfile $package SHA256 }
|
|
|
|
- |
|
|
|
|
if ((Test-Path env:AWS_ACCESS_KEY_ID) -and (Test-Path env:AWS_SECRET_ACCESS_KEY) -and (Test-Path env:S3_DESTINATION_WIN64)) {
|
|
|
|
foreach ($package in $packages) {
|
|
|
|
aws s3 cp "$package" "$env:S3_DESTINATION_WIN64/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- ctest -C RelWithDebInfo --parallel 3 --force-new-ctest-process --verbose
|
|
|
|
|
|
|
|
Win32 Package:
|
|
|
|
stage: build
|
|
|
|
rules: !reference [.if-merged]
|
|
|
|
tags:
|
|
|
|
- wireshark-win32-package
|
|
|
|
before_script:
|
|
|
|
- $env:WIRESHARK_BASE_DIR = "C:\Development"
|
|
|
|
- $env:Configuration = "RelWithDebInfo"
|
|
|
|
- $env:Path += ";C:\Program Files\CMake\bin"
|
|
|
|
- $env:Path += ";C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin"
|
|
|
|
- $env:Path += ";C:\qt\5.15.2\msvc2019\bin"
|
|
|
|
- $env:Path += ";C:\Program Files (x86)\NSIS"
|
|
|
|
- $env:Path += ";C:\Program Files (x86)\WiX Toolset v3.11\bin"
|
|
|
|
- $env:Path += ";C:\Program Files\Amazon\AWSCLIV2"
|
|
|
|
# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
|
|
|
|
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsamd64_x86.bat`" && set > %temp%\vcvars.txt"
|
|
|
|
- Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
|
|
|
|
- $env:Platform = "Win32"
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
script:
|
|
|
|
- perl ../tools/make-version.pl --set-release
|
|
|
|
- cmake -G "Visual Studio 16 2019" -A Win32 -DDISABLE_WERROR=OFF -DTEST_EXTRA_ARGS=--enable-release -DENABLE_LTO=off ..
|
|
|
|
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount test-programs.vcxproj
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount nsis_package_prep.vcxproj
|
|
|
|
- msbuild /verbosity:minimal /maxcpucount wix_package_prep.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Recurse -Path run\RelWithDebInfo
|
|
|
|
- msbuild /verbosity:minimal nsis_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\nsis
|
|
|
|
- msbuild /verbosity:minimal wix_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\wix
|
|
|
|
- msbuild /verbosity:minimal portableapps_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\sign-files.ps1 -Path packaging\portableapps
|
|
|
|
- $plugins = Get-ChildItem run\RelWithDebInfo\plugins\*\*.dll ; signtool verify /v /pa /all run\RelWithDebInfo\*.exe run\RelWithDebInfo\extcap\*.exe $plugins run\RelWithDebInfo\libwireshark.dll run\RelWithDebInfo\libwiretap.dll run\RelWithDebInfo\libwsutil.dll packaging\nsis\Wireshark-win??-*.exe packaging\wix\Wireshark-win??-*.msi packaging\portableapps\WiresharkPortable_*.paf.exe
|
|
|
|
- msbuild /verbosity:minimal pdb_zip_package.vcxproj
|
|
|
|
- C:\gitlab-builds\bin\mse-scan.ps1
|
|
|
|
- $packages = Get-ChildItem "packaging\nsis\Wireshark-win??-*.exe", "packaging\wix\Wireshark-win??-*.msi", "packaging\portableapps\WiresharkPortable_*.paf.exe"
|
|
|
|
- foreach ($package in $packages) { certutil -hashfile $package SHA256 }
|
|
|
|
- |
|
|
|
|
if ((Test-Path env:AWS_ACCESS_KEY_ID) -and (Test-Path env:AWS_SECRET_ACCESS_KEY) -and (Test-Path env:S3_DESTINATION_WIN32)) {
|
|
|
|
foreach ($package in $packages) {
|
|
|
|
aws s3 cp "$package" "$env:S3_DESTINATION_WIN32/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- ctest -C RelWithDebInfo --parallel 3 --force-new-ctest-process --verbose
|
|
|
|
|
2020-09-03 15:40:05 +00:00
|
|
|
# Build Wireshark manuals
|
|
|
|
# Note: Need ubuntu:focal with `ruby-coderay` and `ruby-asciidoctor-pdf` packages to build PDF docs
|
2021-05-07 19:48:31 +00:00
|
|
|
Documentation:
|
2020-09-03 15:40:05 +00:00
|
|
|
stage: build
|
|
|
|
image: wireshark/wireshark-ubuntu-dev
|
|
|
|
rules:
|
2021-05-04 22:36:22 +00:00
|
|
|
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
|
|
|
|
changes:
|
|
|
|
- "docbook/**"
|
|
|
|
- "epan/wslua/**"
|
|
|
|
when: always
|
2020-09-03 15:40:05 +00:00
|
|
|
script:
|
2021-05-04 22:36:22 +00:00
|
|
|
# XXX We might want to move this to wireshark-ubuntu-dev or debian-setup.sh.
|
|
|
|
- DEBIAN_FRONTEND=noninteractive apt-get update
|
|
|
|
- DEBIAN_FRONTEND=noninteractive apt-get --yes install ruby-coderay ruby-asciidoctor-pdf
|
2020-09-03 15:40:05 +00:00
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmake -GNinja ..
|
|
|
|
- ninja all_guides
|
|
|
|
after_script:
|
|
|
|
- mv build/docbook/wsug_html/ .
|
|
|
|
- mv build/docbook/wsug_html_chunked/ .
|
|
|
|
- mv build/docbook/wsdg_html/ .
|
|
|
|
- mv build/docbook/wsdg_html_chunked/ .
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- wsug_html/
|
|
|
|
- wsug_html_chunked/
|
|
|
|
- wsdg_html/
|
|
|
|
- wsdg_html_chunked/
|
|
|
|
|
2020-08-18 23:00:32 +00:00
|
|
|
# https://docs.gitlab.com/ee/user/gitlab_com/index.html#linux-shared-runners
|
2020-09-15 23:55:41 +00:00
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
Commit Checks:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-merge-request]
|
2020-08-18 23:00:32 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
# build-ubuntu puts us in `build`.
|
|
|
|
- cd ..
|
|
|
|
- bash ./tools/pre-commit 'HEAD^1'
|
2020-09-15 23:55:41 +00:00
|
|
|
- tools/validate-commit.py
|
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
Ubuntu .dpkg:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-merge-request]
|
2020-09-15 23:55:41 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
# build-ubuntu puts us in `build`.
|
|
|
|
- cd ..
|
2020-09-09 20:20:46 +00:00
|
|
|
- CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ dpkg-buildpackage -us -uc -rfakeroot -jauto -Zgzip -zfast
|
2020-12-08 19:44:42 +00:00
|
|
|
- lintian --suppress-tags library-not-linked-against-libc,copyright-excludes-files-in-native-package --display-experimental --display-info --pedantic --profile debian
|
2020-08-18 23:00:32 +00:00
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
GCC Warnings:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-merge-request]
|
2020-08-18 23:00:32 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
# build-ubuntu puts us in `build`.
|
|
|
|
- perl ../tools/make-version.pl --set-release || ../perl make-version.pl --set-release
|
2020-09-01 21:41:02 +00:00
|
|
|
- CC=gcc CXX=g++ cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja ..
|
2020-08-18 23:00:32 +00:00
|
|
|
- ninja
|
|
|
|
- ninja test-programs
|
|
|
|
- chown -R user .
|
|
|
|
- su user -c "ctest --parallel 3 --force-new-ctest-process --verbose"
|
|
|
|
|
2021-05-07 19:48:31 +00:00
|
|
|
Code Checks + Clang Warnings:
|
2021-05-04 22:36:22 +00:00
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-merge-request]
|
2020-08-18 23:00:32 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
2021-05-04 22:36:22 +00:00
|
|
|
variables:
|
2021-05-08 16:30:33 +00:00
|
|
|
CC: clang-$CLANG_VERSION
|
|
|
|
CXX: clang++-$CLANG_VERSION
|
2020-08-18 23:00:32 +00:00
|
|
|
script:
|
|
|
|
# build-ubuntu puts us in `build`.
|
|
|
|
- cd ..
|
|
|
|
- python3 tools/checklicenses.py
|
2020-08-24 18:47:20 +00:00
|
|
|
- ./tools/cppcheck/cppcheck.sh -l 1 -x | tee cppcheck_report.xml
|
|
|
|
- if [[ -s "cppcheck_report.xml" ]]; then cppcheck-htmlreport --file cppcheck_report.xml --report-dir . ; fi
|
2020-08-18 23:00:32 +00:00
|
|
|
- cd build
|
2020-09-01 21:41:02 +00:00
|
|
|
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja ..
|
2020-08-18 23:00:32 +00:00
|
|
|
- ninja
|
|
|
|
- ./run/tshark -v
|
2020-08-24 12:26:23 +00:00
|
|
|
- sh -c '[ ! -e ../tools/validate-clang-check.sh ] || ../tools/validate-clang-check.sh'
|
2020-08-18 23:00:32 +00:00
|
|
|
- ninja checkAPI
|
2020-08-24 18:47:20 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- cppcheck_report.xml
|
2020-10-27 17:09:40 +00:00
|
|
|
- cppcheck_report.html
|
2020-08-18 23:00:32 +00:00
|
|
|
|
2020-09-02 17:24:27 +00:00
|
|
|
# XXX This is still beta:
|
2020-08-18 23:00:32 +00:00
|
|
|
# https://docs.gitlab.com/ee/user/gitlab_com/index.html#windows-shared-runners-beta
|
2020-09-02 17:24:27 +00:00
|
|
|
# Dockerfile at https://github.com/wireshark/wireshark-windows-dev-docker.
|
|
|
|
# XXX We currently depend on Qt being installed in C:\Qt on the host. We should
|
|
|
|
# find a more independent way of installing Qt, e.g. via a download+cache.
|
2021-05-07 19:48:31 +00:00
|
|
|
Windows Build:
|
2021-05-04 22:36:22 +00:00
|
|
|
rules: !reference [.if-attached-merge-request]
|
2020-08-18 23:00:32 +00:00
|
|
|
tags:
|
2021-04-04 20:28:16 +00:00
|
|
|
- wireshark-windows-merge-req
|
2020-08-18 23:00:32 +00:00
|
|
|
stage: build
|
|
|
|
before_script:
|
|
|
|
# XXX Find a better location.
|
|
|
|
- mkdir c:\Development
|
|
|
|
- $env:WIRESHARK_BASE_DIR = "C:\Development"
|
|
|
|
- $env:Configuration = "RelWithDebInfo"
|
|
|
|
- $env:Path += ";C:\Program Files\CMake\bin"
|
|
|
|
- $env:Path += ";C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin"
|
2021-04-04 20:28:16 +00:00
|
|
|
- $env:Path += ";C:\qt\5.15.2\msvc2019_64\bin"
|
2020-08-18 23:00:32 +00:00
|
|
|
# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
|
|
|
|
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
|
|
|
|
- Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
|
|
|
|
# Testing / debugging only.
|
2020-09-02 17:24:27 +00:00
|
|
|
#- dir c:\
|
|
|
|
#- dir c:\qt
|
|
|
|
#- $env:path.split(";")
|
|
|
|
#- cmd.exe /c "set"
|
|
|
|
#- Get-Location
|
2020-08-18 23:00:32 +00:00
|
|
|
script:
|
|
|
|
- perl tools/make-version.pl --set-release
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- cmake -G "Visual Studio 16 2019" -A x64 ..
|
|
|
|
- msbuild "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
|
|
|
|
- msbuild "/consoleloggerparameters:PerformanceSummary;NoSummary" test-programs.vcxproj
|
|
|
|
- ctest -C RelWithDebInfo --parallel 3 --force-new-ctest-process --verbose
|
2021-05-07 19:43:16 +00:00
|
|
|
|
|
|
|
# Fuzz TShark using ASAN and valgrind.
|
|
|
|
.fuzz-ubuntu:
|
|
|
|
extends: .build-ubuntu
|
|
|
|
rules: !reference [.if-fuzz-schedule]
|
|
|
|
tags:
|
|
|
|
- wireshark-ubuntu-fuzz
|
2021-05-08 00:09:42 +00:00
|
|
|
resource_group: fuzz-release-3.4
|
2021-05-07 19:43:16 +00:00
|
|
|
variables:
|
|
|
|
CC: "clang-$CLANG_VERSION"
|
|
|
|
CXX: "clang++-$CLANG_VERSION"
|
|
|
|
INSTALL_PREFIX: "$CI_PROJECT_DIR/_install"
|
|
|
|
MIN_PLUGINS: 10
|
|
|
|
MAX_PASSES: 15
|
|
|
|
before_script:
|
|
|
|
- mkdir -p ccache
|
|
|
|
# Signal after_script, which runs in its own shell.
|
|
|
|
- echo "export FUZZ_PASSED=true" > /tmp/fuzz_result.sh
|
|
|
|
- mkdir /tmp/fuzz
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
after_script:
|
|
|
|
- . /tmp/fuzz_result.sh
|
|
|
|
- if $FUZZ_PASSED ; then exit 0 ; fi
|
|
|
|
- echo Fuzzing failed. Generating report.
|
|
|
|
- FUZZ_CAPTURE=$( ls /tmp/fuzz/fuzz-*.pcap | head -n 1 )
|
|
|
|
- FUZZ_ERRORS="/tmp/fuzz/$( basename "$FUZZ_CAPTURE" .pcap ).err"
|
|
|
|
- printf "\nfuzz-test.sh stderr:\n" >> "$FUZZ_ERRORS"
|
|
|
|
- cat fuzz-test.err >> "$FUZZ_ERRORS"
|
|
|
|
- |
|
|
|
|
if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ] && [ -n "$S3_DESTINATION_FUZZ" ] ; then
|
|
|
|
aws s3 cp "$FUZZ_CAPTURE" "$S3_DESTINATION_FUZZ/"
|
|
|
|
aws s3 cp "$FUZZ_ERRORS" "$S3_DESTINATION_FUZZ/"
|
|
|
|
fi
|
|
|
|
# The cache should be large enough to be useful but it shouldn't take
|
|
|
|
# too long to restore+save each run.
|
|
|
|
- ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
|
|
|
|
|
|
|
|
ASan Menagerie Fuzz:
|
|
|
|
extends: .fuzz-ubuntu
|
|
|
|
stage: fuzz-asan
|
|
|
|
script:
|
|
|
|
- MAX_SECONDS=$(( 4 * 60 * 60 ))
|
2021-05-24 20:45:31 +00:00
|
|
|
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
|
|
|
|
- cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON ..
|
|
|
|
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
|
2021-05-07 19:43:16 +00:00
|
|
|
- ninja
|
|
|
|
- ninja install
|
|
|
|
- cd ..
|
|
|
|
# /var/menagerie contains captures harvested from wireshark.org's mailing list, wiki, issues, etc.
|
|
|
|
# We have more captures than we can fuzz in $MAX_SECONDS, so we shuffle them each run.
|
|
|
|
- ./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 || echo "export FUZZ_PASSED=false" > /tmp/fuzz_result.sh
|
|
|
|
|
|
|
|
ASan randpkt Fuzz:
|
|
|
|
extends: .fuzz-ubuntu
|
|
|
|
stage: fuzz-randpkt
|
|
|
|
script:
|
|
|
|
# XXX Reuse fuzz-asan?
|
2021-05-24 20:45:31 +00:00
|
|
|
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
|
|
|
|
- cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON ..
|
|
|
|
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
|
2021-05-07 19:43:16 +00:00
|
|
|
- ninja
|
|
|
|
- ninja install
|
|
|
|
- cd ..
|
|
|
|
- ./tools/randpkt-test.sh -a -b $INSTALL_PREFIX/bin -d /tmp/fuzz -p $MAX_PASSES 2> fuzz-test.err || echo "export FUZZ_PASSED=false" > /tmp/fuzz_result.sh
|
|
|
|
needs: [ 'ASan Menagerie Fuzz' ]
|
|
|
|
|
|
|
|
Valgrind Menagerie Fuzz:
|
|
|
|
extends: .fuzz-ubuntu
|
|
|
|
stage: fuzz-valgrind
|
|
|
|
script:
|
|
|
|
- DEBIAN_FRONTEND=noninteractive apt-get update
|
|
|
|
- DEBIAN_FRONTEND=noninteractive apt-get --yes install valgrind
|
|
|
|
- MAX_SECONDS=$(( 3 * 60 * 60 ))
|
2021-05-24 20:45:31 +00:00
|
|
|
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
|
|
|
|
- cmake -G Ninja -DBUILD_wireshark=OFF -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_CCACHE=ON ..
|
|
|
|
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
|
2021-05-07 19:43:16 +00:00
|
|
|
- ninja
|
|
|
|
- ninja install
|
|
|
|
- cd ..
|
|
|
|
- ./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 || echo "export FUZZ_PASSED=false" > /tmp/fuzz_result.sh
|
|
|
|
needs: [ 'ASan randpkt Fuzz' ]
|