list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] [RFC] travis-ci: remove bogus 'pyenv' in the Linux jobs
@ 2020-07-21 16:12 SZEDER Gábor
  2020-07-21 16:23 ` Eric Sunshine
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: SZEDER Gábor @ 2020-07-21 16:12 UTC (permalink / raw)
  To: git; +Cc: SZEDER Gábor

In our test suite, when 'git p4' invokes a Git command as a
subprocesses, then it should run the 'git' binary we are testing.
Unfortunately, this is not the case in the 'linux-clang' and
'linux-gcc' jobs on Travis CI, where 'git p4' runs the system
'/usr/bin/git' instead.

Travis CI's default Linux image includes 'pyenv', and all Python
invocations that involve PATH lookup go through 'pyenv', e.g. our
'PYTHON_PATH=$(which python3)' sets '/opt/pyenv/shims/python3' as
PYTHON_PATH, which in turn will invoke '/usr/bin/python3'.  Alas, the
'pyenv' version included in this image is buggy, and prepends the
directory containing the Python binary to PATH even if that is a
system directory already in PATH near the end.  Consequently, 'git p4'
in those jobs ends up with its PATH starting with '/usr/bin', and then
runs '/usr/bin/git'.

So remove 'pyenv' in Travis CI's Linux jobs to prevet it from
interfering with our 'git p4' tests.

Signed-off-by: SZEDER Gábor <>

    This issue triggered test failures in all 'git p4' test scripts in the
    recent GIT_TEST_DEFAULT_HASH=sha256 test runs, because the system Git
    doesn't understand the 'objectformat' extension, e.g.:
    This is not an issue in Travis CI's macOS jobs or on Azure Pipelines,
    because they don't use 'pyenv'.
    However, perhaps removing 'pyenv' is not the best solution here.
    We set PYTHON_PATH in 'ci/', which is sourced at the beginning
    of (almost) all of our CI scripts.  Consequently, in these jobs we
    first run 'ci/', which sources 'ci/',
    assigns PYTHON_PATH=/opt/pyenv/shims/python3 (which is never used),
    and removes 'pyenv', and then run 'ci/', which
    sources 'ci/' and assigns PYTHON_PATH=/usr/bin/python3 (which is
    then used in the build process to set 'pit p4's shebang line).  Not
    really nice, is it.
    Alternatively, we could avoid the PATH lookup and thus the bogus
    'pyenv' by explicitly using '/usr/bin/python{2,3}'.  The Linux images
    in both Travis CI and Azure Pipelines are standard Ubuntu images, so I
    think we can safely rely on these Python paths.

 ci/ | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ci/ b/ci/
index 0229a77f7d..b4bdcbcba2 100755
--- a/ci/
+++ b/ci/
@@ -36,6 +36,14 @@ linux-clang|linux-gcc)
 		tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
 		cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
+	if test true = "$TRAVIS" &&
+	   pyenv_root=$(pyenv root)
+	then
+		# pyenv in Travis CI's current default (xenial) Linux
+		# image messes up PATH for 'git p4'.
+		sudo rm -rf "$pyenv_root"
+	fi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-24 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 16:12 [PATCH] [RFC] travis-ci: remove bogus 'pyenv' in the Linux jobs SZEDER Gábor
2020-07-21 16:23 ` Eric Sunshine
2020-07-21 20:34 ` Junio C Hamano
2020-07-23 21:38   ` [PATCH v2] ci: use absolute PYTHON_PATH " SZEDER Gábor
2020-07-23 22:31     ` Junio C Hamano
2020-07-24 13:58       ` SZEDER Gábor
2020-07-21 22:20 ` [PATCH] [RFC] travis-ci: remove bogus 'pyenv' " brian m. carlson

Code repositories for project(s) associated with this inbox:

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).