From nobody Sat Oct 4 22:18:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 971A52F83AE; Tue, 12 Aug 2025 15:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755013985; cv=none; b=O2bsvkgaYryczlIVyBl2imKjMWmV5kj3LXYAsjgPO560gETVJniZeNZlbKXZ8LysikY9Yphvvwct1QFo3WxlVWOSFAtQTv/FuVdPHpWV1a+0qR/uXVaXk3CHZRmIsurFTb/ilo5cYag1tD4M6owMk0NMVA0M2QE38PZJMRz4EWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755013985; c=relaxed/simple; bh=wJnSHEtnfEDAispvO8hkEglJmLys0nv2+O3sl9tpI6w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mUFB+C7QcwCRftty6nCl1VHYNwyXRK06gV67g4FwxnwriwYGdLrMEF/3b0Pdoe/D5pt95L3EV73z/Gg+MpYhJvudkFOgLtIiNV6HSAXCg6+2rvb/6GD28JmvlMr7dVmn2maKxvPWI0z9P/NQAwXP7g53MV9xlIyvDIrh0b1w8fg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eGzjKHCH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eGzjKHCH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA11C4AF1D; Tue, 12 Aug 2025 15:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755013985; bh=wJnSHEtnfEDAispvO8hkEglJmLys0nv2+O3sl9tpI6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGzjKHCHIXp/dRp23WRPuBOLAyehmHihe4lv5XXB4O4Kb8b+M9CtYz0UZf0hu4dT6 EtTwvJF0cpaQGfA3HJnz/NcpTrgIrpezVU6TEDndJK+iG0o2jtSxwI/A6a5SJalYJo MPFXb5o+880RIz30SQCRlG8jNBZcxKwK+XBiE60z5L5kE7IgEEZk4UbnjywhVFY88v O5Y8DbiE1ZomQGa05Y3/7mgaoxE4VRXYuG6W0fpDG5wPDO47uR8+CFT62SE4Ifraf6 9y1QfkGeir9Gq8VKq7G2sQxjYTkDmBkRT+lqLBHjPi5HZPO0LIbc5vRN+IKTP/1ShC L4bYb0B1hPzQQ== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1ulrJ9-00000006kXd-0ZNo; Tue, 12 Aug 2025 17:53:03 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Jonathan Corbet" , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v2 37/39] scripts: sphinx-pre-install: add support for RHEL8-based distros Date: Tue, 12 Aug 2025 17:52:54 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" On RHEL8, only installing with a venv is supported, as there's no Sphinx package using Python 3.7 or upper. Signed-off-by: Mauro Carvalho Chehab --- scripts/sphinx-pre-install | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index fc9dc45054d7..324baa98a395 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -691,7 +691,7 @@ class SphinxDependencyChecker(MissingCheckers): =20 super().__init__(args, texlive) =20 - self.need_pip =3D 0 + self.need_pip =3D False self.rec_sphinx_upgrade =3D 0 =20 self.system_release =3D self.get_system_release() @@ -840,9 +840,15 @@ class SphinxDependencyChecker(MissingCheckers): # RHEL 8 uses Python 3.6, which is not compatible with # the build system anymore. Suggest Python 3.11 if rel =3D=3D 8: - self.deps.add_package("python39", DepManager.SYSTEM_MANDAT= ORY) + self.check_program("python3.9", DepManager.SYSTEM_MANDATOR= Y) + progs["python3.9"] =3D "python39" + progs["yaml"] =3D "python39-pyyaml" + self.recommend_python =3D True =20 + # There's no python39-sphinx package. Only pip is supported + self.package_supported =3D False + if not self.distro_msg: self.distro_msg =3D \ "Note: RHEL-based distros typically require extra repo= sitories.\n" \ @@ -915,8 +921,9 @@ class SphinxDependencyChecker(MissingCheckers): # the build system anymore. Suggest Python 3.11 if rel =3D=3D 15: if not self.which(self.python_cmd): + self.check_program("python3.11", DepManager.SYSTEM_MAN= DATORY) + progs["python3.11"] =3D "python311" self.recommend_python =3D True - self.deps.add_package(self.python_cmd, DepManager.SYST= EM_MANDATORY) =20 progs.update({ "python-sphinx": "python311-Sphinx", @@ -1289,7 +1296,7 @@ class SphinxDependencyChecker(MissingCheckers): return self.latest_avail_ver =20 # Either there are already a virtual env or a new one should be cr= eated - self.need_pip =3D 1 + self.need_pip =3D True =20 if not self.latest_avail_ver: return None @@ -1344,10 +1351,11 @@ class SphinxDependencyChecker(MissingCheckers): """ =20 if self.recommend_python: - print("\nPython version is incompatible with doc build.\n" \ - "Please upgrade it and re-run.\n") - return - + cur_ver =3D sys.version_info[:3] + if cur_ver < MIN_PYTHON_VERSION: + print(f"\nPython version {cur_ver} is incompatible with do= c build.\n" \ + "Please upgrade it and re-run.\n") + return =20 # Version is OK. Nothing to do. if self.cur_version !=3D (0, 0, 0) and self.cur_version >=3D RECOM= MENDED_VERSION: @@ -1467,7 +1475,6 @@ class SphinxDependencyChecker(MissingCheckers): if sys.version_info < MIN_PYTHON_VERSION: self.need_pip =3D False print("Warning: python version is not supported.") - else: virtualenv_cmd =3D f"{self.python_cmd} -m venv" self.check_python_module("ensurepip") --=20 2.50.1