Skip to content

Commit 79e0626

Browse files
jiangxindscho
authored andcommitted
ci: use the same version of p4 on both Linux and macOS
There would be a segmentation fault when running p4 v16.2 on ubuntu 22.04 which is the latest version of ubuntu runner image for github actions. By checking each version from [1], p4d version 21.1 and above can work properly on ubuntu 22.04. But version 22.x will break some p4 test cases. So p4 version 21.x is exactly the version we can use. With this update, the versions of p4 for Linux and macOS happen to be the same. So we can add the version number directly into the "P4WHENCE" variable, and reuse it in p4 installation for macOS. By removing the "LINUX_P4_VERSION" variable from "ci/lib.sh", the comment left above has nothing to do with p4, but still applies to git-lfs. Since we have a fixed version of git-lfs installed on Linux, we may have a different version on macOS. [1]: https://cdist2.perforce.com/perforce/ Reviewed-by: Johannes Schindelin <[email protected]> Helped-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Jiang Xin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 20854bc commit 79e0626

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

ci/install-dependencies.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

8-
P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
8+
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
99
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
1010
UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
1111
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
@@ -44,13 +44,15 @@ osx-clang|osx-gcc)
4444
test -z "$BREW_INSTALL_PACKAGES" ||
4545
brew install $BREW_INSTALL_PACKAGES
4646
brew link --force gettext
47-
brew install --cask --no-quarantine perforce || {
48-
# Update the definitions and try again
49-
cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
50-
git -C "$cask_repo" pull --no-stat --ff-only &&
51-
brew install --cask --no-quarantine perforce
52-
} ||
53-
brew install homebrew/cask/perforce
47+
mkdir -p $HOME/bin
48+
(
49+
cd $HOME/bin
50+
wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
51+
tar -xf helix-core-server.tgz &&
52+
sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
53+
)
54+
PATH="$PATH:${HOME}/bin"
55+
export PATH
5456
case "$jobname" in
5557
osx-gcc)
5658
brew install gcc@9

ci/lib.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ linux-clang|linux-gcc)
199199
# were recorded in the Homebrew database upon creating the OS X
200200
# image.
201201
# Keep that in mind when you encounter a broken OS X build!
202-
export LINUX_P4_VERSION="16.2"
203202
export LINUX_GIT_LFS_VERSION="1.5.2"
204203

205204
P4_PATH="$HOME/custom/p4"

0 commit comments

Comments
 (0)