From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Gilio Subject: bug#38613: Disabling bytecompilation on a list of files. Date: Sun, 15 Dec 2019 16:26:09 -0600 Message-ID: <8736dl5ipq.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43730) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igcLx-0006Jg-Pi for bug-guix@gnu.org; Sun, 15 Dec 2019 17:27:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igcLw-0006Wt-06 for bug-guix@gnu.org; Sun, 15 Dec 2019 17:27:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59630) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igcLv-0006Ta-2j for bug-guix@gnu.org; Sun, 15 Dec 2019 17:27:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igcLv-0002Yl-0W for bug-guix@gnu.org; Sun, 15 Dec 2019 17:27:03 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Leo Prikler's message of "Sun, 15 Dec 2019 01:35:27 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Leo Prikler Cc: 38613@debbugs.gnu.org Leo Prikler writes: > Hey Brett. > > Am Dienstag, den 14.12.2019, 13:45 -0600 schrieb Brett Gilio: >> Just forwarding along an idea discussed between Leo Prikler, Tobias, >> and I on IRC. > Thanks for the mention ;) Any time! :) > >> Obviously just outright deleting the phase responsible for >> bytecompilation is not the _best_ solution. So what Leo and I >> proposed >> was adding a #:no-bytecomp which takes a list of REGEXP or files that >> will be excluded from the in-place byte-compilation. >> >> I wanted to float this idea by those of us who use the >> emacs-build-system regularly. > I actually came up with an alternative solution, that I already hinted > at in IRC. 0001 implements a function to disable byte compilation for > a single file, 0002 applies this to the package in question. I'm not > quite sure why the files are not writable and wonder, whether the chmod > should be added into 0001, but keeping it out of it should hopefully > prevent abuse. I am not sure why the file permissions are needing to be set either. On a git checkout it looks to me like they are the same as the others. I wonder if it might have something to do with the rename-file method moving the themes? Idk. > > It's rather late and this is just a proof of concept. I haven't fully > evaluated the impact this will have on Guix (specifically in the amount > of rebuilds it will cause). Also beware of my somewhat ill-formed > commit messages. After painfully checking each of the themes for this > bug however (on my machine, YMMV), I did update the comment for what > it's worth. > > Regards, > Leo > > From 365f5c02876b51cf566224f60cd6d4c6b7023d66 Mon Sep 17 00:00:00 2001 > From: Leo Prikler > Date: Sun, 15 Dec 2019 00:45:08 +0100 > Subject: [PATCH 1/3] guix: emacs-utils: Add emacs-batch-disable-compilation. > > * guix/build/emacs-utils.scm (emacs-batch-disable-compilation): > New procedure. > --- > guix/build/emacs-utils.scm | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm > index fdacd30dd6..2aa63c3363 100644 > --- a/guix/build/emacs-utils.scm > +++ b/guix/build/emacs-utils.scm > @@ -23,6 +23,7 @@ > #:export (%emacs > emacs-batch-eval > emacs-batch-edit-file > + emacs-batch-disable-compilation > emacs-generate-autoloads > emacs-byte-compile-directory > emacs-substitute-sexps > @@ -50,6 +51,12 @@ > (string-append "--visit=" file) > (format #f "--eval=~S" expr))) > > +(define (emacs-batch-disable-compilation file) > + (emacs-batch-edit-file file > + '(progn > + (add-file-local-variable 'no-byte-compile t) > + (basic-save-buffer)))) > + > (define (emacs-generate-autoloads name directory) > "Generate autoloads for Emacs package NAME placed in DIRECTORY." > (let* ((file (string-append directory "/" name "-autoloads.el")) > -- > 2.24.0 > > > From 3f376828d8970c0751b86aef0b49e256ee09287e Mon Sep 17 00:00:00 2001 > From: Leo Prikler > Date: Sun, 15 Dec 2019 00:49:26 +0100 > Subject: [PATCH 2/3] gnu: emacs-doom-themes: Only disable breaking > compilations. > > * gnu/packages/emacs-xyz.scm (emacs-doom-themes) [phases]: > : Undelete it. > : New phase. > --- > gnu/packages/emacs-xyz.scm | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm > index 505594aa0d..1c06a9122d 100644 > --- a/gnu/packages/emacs-xyz.scm > +++ b/gnu/packages/emacs-xyz.scm > @@ -19803,6 +19803,10 @@ contrast and few colors.") > (arguments > `(#:tests? #t > #:test-command '("ert-runner") > + #:modules ((guix build emacs-build-system) > + (guix build utils) > + (guix build emacs-utils) > + (srfi srfi-1)) > #:phases > (modify-phases %standard-phases > (add-after 'unpack 'move-themes > @@ -19813,12 +19817,21 @@ contrast and few colors.") > (rename-file f (basename f))) > (find-files "./themes" ".*\\.el$")) > #t)) > - ;; XXX: There is a byte-code overflow issue in the latest > - ;; checkout which affects byte-compilation for several theme > - ;; files. The easiest way to work around this is to disable > - ;; byte-compilation until the issue is resolved. > + ;; There is a byte-code overflow issue in the latest checkout > + ;; which affects byte-compilation for several (read `most') theme > + ;; files. In order to cope with this issue, we disable > + ;; byte-compilation until it is resolved. > ;; > - (delete 'build)))) > + (add-after 'move-themes 'disable-breaking-compilation > + (lambda _ > + (for-each (lambda (file) > + (chmod file #o600) > + (emacs-batch-disable-compilation file)) > + (cons "doom-themes-ext-neotree.el" > + (lset-difference string-contains > + (find-files "." ".*-theme.el") > + '("snazzy" "tomorrow-day")))) > + #t))))) > (synopsis "Wide collection of color themes for Emacs") > (description "Emacs-doom-themes contains numerous popular color themes for > Emacs that integrate with major modes like Org-mode.") Honestly, it looks fine enough to me. At least for a draft. Does anybody have any objections or feel an urge for a need for addition of something else? I think this feature is going to be useful, especially for allowing workarounds in cases like this which will certainly pop up again in the future. -- Brett M. Gilio Homepage -- https://scm.pw/ GNU Guix -- https://guix.gnu.org/