Skip to content

Commit 468c5a0

Browse files
committed
ci: install P4 from package to fix build error
To test 'git-p4' in the Linux Clang and GCC build jobs we used to install the 'p4' and 'p4d' binaries by directly downloading those binaries from a Perforce filehost. This has worked just fine ever since we started using Travis CI [1], but during the last day or so that filehost appeared to be gone: while its hostname still resolves, the host doesn't seem to reply to any download request, it doesn't even refuse the connection, and eventually our build jobs time out [2]. Now, this might be just a temporary glitch, but I'm afraid that it isn't. The "Helix Core Server Administrator Guide" [3] describes two ways to install these binaries on Linux, and none of them mentions the filehost that we've been downloading from in the past: - non-package installation: open the website's download page in your web browser, select OS and platform, click on the download link, and eventually you get a .tar.gz archive containing, among other things, the necessary 'p4' and 'p4d' binaries. Although we could use the URL of this archive to download it in our CI scripts with 'wget', nobody said that that URL remains stable, and we would still need to extract the archive and copy the binaries to $PATH. - package installation for various distros, including Ubuntu 16.04 (i.e. the Ubuntu version used both in our Travis CI and Azure Pipelines builds): add a package repository and its pubkey, 'apt-get update && apt-get install', and ready to go. Let's install P4 from the package repository, because this approach seems to be simpler and more future proof. Note that we used to install an old P4 version (2016.2) in the Linux build jobs, but with this change we'll install the most recent version available in the Perforce package repository (currently 2019.1). [1] 522354d (Add Travis CI support, 2015-11-27). [2] https://travis-ci.org/git/git/jobs/581429927#L422 [3] https://www.perforce.com/manuals/p4sag/Content/P4SAG/chapter.install.html Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
1 parent 745f681 commit 468c5a0

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

ci/install-dependencies.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,23 @@
55

66
. ${0%/*}/lib.sh
77

8-
P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
98
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
109

1110
case "$jobname" in
1211
linux-clang|linux-gcc)
12+
wget -qO - https://package.perforce.com/perforce.pubkey | sudo apt-key add -
13+
echo "deb http://package.perforce.com/apt/ubuntu xenial release" >perforce.list
14+
sudo mv perforce.list /etc/apt/sources.list.d/
1315
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
1416
sudo apt-get -q update
15-
sudo apt-get -q -y install language-pack-is libsvn-perl apache2
17+
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
18+
helix-p4d
1619
case "$jobname" in
1720
linux-gcc)
1821
sudo apt-get -q -y install gcc-8
1922
;;
2023
esac
2124

22-
mkdir --parents "$P4_PATH"
23-
pushd "$P4_PATH"
24-
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
25-
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
26-
chmod u+x p4d
27-
chmod u+x p4
28-
popd
2925
mkdir --parents "$GIT_LFS_PATH"
3026
pushd "$GIT_LFS_PATH"
3127
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"

ci/lib.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,15 @@ linux-clang|linux-gcc)
162162

163163
export GIT_TEST_HTTPD=YesPlease
164164

165-
# The Linux build installs the defined dependency versions below.
166-
# The OS X build installs much more recent versions, whichever
165+
# The Linux build installs the defined dependency version below.
166+
# The OS X build installs much more recent version, whichever
167167
# were recorded in the Homebrew database upon creating the OS X
168168
# image.
169169
# Keep that in mind when you encounter a broken OS X build!
170-
export LINUX_P4_VERSION="16.2"
171170
export LINUX_GIT_LFS_VERSION="1.5.2"
172171

173-
P4_PATH="$HOME/custom/p4"
174172
GIT_LFS_PATH="$HOME/custom/git-lfs"
175-
export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
173+
export PATH="$GIT_LFS_PATH:$PATH"
176174
;;
177175
osx-clang|osx-gcc)
178176
if [ "$jobname" = osx-gcc ]

0 commit comments

Comments
 (0)