From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Whatson Newsgroups: gmane.emacs.bugs Subject: bug#43875: feature/native-comp; Fix another failure when eln-cache is removed Date: Fri, 9 Oct 2020 11:38:09 +1000 Message-ID: <20201009013808.3450325-1-whatson@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27279"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrew Whatson To: 43875@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 03:41:19 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kQhPK-000717-UP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 03:41:19 +0200 Original-Received: from localhost ([::1]:57434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQhPJ-0000AS-TH for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 21:41:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQhP4-000090-Nl for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQhP4-00039N-Do for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQhP4-0000sS-By for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2020 01:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43875 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16022076093305 (code B ref -1); Fri, 09 Oct 2020 01:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Oct 2020 01:40:09 +0000 Original-Received: from localhost ([127.0.0.1]:33548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhOD-0000rE-8G for submit@debbugs.gnu.org; Thu, 08 Oct 2020 21:40:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQhOB-0000r7-Hq for submit@debbugs.gnu.org; Thu, 08 Oct 2020 21:40:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQhOB-000893-95 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:40:07 -0400 Original-Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:35730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQhO9-0002q9-BE for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2020 21:40:07 -0400 Original-Received: by mail-pg1-x52d.google.com with SMTP id g29so5880245pgl.2 for ; Thu, 08 Oct 2020 18:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0kq0IYQ7sC5UlzDUUSZphSmo8UBRvw32jkrqZ8uBTXA=; b=hZSvhfyd6dgFe66iJ6niA9uaCpcBQ2pY653OAlmd3HF3ciydrX0Jx+I2oVtjJXtqgS I7eUp87bgpCumhoVp5qlB0uUVbwpfLTcAZlE7NtnL3LujVJOlpPe9/yMKziYiI+qcClR VoKvaYSSOlWkF4JPofX2hQDQtBrNs0nrTi8FJruoZiOyX/nRmyq+UGLUnpntfG4GCA3m CKKaoizCrp7wu0/a+CbVFj6KtRNp9bUIHorjhd2PZoVfHoH4e4gbzXocI2V1svO7j2zu 4WHYpkbajEDF+hhRg7Spg+Ziey4i0+dsOTJfms3rr+K1TN1PZbsTMROmfLkg32SDhcGd /GEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0kq0IYQ7sC5UlzDUUSZphSmo8UBRvw32jkrqZ8uBTXA=; b=hvaB7kX/1otwFkE0q996AJFVa2DzZeAOQPaFahWs9nAEBBLJUxi5M/r+PrIsvc7v7/ 9xA/dr1/ZocoKgcWTJFjDxoZ1m0iSx3jIEEtma6G4Ze2ncmss46Muv39KsCg76b1vJ3+ untivEKk8ZmQaiBeGTGysBmA8fYbxrtq3iEWs4arZ9WN2Aa7x6Sz/FJfXTj4ZP1YLDrJ zaABMYZT2EhoQNKUVARHFyBf8mb4e22SQRnLpEP7RPY9wZcj7wqj+nDG2skXrrAa11C9 eieOtJxCCnD10qeu79uTQo3aUy6m9H/fMgGmQnkwQMZuco5n5S3WG32e045Sfm6Rab8q KNRQ== X-Gm-Message-State: AOAM530KKnwaOWa0J3WVtvulX8aA6SvXdGRlE2c0EuhOveclOSv/uv5c fQcJhJncb9WDGgEo/82f0D+Bs1rDmtQ= X-Google-Smtp-Source: ABdhPJyDCsfPkrFMh/zGHhgDFp0cQ4lDkON7rtIMc/owiUxKBMu1YiRTNKiMmslKxpHgHcbkk28+Sg== X-Received: by 2002:a17:90a:9505:: with SMTP id t5mr1830188pjo.121.1602207601404; Thu, 08 Oct 2020 18:40:01 -0700 (PDT) Original-Received: from muon.fritz.box (61-68-62-152.tpgi.com.au. [61.68.62.152]) by smtp.gmail.com with ESMTPSA id g4sm8812881pgg.75.2020.10.08.18.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 18:40:00 -0700 (PDT) X-Mailer: git-send-email 2.28.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=whatson@gmail.com; helo=mail-pg1-x52d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190123 Archived-At: * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix typo in name. Attempt to create eln-cache directory before failing with writability error. Change error to be consistent. --- lisp/emacs-lisp/comp.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 763d44a23e..78f2ca696c 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2580,7 +2580,7 @@ comp-search-trampoline when (file-exists-p filename) do (cl-return filename))) -(defun comp-tampoline-compile (subr-name) +(defun comp-trampoline-compile (subr-name) "Synthesize and compile a trampoline for SUBR-NAME and return its filename." (let ((trampoline-sym (comp-trampoline-sym subr-name)) (lambda-list (comp-make-lambda-list-from-subr @@ -2608,9 +2608,13 @@ comp-tampoline-compile (comp-trampoline-filename subr-name) (concat dir comp-native-version-dir)) - when (file-writable-p f) + when (or (file-writable-p f) + (unwind-protect + (progn + (make-directory (file-name-directory f) t) + t))) do (cl-return f) - finally (error "Can't find a writable directory in \ + finally (error "Cannot find suitable directory for output in \ `comp-eln-load-path'"))))) ;;;###autoload @@ -2621,7 +2625,7 @@ comp-subr-trampoline-install (let ((trampoline-sym (comp-trampoline-sym subr-name))) (cl-assert (subr-primitive-p (symbol-function subr-name))) (load (or (comp-search-trampoline subr-name) - (comp-tampoline-compile subr-name)) + (comp-trampoline-compile subr-name)) nil t) (cl-assert (subr-native-elisp-p (symbol-function trampoline-sym))) -- 2.28.0