travis: remove Windows support

The Windows builds have been stuck for a while because the Qt project
changed their installers which prevented the installers from finishing.
Remove support because 1) the Qt installer will most likely continue to
break over time as it did in the past, several times, 2) Travis CI uses
Bash which is a non-standard environment on Windows, and 3) other CI
platforms such as GitHub Actions started providing Windows support.

Remove Windows from the Travis CI builds and all related supporting
files as well. They can be restored once the Qt automation is fixed.

Bug: 16501
Change-Id: I911491587a23f339aa6d6ffcfb6faffe234e5e91
Reviewed-on: https://code.wireshark.org/review/36887
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
This commit is contained in:
Peter Wu 2020-04-19 17:42:26 +02:00 committed by Dario Lombardo
parent 439e9a6318
commit 44407c16fc
6 changed files with 3 additions and 370 deletions

View File

@ -55,31 +55,6 @@ matrix:
env:
- CXX=clang++
- CC=clang
- name: Windows (VS2017 x64)
# Set a supported language, otherwise the Windows worker will not start.
language: shell
os: windows
env:
- PLATFORM: x64
- WIRESHARK_BASE_DIR: C:/wireshark-libs
- QT5_BASE_DIR: C:/Qt/5.12.3/msvc2017_64
cache:
directories:
- travis-cache
- name: Windows (VS2017 Win32)
# Set a supported language, otherwise the Windows worker will not start.
language: shell
os: windows
env:
- PLATFORM: Win32
- WIRESHARK_BASE_DIR: C:/wireshark-libs
- QT5_BASE_DIR: C:/Qt/5.12.3/msvc2017
cache:
directories:
- travis-cache
# Windows builds are experimental in Travis and are unreliable, do not force it.
allow_failures:
- os: windows
before_install:
- echo $TRAVIS_OS_NAME
# macos
@ -89,44 +64,19 @@ before_install:
# linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ./tools/debian-setup.sh --install-optional --install-test-deps -q; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y python3-pip; fi
# windows
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh restore; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then cinst -y --no-progress python3 winflexbison strawberryperl; fi
- |
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
# Ensure Python and the Scripts folder is available in PATH.
# refreshenv does not seem to work in bash, so reload it manually.
# Entries in the Machine PATH might contain trailing slashes, drop those.
# Apply Process paths before Machine to ensure /bin appears before others (otherwise casher will break and stall).
export PATH="$(powershell -Command '("Process", "Machine" | % {
[Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", ""
} | Select -Unique | % { cygpath $_ }) -Join ":"')"
echo "PATH=$PATH"
# Workaround to avoid using perl from git-bash $PATH which lacks modules such as Pod::Usage
export CMAKE_PROGRAM_PATH=C:/Strawberry/perl/bin
fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-install-qt-windows.sh; fi
# all platforms
- pip3 install pytest pytest-xdist
before_script:
- mkdir build
- cd build
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then cmake -GNinja ..; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake -A $PLATFORM ..; fi
- cmake -GNinja ..
script:
# Enable parallelism for msbuild too (since CMake 3.12; ninja does not need it)
- export CMAKE_BUILD_PARALLEL_LEVEL=
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then cmake() { ../tools/filter-msbuild.py cmake "$@"; }; fi
# Invoke ninja (Linux/macOS, --config is ignored) or msbuild (Windows)
- cmake --build . --config RelWithDebInfo
- cmake --build . --config RelWithDebInfo --target test-programs
- ninja
- ninja test-programs
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo setcap cap_net_raw,cap_net_admin+eip run/dumpcap; fi
- pytest
- cd ..
before_cache:
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then tools/travis-cache-windows.sh save; fi
after_script:
- cd build
- if [ -f run/tshark ]; then run/tshark --version; fi
- if [ -f run/RelWithDebInfo/tshark.exe ]; then run/RelWithDebInfo/tshark.exe --version; fi
- ../test/travis-upload-artifacts.sh

View File

@ -1,65 +0,0 @@
#!/usr/bin/env python
# Reduce msbuild output by folding unimportant messages.
#
# Copyright (C) 2019 Peter Wu <peter@lekensteyn.nl>
# SPDX-License-Identifier: GPL-2.0-or-later
import subprocess
import sys
def print_lines(f):
# If an important message is present, print it with a newline.
# Otherwise skip the newline but print the next line with a carriage return.
# If the end of build is reached, just print the trailing messages (includes
# elapsed time, warning/error counts, etc.).
start_of_line = ''
end_of_build = False
for line in iter(f.readline, ''):
line = line.rstrip('\r\n')
if line.startswith('Build succeeded.'):
end_of_build = True
is_important = end_of_build or any([
': error ' in line,
': warning ' in line,
'-- FAILED.' in line,
])
if is_important:
eol = '\n'
if start_of_line == '\r':
start_of_line = '\n'
else:
eol = ''
sys.stdout.write("%s%s%s" % (start_of_line, line, eol))
sys.stdout.flush()
if is_important:
start_of_line = ''
else:
start_of_line = '\r'
# If the last line was not important, its LF was omitted so print it.
if not is_important:
sys.stdout.write('\n')
command = sys.argv[1:]
if command:
# Execute the given command and parse its output.
proc = subprocess.Popen(command,
bufsize=1,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True
)
try:
print_lines(proc.stdout)
finally:
sys.exit(proc.wait())
else:
# Assume a file read from stdin.
print_lines(sys.stdin)

View File

@ -1,92 +0,0 @@
/*
* Qt Installer script for a non-interactive installation of Qt5 on Windows.
* Installs the 64-bit package if environment variable PLATFORM="x64".
*/
// jshint strict:false
/* globals QInstaller, QMessageBox, buttons, gui, installer, console */
// Run with:
// .\qt-unified-windows-x86-3.0.4-online.exe --verbose --script tools\qt-installer-windows.qs
// Look for Name elements in
// https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml
// Unfortunately it is not possible to disable deps like qt.tools.qtcreator
var INSTALL_COMPONENTS = [
installer.environmentVariable("PLATFORM") == "x64" ?
"qt.qt5.5123.win64_msvc2017_64" :
"qt.qt5.5123.win32_msvc2017",
];
function Controller() {
// Continue on installing to an existing (possibly empty) directory.
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
// Continue at "SHOW FINISHED PAGE"
installer.installationFinished.connect(function() {
console.log("installationFinished");
gui.clickButton(buttons.NextButton);
});
}
Controller.prototype.WelcomePageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// At least for 3.0.4 immediately clicking Next fails, so wait a bit.
// https://github.com/benlau/qtci/commit/85cb986b66af4807a928c70e13d82d00dc26ebf0
gui.clickButton(buttons.NextButton, 1000);
};
Controller.prototype.CredentialsPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.IntroductionPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.TargetDirectoryPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// Keep default at "C:\Qt".
//gui.currentPageWidget().TargetDirectoryLineEdit.setText("E:\\Qt");
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ComponentSelectionPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
var page = gui.currentPageWidget();
page.deselectAll();
for (var i = 0; i < INSTALL_COMPONENTS.length; i++) {
page.selectComponent(INSTALL_COMPONENTS[i]);
}
gui.clickButton(buttons.NextButton);
};
Controller.prototype.LicenseAgreementPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
};
Controller.prototype.StartMenuDirectoryPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.ReadyForInstallationPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
gui.clickButton(buttons.NextButton);
};
Controller.prototype.FinishedPageCallback = function() {
console.log("Step: " + gui.currentPageWidget());
// TODO somehow the installer crashes after this step.
// https://stackoverflow.com/questions/25105269/silent-install-qt-run-installer-on-ubuntu-server
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
};
// vim: set ft=javascript:

View File

@ -1,46 +0,0 @@
#!/bin/bash
# Reads stdin and periodically report the most recently seen output.
#
# Copyright (C) 2019 Peter Wu <peter@lekensteyn.nl>
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Like "travis_wait", it prevents a build timeout due to lack of progress.
# Additionally:
# - During execution it reports the most recent line instead of some fixed text.
# - It does not write the full output at the end of execution.
# - It does not impose a command timeout.
set -eu
# Default to a 60 seconds interval between printing messages.
PERIOD=${1:-60}
nexttime=$PERIOD
msg=
count=0
# Reset timer (SECONDS is a special Bash variable).
SECONDS=0
while true; do
# Periodically report the last read line.
timeleft=$((nexttime-SECONDS))
while [ $timeleft -le 0 ]; do
((nexttime+=PERIOD))
((timeleft+=PERIOD))
printf "[progress] %3d %s\n" $SECONDS "${msg:-(no output)}"
msg=
done
if read -r -t $timeleft line; then
# Save line for later.
((count+=1))
msg="Line $count: $line"
continue
elif [ $? -le 128 ]; then
# EOF (as opposed to a timeout)
[ -z "$msg" ] || printf "[progress] %3d %s\n" $SECONDS "$msg"
printf "[progress] %3d done (read %d lines).\n" $SECONDS $count
break
fi
done

View File

@ -1,86 +0,0 @@
#!/bin/bash
# Packs and unpacks files for Travis CI cache.
#
# Copyright (C) 2019 Peter Wu <peter@lekensteyn.nl>
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Travis CI currently has a bug that prevents absolute paths from being cached.
# See https://github.com/travis-ci/casher/pull/38
# As a workaround, manually pack directories into an uncompressed tarball
# (which will be bzip2-compressed by casher). An additional advantage is that
# casher has to check fewer files to determine whether it is out of date.
pre_restore() {
restored_files=()
echo "Contents of ${cachedir}:"
ls -la "$cachedir"
echo
}
do_restore() {
local tarball="$cachedir/$1" path="$2"
if [ -e "$tarball" ]; then
echo "Restoring ${path}..."
time tar -xPf "$tarball" "$path"
restored_files+=("$1")
fi
}
post_restore() {
# Remove old cache entries if any.
mkdir "${cachedir}.new"
for file in "${restored_files[@]}"; do
mv "$cachedir/$file" "${cachedir}.new/"
done
if oldfiles=$(ls -lA "$cachedir" | grep -v ^total); then
echo "Removed stale cache entries:"
echo "$oldfiles"
echo
fi
rm -rf "$cachedir"
mv "${cachedir}.new" "$cachedir"
}
pre_save() { :;}
do_save() {
local tarball="$cachedir/$1" path="$2"
if [ ! -e "$path" ]; then
echo "Cannot cache $path as it is missing."
return
fi
if [ -e "$tarball" ]; then
if ! [ "$path" -nt "$tarball" ]; then
echo "No changes detected in ${path}."
return
fi
echo "Saving new version of ${path}..."
else
echo "Saving $path for the first time..."
fi
time tar -cPf "$tarball" "$path"
}
post_save() {
echo "New contents of ${cachedir}:"
ls -la "$cachedir"
echo
}
main() {
# Cache directories are relative to this path.
cd "$TRAVIS_BUILD_DIR"
pwd
cachedir=travis-cache
mkdir -p "$cachedir"
"pre_$1"
"do_$1" wireshark-libs.tar "$WIRESHARK_BASE_DIR"
"do_$1" Qt.tar "$QT5_BASE_DIR"
"post_$1"
}
# Merge stderr to stdout to prevent stderr from ending up in future output.
main "$1" 2>&1

View File

@ -1,28 +0,0 @@
#!/bin/bash
# Installs Qt on Windows for Travis CI.
#
# Copyright (C) 2019 Peter Wu <peter@lekensteyn.nl>
# SPDX-License-Identifier: GPL-2.0-or-later
set -eu -o pipefail
if [ -e "$QT5_BASE_DIR/bin/moc.exe" ]; then
echo "Found an existing Qt installation at $QT5_BASE_DIR"
exit
fi
echo "Downloading the installer..."
# https is of no use if it redirects to a http mirror...
curl -vLo ~/qt-unified-windows-x86-online.exe http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
echo "Installing..."
# Run installer and save the installer output. To avoid hitting the timeout,
# periodically print some progress. On error, show the full log and abort.
~/qt-unified-windows-x86-online.exe --verbose --script tools/qt-installer-windows.qs |
tee ~/qt-installer-output.txt |
tools/report-progress.sh ||
(cat ~/qt-installer-output.txt; exit 1)
printf 'Installation size: '
du -sm "$QT5_BASE_DIR" 2>&1 ||
(cat ~/qt-installer-output.txt; exit 1)