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 3A345C369CB for ; Tue, 22 Apr 2025 07:57:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF0D810E522; Tue, 22 Apr 2025 07:57:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kM4lIeci"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5540410E522; Tue, 22 Apr 2025 07:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745308666; x=1776844666; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/lTSfM6Y/HISGvvFEVe3OPn45W9JT8OSQOcThg92+mw=; b=kM4lIeciaxlpZlYb7okEhzF8HkYolRAlaqKtFn4gPhuH1htSSR07SJiY YGcVlJvI0JyKYGKVw/GrdARqSAN0rwAfwIhyBHL+jc+yQJLSV/4T+5mbh bTPo22llhB1g3mZS3c7eKoSFAhvaUWay6IyGmhwS5ASYqGsamfBczOGnX a1BqDxLU/RbXO0QTjK07RRa8oUb6vwId2JLhwcI2WlGo6+8cSZj4LOtmr VojBWjhd9eOO8SKi5hE3ZKoXueyb+Upk8YNXCqMz2HEL+SAxyZVcoCkW6 pZ5HwkMewiY60fGc3Fek1RJQAPec5nVin7lHRfiVLkW8VmydmfUccXnQa w==; X-CSE-ConnectionGUID: 6COGn/1+SOOiOf1cW/2WLA== X-CSE-MsgGUID: NXooZrzqRwe0AF9OILrTyQ== X-IronPort-AV: E=McAfee;i="6700,10204,11410"; a="45975723" X-IronPort-AV: E=Sophos;i="6.15,230,1739865600"; d="scan'208";a="45975723" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2025 00:57:42 -0700 X-CSE-ConnectionGUID: VwpwCzHATKWg4vMQsHRvBA== X-CSE-MsgGUID: rRtq3f3OR6ypAGEepqkY5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,230,1739865600"; d="scan'208";a="132482014" Received: from smile.fi.intel.com ([10.237.72.58]) by orviesa007.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2025 00:57:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98.2) (envelope-from ) id 1u78VZ-0000000EfNZ-26c4; Tue, 22 Apr 2025 10:57:33 +0300 Date: Tue, 22 Apr 2025 10:57:33 +0300 From: Andy Shevchenko To: Jonathan Corbet Cc: Dmitry Baryshkov , Mauro Carvalho Chehab , Linux Doc Mailing List , linux-kernel@vger.kernel.org, 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/2] Don't create Python bytecode when building the kernel Message-ID: References: <4k2arpghozy5fjrjove6nrh24qth3yp4educuso4y47gk7gycd@ol27dzrba55d> <87bjspzd4e.fsf@trenco.lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bjspzd4e.fsf@trenco.lwn.net> 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 Mon, Apr 21, 2025 at 10:35:29AM -0600, Jonathan Corbet wrote: > Dmitry Baryshkov writes: > > On Wed, Apr 16, 2025 at 03:51:03PM +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. > > > > Would it be possible to properly support O= and create pyc / pycache > > inside the object/output dir? > > I have to confess, I've been wondering if we should be treating the .pyc > files like we treat .o files or other intermediate products. Rather > than trying to avoid their creation entirely, perhaps we should just be > sure they end up in the right place and are properly cleaned up...? > > To answer Dmitry's question, it seems that setting PYTHONPYCACHEPREFIX > should do the trick? It's not so easy. The Python is written in a way that it thinks it will never runs object files separately from the source. Hence that variable sets only the folder per script as _home_ for the cache. It's completely unusable. They took it wrong. It still can be _painfully_ used, but it will make Makefiles uglier. -- With Best Regards, Andy Shevchenko