From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B202484246 for ; Wed, 12 Aug 2026 18:23:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786559029; cv=none; b=hU4yA08DqlA5gMATn3exeGCaOTr8Mt3FxicTKsfaeefnKTf0ZJOLuKL5oNLuGzk1nWynTl1QI7YxybHplkCfDM938XIkLHyuN+WrVxEmjOEop/ZRE5NPVu7pAQ3avADpSPl0tiCm2zLi2upYPqMXoFHB9DXLeWC9xcoZRDl/1X4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786559029; c=relaxed/simple; bh=MaNdeO0zxfUKATc6m2Zu/5VXWMWx8OHNL5C+gbM+wbs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q/t/8zX3ScxdKacw0A9F2YnStVupJjKBLypNjfHvT3LluXwBSqPxQ+N3JbL+7/RKEKhmj+2H5GExWLf4r9zYfRZzB+ptDtfyNvcsAOwy5u6iCv0pUoDzBpeY41ogaDpA9F8J1bW2PM0tiJIQ34GxYCJGKLzeUqWc+MZJdrbt4pE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OLtpfN69; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OLtpfN69" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2ccf2360620so13486515ad.3 for ; Wed, 12 Aug 2026 11:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786559028; x=1787163828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SO08RG/xBwrspSzwFkkCTaYAqts8IHVXj2FA5i4967M=; b=OLtpfN69W/sBsGej2/2F7EEIhcFFDGAUFu1oNUtUujC+Z0ELoXSzbsZuWqcf6k0h3w Kz8O0D7zWdCegQDQv/A9yhOA4IMVlguwfDklMPDLJiRrFbkzHPa4w2u3pLui5WXyZryF Ra0S8T8gMw8dgL+chIVILRyIXKj3hi6n3W+48YQrC4ag5MUazIMICdvVjg0WQKyrW+ox VJkQHD4Ub3Zl0r7KFESQRnJpRkq6/DqvJXwoos/jdT+uuN475YaV66LDLHdsseq2Bo9U jW9r4fRFUfNOJkoT/M+oa26Y76XfjjRS9f8x/am2hxm2FVwFZkKyS5U4j5LdYJedRqPu 4nyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786559028; x=1787163828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=SO08RG/xBwrspSzwFkkCTaYAqts8IHVXj2FA5i4967M=; b=fozA+40YOlA5U3qx536XRoQ3dX4/koLM5kF9iwlBGxr0T06Z81e3facqRWZWCE6ND8 9p9SFI/mnbLB0rxJFW/XeS6cN9N3NmBA9J3JLpA8VY3pgV9Ou8IVHYyuqIiwSmyhcDkj XZ8w1Su0ggUn4eRj6eF9zQLKt8zq1WOquvwX6MroUOy2+EUMcuBEp94jM8eoNuH+KftD jD7s96hFdV7krCNcQ1NM2A9pPWuRDwmJpcouDq18YT4+s7jI2eR1pQ9TL+iAEXj7nu2I 4aciQYhEjV3SeBNMY5V73FT57DmbZuE23fzFmFMUzR5OC62ARa2aq7nO2TVJDsDdo6rW 2clA== X-Forwarded-Encrypted: i=1; AHgh+RomVfUUabwoPrW814zbPvVo2TvB7BXk5fDYdH54bnMalq0sReKXR9kac1r11rH66tRu5IRiLyJUf9zENoM=@vger.kernel.org X-Gm-Message-State: AOJu0YwbwRii4xUDOYfSTURdVKaL4/URthg0gCvm499wX6xxjvV8ptdL osHVYT3CUr5mVROYVvSJXbS0Ab7CfKxRo/AyRLH/S12Z+fZZqwS3L59l X-Gm-Gg: AR+sD10pnhHtWhOWXzeO9pcU1dCcKH4gVCI8DgbO97+jK0QERJ1y+fzFpKF92z6LUqQ RfSyKB1VrCwrroW5CziCvnDz1PqVtKy1MnGw5KbNU87K0ojryU9zgTg1RKkDF8gdHlfVFYxdJ0N 0OrCSHRS+HoALjojt758cNlTVjrvvRkLzb7RQ+ig7sASUyK3yEi6lIHa2cxCrKahfylBckggdRV Ewd+tkBPSvogM42Apv54hbivDs7djBzQLwDKmp6PznMhIZvkE725s0Kenh/aac5xemCDAivxrQt mqT2SQ6wUVYwNFmplTOPwdfd8BowplDMXtqyfmZFob+cNt2haeqC15Aot3O2Gs2+6/PXSg2J/Kn Hc78Y3i7IrlVYYrzor28NRzxBqAat/34SqJTClneWNr8EpSAQRM8CmObYAHuEMeI9M5wxV82H64 J1Eonq6WP2vObLAWEuHkYpwSqniACdf5jtDOS4OvDWSo8X3/RGVqsFV9TM+Qi0kn/D0KeTg3wcY W9haFjiDDyx8A== X-Received: by 2002:a05:6a20:3d1a:b0:3bf:9b61:f7ae with SMTP id adf61e73a8af0-3cc55195b34mr482617637.14.1786559027764; Wed, 12 Aug 2026 11:23:47 -0700 (PDT) Received: from localhost.localdomain ([64.186.250.142]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31cf3c08163sm12127695eec.7.2026.08.12.11.23.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Aug 2026 11:23:47 -0700 (PDT) From: Chen Miao To: corbet@lwn.net, alexs@kernel.org, si.yanteng@linux.dev, skhan@linuxfoundation.org, dzm91@hust.edu.cn, mchehab@kernel.org, wy@wyuan.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Miao Subject: [PATCH v3 4/6] docs: sphinx-build-wrapper: prefer gmake Date: Thu, 13 Aug 2026 02:23:21 +0800 Message-ID: <20260812182327.53694-5-chenmiao.ku@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260812182327.53694-1-chenmiao.ku@gmail.com> References: <20260812182327.53694-1-chenmiao.ku@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Homebrew installs GNU Make as gmake on macOS, but the Sphinx build wrapper invokes make directly when generating Info and Rust documentation. This can make the dependency check succeed while those documentation targets still use an incompatible make implementation. Honor MAKE when it names a compatible GNU Make. Otherwise check gmake and then make, selecting the first GNU Make 4.0 or newer. Use the common kdoc detector to keep this selection consistent with sphinx-pre-install. Signed-off-by: Chen Miao --- tools/docs/sphinx-build-wrapper | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper index 1bb962202..15c7e0938 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -63,6 +63,7 @@ SRC_DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) from kdoc.python_version import PythonVersion +from kdoc.gmake_detect import find_gmake from kdoc.latex_fonts import LatexFontChecker from jobserver import JobserverExec # pylint: disable=C0413,C0411,E0401 @@ -97,6 +98,14 @@ class SphinxBuilder: with the Kernel. """ + def get_make(self): + """Select the first GNU Make 4.0 or newer in preference order.""" + make = find_gmake(self.env.get("MAKE")) + if make: + return make + + sys.exit("GNU Make 4.0 or newer is required") + def get_path(self, path, use_cwd=False, abs_path=False): """ Ancillary routine to handle patches the right way, as shell does. @@ -569,9 +578,10 @@ class SphinxBuilder: texinfo directory. """ + make = self.get_make() for output_dir in output_dirs: try: - subprocess.run(["make", "info"], cwd=output_dir, check=True) + subprocess.run([make, "info"], cwd=output_dir, check=True) except subprocess.CalledProcessError as e: sys.exit(f"Error generating info docs: {e}") @@ -787,12 +797,11 @@ class SphinxBuilder: if rustdoc and target in ["htmldocs", "epubdocs"]: print("Building rust docs") - if "MAKE" in self.env: - cmd = [self.env["MAKE"]] - else: - cmd = ["make", "LLVM=1"] - - cmd += [ "rustdoc"] + make = self.get_make() + cmd = [make] + if make != self.env.get("MAKE"): + cmd.append("LLVM=1") + cmd.append("rustdoc") if self.verbose: print(" ".join(cmd)) -- 2.50.1 (Apple Git-155)