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 A810EC369D7 for ; Wed, 23 Apr 2025 16:31:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06B9B10E219; Wed, 23 Apr 2025 16:31:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="hlvTPiQd"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C10610E219; Wed, 23 Apr 2025 16:31: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=1745425906; x=1776961906; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rHHe/8RhyPpADAv2wMNhicCGW725SUetgJ9BCqcDqjo=; b=hlvTPiQdzoIL0kWzctuYARFsIG5qYFAZMKyaO9Z3I3N9GtrkahbozY5h XzkkPvPMSgr2JpegPJbE589iV11E5ZZY8v+7/i98yHhcNLLysBPqi8qjw RK+XG7d/57aG94XEBxHOlJr01cipjtjovzezTyT9XNjT/Pc4dVnzCgqGZ 0HC+19xN8oYzsTMlGo0LKpJCRNXy3oDD2CCs5MeLuTqdxm98Dcx/AGvos 9dXJn1jivbpEiOGShMrecVZerLmq652Jww5B4TjsNZYqYgEIEVLGIUitO ofgbZv+yBshnrR/23Q+mciFE0Jtf9qLWcC7TsPuVuhIHFZg3L/3HFdEUz g==; X-CSE-ConnectionGUID: nlurddbgQ9a/eD4s8m50WA== X-CSE-MsgGUID: OcF3gdOBRQug+TkxuzBS/A== X-IronPort-AV: E=McAfee;i="6700,10204,11412"; a="50830451" X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="50830451" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 09:31:46 -0700 X-CSE-ConnectionGUID: uLr7sJu1QAGKYY4H1GMrRw== X-CSE-MsgGUID: Rzl/IukPSwmtIFv8RfavZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="137220613" Received: from smile.fi.intel.com ([10.237.72.58]) by orviesa003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 09:31:41 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98.2) (envelope-from ) id 1u7d0a-0000000F7Fm-3nZd; Wed, 23 Apr 2025 19:31:36 +0300 Date: Wed, 23 Apr 2025 19:31:36 +0300 From: Andy Shevchenko To: Akira Yokosawa Cc: airlied@gmail.com, corbet@lwn.net, dmitry.baryshkov@oss.qualcomm.com, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, maarten.lankhorst@linux.intel.com, masahiroy@kernel.org, mchehab+huawei@kernel.org, mripard@kernel.org, nathan@kernel.org, nicolas.schier@linux.dev, rodrigo.vivi@intel.com, simona@ffwll.ch, tursulin@ursulin.net, tzimmermann@suse.de Subject: Re: [PATCH v3 0/2] Don't create Python bytecode when building the kernel Message-ID: References: <5cc4d9dd-496e-4512-a683-272b1b84d98b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cc4d9dd-496e-4512-a683-272b1b84d98b@gmail.com> 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 Wed, Apr 23, 2025 at 06:30:48PM +0900, Akira Yokosawa wrote: > On Tue, 22 Apr 2025 10:57:33 +0300, Andy Shevchenko wrote: > > On Mon, Apr 21, 2025 at 10:35:29AM -0600, Jonathan Corbet wrote: > >> Dmitry Baryshkov writes: [...] > >> > 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. > > But, PYTHONPYCACHEPREFIX can be set as an environment variable. > > For example, try: > > export PYTHONPYCACHEPREFIX="$HOME/.cache/__pycache__" > > Wouldn't it be good enough for you? Of course not. We have _many_ scripts in python in kernel and having a cache there for _all_ of them is simply WRONG. You never know what clashes can be there with two complicated enough scripts which may have same module names, etc. -- With Best Regards, Andy Shevchenko