From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BFDFC369CA for ; Sat, 19 Apr 2025 16:15:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5517C10E452; Sat, 19 Apr 2025 16:15:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cpswxk4u"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 461D910E092; Sat, 19 Apr 2025 16:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745079302; x=1776615302; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=1lL19XfUqEwKIcHE307+MGee0gbFnU3PXLODld9yEr4=; b=cpswxk4uvpxeFH8nVzdWNb/IRFHHfjT6citcEIHf0wDqKdQZ6zfYbdwQ j74UXCpkFbH+f79YCRqKxg2CqYKXis0Vh9q3aUBgJhJgxZwLXpMpOmOON mnude6Nr2u8RfTaP4wM2fuWHhNjgct9WzfsuOFwoMOpu3h+lXYjGpqgmU vVpT1PPoQuboe4vHbb4FfIbKgaJ87VNJfy0Fxyis6PS2gfr4162jyemM3 ybr8v49MfPLUGYhdX+MfMQZ1NglVvnvaZZrC0Blf4dy6RDMLuJfOmGx/p vX57S0uOqcUfIg3CVXp5TtJU5tAZ9JTRhCUYZo/OOofrAVqjZdeBz72Ta Q==; X-CSE-ConnectionGUID: w2N97vsOTLmheKgKTsdg7g== X-CSE-MsgGUID: z82dHODPSY+JST+Gd9UKmA== X-IronPort-AV: E=McAfee;i="6700,10204,11408"; a="58059148" X-IronPort-AV: E=Sophos;i="6.15,224,1739865600"; d="scan'208";a="58059148" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2025 09:15:01 -0700 X-CSE-ConnectionGUID: 8p+RqmlBQMuXCyHFW50Q4g== X-CSE-MsgGUID: fVr3TMPGT+u/BT4PcUDyEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,224,1739865600"; d="scan'208";a="131920411" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 19 Apr 2025 09:14:56 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2B1A9170; Sat, 19 Apr 2025 19:14:54 +0300 (EEST) Date: Sat, 19 Apr 2025 19:14:54 +0300 From: Andy Shevchenko To: Mauro Carvalho Chehab Cc: Linux Doc Mailing List , linux-kernel@vger.kernel.org, Jonathan Corbet , David Airlie , Jani Nikula , Joonas Lahtinen , Maarten Lankhorst , Masahiro Yamada , Maxime Ripard , Nathan Chancellor , Nicolas Schier , Rodrigo Vivi , Simona Vetter , Thomas Zimmermann , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH v3 0/4] Don't create Python bytecode when building the kernel Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Sat, Apr 19, 2025 at 07:50:01AM +0800, Mauro Carvalho Chehab wrote: > As reported by Andy, the Kernel build system runs kernel-doc script for DRM, > when W=1. Due to Python's normal behavior, its JIT compiler will create > a bytecode and store it under scripts/lib/*/__pycache__. As one may be using > O= and even having the sources on a read-only mount point, disable its > creation during build time. > > This is done by adding PYTHONDONTWRITEBYTECODE=1 on every place > where the script is called within Kbuild and when called via another script. > > This only solves half of the issue though, as one may be manually running > the script by hand, without asking Python to not store any bytecode. > This should be OK, but afterwards, git status will list the __pycache__ as > not committed. To prevent that, add *.pyc to .gitignore. > > This series contain 4 patches: > > - patch 1 adjusts a variable that pass extra data to scripts/kerneldoc.py; > - patch 2moves scripts/kernel-doc location to the main makefile > and exports it, as scripts/Makefile.build will need it; > - patch 3 disables __pycache__ generation and ensure that the entire Kbuild > will use KERNELDOC var for the location of kernel-doc; > - patch 4 adds *.pyc at the list of object files to be ignored. This one works for me, thanks! Tested-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko