diff mbox series

[1/2] ci: fix check for Ubuntu 20.04

Message ID f91004a4382c95b1b87bf3d1aafc018af2b7b92e.1717655210.git.ps@pks.im (mailing list archive)
State Superseded
Headers show
Series ci: detect more warnings via `-Og` | expand

Commit Message

Patrick Steinhardt June 6, 2024, 6:30 a.m. UTC
In 5ca0c455f1 (ci: fix Python dependency on Ubuntu 24.04, 2024-05-06),
we made the use of Python 2 conditional on whether or not the CI job
runs Ubuntu 20.04. There was a brown-paper-bag-style bug though, where
the condition forgot to invoke the `test` builtin. The result of it is
that the check always fails, and thus all of our jobs run with Python 3
by accident.

Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 ci/lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff King June 6, 2024, 6:53 a.m. UTC | #1
On Thu, Jun 06, 2024 at 08:30:25AM +0200, Patrick Steinhardt wrote:

> In 5ca0c455f1 (ci: fix Python dependency on Ubuntu 24.04, 2024-05-06),
> we made the use of Python 2 conditional on whether or not the CI job
> runs Ubuntu 20.04. There was a brown-paper-bag-style bug though, where
> the condition forgot to invoke the `test` builtin. The result of it is
> that the check always fails, and thus all of our jobs run with Python 3
> by accident.
> 
> Fix this.

Yikes. This looks obviously correct. Though I guess nobody noticed or
cared that we were not using python 2? It sounds like it is a
nice-to-have to get more coverage, but the platform in question is happy
to use python 3).

-Peff
Patrick Steinhardt June 6, 2024, 7:44 a.m. UTC | #2
On Thu, Jun 06, 2024 at 02:53:28AM -0400, Jeff King wrote:
> On Thu, Jun 06, 2024 at 08:30:25AM +0200, Patrick Steinhardt wrote:
> 
> > In 5ca0c455f1 (ci: fix Python dependency on Ubuntu 24.04, 2024-05-06),
> > we made the use of Python 2 conditional on whether or not the CI job
> > runs Ubuntu 20.04. There was a brown-paper-bag-style bug though, where
> > the condition forgot to invoke the `test` builtin. The result of it is
> > that the check always fails, and thus all of our jobs run with Python 3
> > by accident.
> > 
> > Fix this.
> 
> Yikes. This looks obviously correct. Though I guess nobody noticed or
> cared that we were not using python 2? It sounds like it is a
> nice-to-have to get more coverage, but the platform in question is happy
> to use python 3).

Yeah, the reason for this check really only is to get more coverage
while Python 2 is still available on some of the distros that users may
reasonably use. It's kind of a best effort check to keep it compatible,
even though we will likely eventually drop that guarantee once Python 2
is getting phased out by distros.

Patrick
diff mbox series

Patch

diff --git a/ci/lib.sh b/ci/lib.sh
index 1f4059b1b8..814578ffc6 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -328,7 +328,7 @@  ubuntu-*)
 	# Python 2 is end of life, and Ubuntu 23.04 and newer don't actually
 	# have it anymore. We thus only test with Python 2 on older LTS
 	# releases.
-	if "$distro" = "ubuntu-20.04"
+	if test "$distro" = "ubuntu-20.04"
 	then
 		PYTHON_PACKAGE=python2
 	else