From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 2ACF63ECBE4 for ; Fri, 14 Aug 2026 21:44:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786743882; cv=none; b=J3QvsLZo9H8c9wEeXV3k/kT9aAj1w68vNmfY5qNpOWEEffl24ko7v113VW1eUzO8AEAxkoj00H2g/mi2ryjV6L/Zj8l+u0T3b3DvfXhgP4kztM1s4+M5gYbVmJ5kMe4N/BcSO5F2vOhyhoM7eoV6D9XmKVul4MXhYlSzy07JPgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786743882; c=relaxed/simple; bh=fAZZJUGfOXQNREoNQcCQIt84VLl0GenjAyfp+zuvKYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UYMhQB1EQk8/lHLGq3bGtOHGp7vSw6xg6ypZH8sbVL631MUfvYUFtdt43Npj5zIgxHgxShdeYUIzJsyM00ka827iM7CvoOuUqRLzt9dyoSxLO4AzJ7D+CxHtd3dTSjkfSWWxy+HM9bfqhUz+lkc+N5pZmHx45o3ZULP+ZzRbqB0= 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=CzHt3yUZ; arc=none smtp.client-ip=209.85.216.50 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="CzHt3yUZ" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-38e7109321dso1073262a91.3 for ; Fri, 14 Aug 2026 14:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786743879; x=1787348679; 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=5vjL0bcfCflpI7YejqKq7wVBmJ4etwCcXdP9FLIbDHQ=; b=CzHt3yUZkR0WUE4UgydEcn1OlSEtMjDJfU5FiOVfXcICu+zvpOAUzHte6bJTmz3RTo DKdLX3lyj0TKwPRcn/5XkKoxEMJSdCF6Eg7ZL3ei3BaVxIo37GE4HhFTjc/FcVz6IpSC t2kD0Hh7CwpQql3zf9gPn5P+GG/k5ZxsQkwzdWDjcKogFw8DEqsa+TAEcOSXSl2fhp0A 2rOgJTD64DpFPNAdBS7TpgLZVLeJ7vlUykXZB2Yb47SJV+RO0SvEj3d6JCy6eCAMgOEO 0XoMYs2mN/Q/zSRev7+n+aEuV1OpBIqYjvQOCr8eK2pA0BYvtJ3VqvXVvq8S9XoOkryn xCQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786743879; x=1787348679; 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=5vjL0bcfCflpI7YejqKq7wVBmJ4etwCcXdP9FLIbDHQ=; b=Wk68qthr8f8kmZM2ismk1kO8erYVQTA7kjMdPaW/ZSV6vWGQ/6Twxv7OV7sHsON79v eCG9hho5A//NvgrZn4+5ELFRQntGbM2QX0uYFG4Qd4BoBM3DAjJ3G7Oc7o0A9mu3xMh0 T2w931/q8gWmrXqN2r8rL1E8iUGXRDRUU6xsTq6IwGp9xBvu7kfeZcaDQSj+iWNuSH3R 0HZUryc+0/GEDjoFcpttnHqkn9JWvHhCQ14F88tUDNqQRUCixj2pI3MuQzzGptUOWlou USIAA4nEs/llCDERV5lWuQa2iNwiVXBIZoQ4eUWZWP9oRafeHM+EHrfo+TyXaVUY8tbL RBlA== X-Forwarded-Encrypted: i=1; AHgh+RoL4ghF2iQr13mlkIgctzJjor34m9zYXmcEXOsecEhMDGpFfJAXNXIeUd9rk9x7MzG272K9GZ1gDMuh/Us=@vger.kernel.org X-Gm-Message-State: AOJu0Yxkmk2nq0iwTkAFUlbf4/xxE40T52R1l5J8rVnXePbYE3iAd/6D fmX+OjRvNfx6HEpp/QtKsGzNT4uMmsyL4hRMZ2ypiBrcFQIVMb7re8oL X-Gm-Gg: AR+sD10ra2S5XcweSgiW/1vFTaaUQR5u0QW6vQfHAddD+qzgLFoO8F/kEYJbRX1KxaT 4FhKt5DR21n2F4W+J8sPGoATLK5iyAABHGoJyeBrO9E/XX2ACQ0acMXEVTYULR/GdAXERGmTX8b CzTDVDWmuRZFa3flWSXYGsPlxYf27evXOSUzofLKk3jDDCVuXFfRpAcGlaXNFh6cvfmnyS2ITB3 TtnY16OwXrXW7kiJXsb3IYvSk4iZGCTCwFsp1Vknk65uYHD1VM8Qg/f2KFnRj//fIUXsgozjmcS Y03UEvC+flWHD1N4I1bomsTKEVo1/sph/V3OgFDUErwIvQMjw3CbRajTJpML9iTdUxSxA4Eyk3/ U5vif8eaY1m4XJ6myMFEWbGc6CcVVv8KVAGPQe4KqHMQf3ecs/hVzHSWd92UmPg/w6xfG2t3Wel 8VTAKkyQz+EkvlgThXZUtvPsU8Va3Pl6V/5JOoIP8Zbu1aSqO1V0RCqLWMLHvPiw+Gl43KT+ScI ltuSXH/og7bSw== X-Received: by 2002:a17:90a:ec87:b0:38e:485c:ebd3 with SMTP id 98e67ed59e1d1-3933ba79ea4mr10017141a91.15.1786743879368; Fri, 14 Aug 2026 14:44:39 -0700 (PDT) Received: from localhost.localdomain ([64.186.250.142]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-320d5bd918fsm8083617eec.2.2026.08.14.14.44.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 14 Aug 2026 14:44:38 -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 v4 4/6] docs: sphinx-build-wrapper: prefer gmake Date: Sat, 15 Aug 2026 05:44:16 +0800 Message-ID: <20260814214419.49925-5-chenmiao.ku@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260814214419.49925-1-chenmiao.ku@gmail.com> References: <20260814214419.49925-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 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper index 1bb962202..994e5f7da 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,8 @@ 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, "LLVM=1", "rustdoc"] if self.verbose: print(" ".join(cmd)) -- 2.50.1 (Apple Git-155)