From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.emacs.devel Subject: Possibly defaulting native-compile-target-directory to XDG_CACHE_HOME/... Date: Fri, 16 Dec 2022 00:08:37 -0600 Message-ID: <871qozyj6i.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17150"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 16 07:09:59 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p63uw-0004Ed-Au for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Dec 2022 07:09:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p63uD-00066q-HS; Fri, 16 Dec 2022 01:09:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p63uC-00066i-9X for emacs-devel@gnu.org; Fri, 16 Dec 2022 01:09:12 -0500 Original-Received: from defaultvalue.org ([45.33.119.55]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p63uA-0006tq-F5 for emacs-devel@gnu.org; Fri, 16 Dec 2022 01:09:11 -0500 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id B551D203AD for ; Fri, 16 Dec 2022 00:08:38 -0600 (CST) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id AFDF414E09D; Fri, 16 Dec 2022 00:08:37 -0600 (CST) Received-SPF: pass client-ip=45.33.119.55; envelope-from=rlb@defaultvalue.org; helo=defaultvalue.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301478 Archived-At: We're still trying to resolve some native compilation related crashes in Debian in the hope that we'll be able to have 28 in the next stable release --with-native-compilation. (Stage one of the freeze begins on Jan 12.) One remaining issue is that emacs crashes when HOME=/nope in some of our test suites and perhapssome other packaging or install-related activities. For example: https://bugs.debian.org/1021842 (To refresh, Debian policies require packages not to write outside of a few specified locations in certain situations, e.g. package builds, and HOME is not one of the specified locations.) I can't recall from previous discussions whether that crash would be considered a bug, or whether emacs just requires a writable cache dir now (which is fine if so). But I have discovered that if we allow the redirection of the native-compile-target-directory to XDG_CACHE_HOME via something like this in comp.el: (defvar native-compile-target-directory (getenv "XDG_CACHE_HOME") "When non-nil force the target directory for the eln files being compiled.") then we can resolve the issue: export HOME=/nope export XDG_CACHE_HOME="$(mktemp -d ...)" run-tests... Of course, I assume the default above isn't quite right, i.e. if we were to pursue this, I imagine we'd actually want to default native-compile-target-directory to something more like "$XDG_CACHE_HOME/emacs/eln-cache" when XDG_CACHE_DIR is set. I also noticed that emacs already respects XDG_CONFIG_HOME, so I imagined relying on XDG_CACHE_HOME might not be entirely suspect. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4