From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qNsZMNvauF/GXQAA0tVLHw (envelope-from ) for ; Sat, 21 Nov 2020 09:16:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6MjmK9vauF+4FwAAbx9fmQ (envelope-from ) for ; Sat, 21 Nov 2020 09:16:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2BAD3940341 for ; Sat, 21 Nov 2020 09:16:11 +0000 (UTC) Received: from localhost ([::1]:35610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgP05-0004df-WB for larch@yhetil.org; Sat, 21 Nov 2020 04:16:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgOzy-0004dM-3W for guix-patches@gnu.org; Sat, 21 Nov 2020 04:16:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgOzx-0002S9-SQ for guix-patches@gnu.org; Sat, 21 Nov 2020 04:16:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kgOzx-0007HB-O0 for guix-patches@gnu.org; Sat, 21 Nov 2020 04:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44775] [PATCH] WIP: Add gccemacs Resent-From: John Soo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 21 Nov 2020 09:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44775 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44775@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160595015427951 (code B ref -1); Sat, 21 Nov 2020 09:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Nov 2020 09:15:54 +0000 Received: from localhost ([127.0.0.1]:44856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgOzp-0007Gk-D1 for submit@debbugs.gnu.org; Sat, 21 Nov 2020 04:15:53 -0500 Received: from lists.gnu.org ([209.51.188.17]:35022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgOzn-0007Ga-D5 for submit@debbugs.gnu.org; Sat, 21 Nov 2020 04:15:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgOzl-0004cb-Or for guix-patches@gnu.org; Sat, 21 Nov 2020 04:15:51 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:39863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgOzh-0002Iz-Ol for guix-patches@gnu.org; Sat, 21 Nov 2020 04:15:49 -0500 Received: by mail-pg1-x532.google.com with SMTP id f17so1014034pge.6 for ; Sat, 21 Nov 2020 01:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=wkK/00oL6EbR3zf5CwbZmObQ8NQkppgtZlIbjX+c2wg=; b=F+zZTZ/je2OEZlL2E8HBv2FcnYaSZI2lqbjx2SMHMNUiBjnUjbnXF8mAKLSMc2nOQM 84VExM+NgEZfin6bbxeVEYfmRjp1lxzOom5rukTEAO4Uv20A5c1Z6VJ9/jTfDCRUtXJk IaFwohpuUFsbTpmuCjFMSRI2HJmWveBJSae2ph2E2vsjwD52kGZSEN7vTrjtcqIxU3yG Co/MSZl8dp6ikfcSCOgiIHgFdJ+/iWR4yIgluTai57dPTSSgNjcXC0LyO/YWJP9xOmeS 9m4/ZbBMOk6Fh/hP8bjWVwgwdUDp9BvqPQAXlmbBk1957pZaNY1UUN5/GWtujdziwhHJ UQeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=wkK/00oL6EbR3zf5CwbZmObQ8NQkppgtZlIbjX+c2wg=; b=TnhRsSN2C7z7nrXqd3obHOTKfaNj3QQ+Q9+AZLTFj+rD68lpt4//k1z75HIQZ40hYR H45R3ukEMUDmXleVfoTkfg0jdup8HyAnJj3i5maJKYw05fh/0VGY8kwccHvTJesxo76e nuTihnxM1EyvZO7VREchxnJpSmi9IXqnEb3lbe5lVO2Ki79OAdjoBE5sczSefKuG9LhC u6IakzqA7DeeVl6BfFaThTQah8MCa9ep+VHXdWCYi2KkLnTWQ7Re/lo813gbWjUSEvGW 79ITR5NKexPSHvXIFMwHOPmJSArMkPLX2tXfF1K+oEGT0xDlxq4UrjfmoZrOVCeefpdd KT5A== X-Gm-Message-State: AOAM533oG0ldtjBJZybA60+gqPbM+DK45Te7V2/9jzWGOe0gGv8mHBH+ Ksss8Prh0Px8S5GaRptFZaLqMfmSy00fbQ== X-Google-Smtp-Source: ABdhPJyoV/4qlHF3sP+tOP61PLxp7WdcTxoyb/tCZJPMGFUBcWE372D6viN9IJdZueqkXMYfEDpCNg== X-Received: by 2002:a63:5f14:: with SMTP id t20mr20936468pgb.305.1605950143024; Sat, 21 Nov 2020 01:15:43 -0800 (PST) Received: from ecenter ([2600:1700:83b0:8bd0::7a8]) by smtp.gmail.com with ESMTPSA id h9sm808379pgh.3.2020.11.21.01.15.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Nov 2020 01:15:41 -0800 (PST) From: John Soo Date: Sat, 21 Nov 2020 01:15:40 -0800 Message-ID: <874kljnk8z.fsf@asu.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=jsoo1@asu.edu; helo=mail-pg1-x532.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=asu-edu.20150623.gappssmtp.com header.s=20150623 header.b=F+zZTZ/j; dmarc=fail reason="SPF not aligned (relaxed)" header.from=asu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.59 X-TUID: 6Y4dTsbzcw1x --=-=-= Content-Type: text/plain Hi Guix, I was curious how fast this gccemacs branch might be, so I got it to compile. It feels fast but there are bugs and the closure is huge. Also these patches do not use any of the parameterization machinery. I just thought I would share my work. Thanks, John --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-emacs-next-no-x.patch Content-Transfer-Encoding: quoted-printable >From 642c087de1592aeea0e65d04589423a05a96d68e Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 21 Nov 2020 00:56:30 -0800 Subject: [PATCH 1/3] gnu: Add emacs-next-no-x. * gnu/packages/emacs.scm (emacs-next-no-x): New variable. --- gnu/packages/emacs.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 4f5a67093c..2d9f2e7ec1 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -22,6 +22,7 @@ ;;; Copyright =C2=A9 2019 Amin Bandali ;;; Copyright =C2=A9 2020 Jack Hill ;;; Copyright =C2=A9 2020 Morgan Smith +;;; Copyright =C2=A9 2020 John Soo ;;; ;;; This file is part of GNU Guix. ;;; @@ -376,6 +377,27 @@ editor (console only)") (delete 'restore-emacs-pdmp) (delete 'strip-double-wrap))))))) =20 +(define-public emacs-next-no-x + (package + (inherit emacs-next) + (name "emacs-next-no-x") + (synopsis (package-synopsis emacs-no-x)) + (build-system gnu-build-system) + (arguments + (substitute-keyword-arguments (package-arguments emacs-next) + ((#:configure-flags flags) + `(append '("--with-x-toolkit=3Dno" + "--with-xpm=3Dno" + "--with-jpeg=3Dno" + "--with-gif=3Dno" + "--with-tiff=3Dno") + ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (delete 'restore-emacs-pdmp) + (delete 'strip-double-wrap))))) + (inputs (package-inputs emacs-no-x)))) + (define-public emacs-no-x-toolkit (package/inherit emacs (name "emacs-no-x-toolkit") --=20 2.29.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-Add-gccemacs.patch >From 3d1948d2512a5fc09ed36de752fb36178517cab2 Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 21 Nov 2020 00:57:27 -0800 Subject: [PATCH 2/3] gnu: Add gccemacs. * gnu/packages/emacs.scm (gccemacs): New variable. Add supporting definitions for gccemacs-{version,commit,source} for other gccemacsen. --- gnu/packages/emacs.scm | 89 +++++++++++++++++++ gnu/packages/patches/gccemacs-exec-path.patch | 18 ++++ 2 files changed, 107 insertions(+) create mode 100644 gnu/packages/patches/gccemacs-exec-path.patch diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 2d9f2e7ec1..6312fde3ad 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -53,6 +53,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages fribidi) + #:use-module (gnu packages gcc) #:use-module (gnu packages gd) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) @@ -398,6 +399,94 @@ editor (console only)") (delete 'strip-double-wrap))))) (inputs (package-inputs emacs-no-x)))) +;; feature/native-comp +(define-public gccemacs-commit + "6781cd670d1487bbf0364d80de68ca9733342769") + +(define-public gccemacs-version + (git-version "28.0.50" "0" gccemacs-commit)) + +(define-public gccemacs-source + (origin + (method git-fetch) + (uri (git-reference + (url "git://git.sv.gnu.org/emacs.git") + (commit gccemacs-commit))) + (sha256 + (base32 + "13pmrak5jvk5qp4i5iccn0fqa6by8ig8l0n3qqirm67dxrqiz2ya")) + (patches (search-patches "gccemacs-exec-path.patch" + "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" + "emacs-source-date-epoch.patch")) + (modules '((guix build utils))) + (snippet + '(with-directory-excursion "lisp" + ;; Delete the bundled byte-compiled elisp files and generated + ;; autoloads. + (for-each delete-file + (append (find-files "." "\\.elc$") + (find-files "." "loaddefs\\.el$") + (find-files "eshell" "^esh-groups\\.el$"))) + + ;; Make sure Tramp looks for binaries in the right places on + ;; remote Guix System machines, where 'getconf PATH' returns + ;; something bogus. + (substitute* "net/tramp-sh.el" + ;; Patch the line after "(defcustom tramp-remote-path". + (("\\(tramp-default-remote-path") + (format #f "(tramp-default-remote-path ~s ~s ~s ~s " + "~/.guix-profile/bin" "~/.guix-profile/sbin" + "/run/current-system/profile/bin" + "/run/current-system/profile/sbin"))) + + ;; Make sure Man looks for C header files in the right + ;; places. + (substitute* "man.el" + (("\"/usr/local/include\"" line) + (string-join + (list line + "\"~/.guix-profile/include\"" + "\"/var/guix/profiles/system/profile/include\"") + " "))) + #t)))) + +(define add-libgccjit-gcc-lib-to-library-path + '(lambda* (#:key inputs #:allow-other-keys) + (let* ((libgccjit (assoc-ref inputs "libgccjit")) + (gcc-dirs (find-files + libgccjit "^gcc$" #:directories? #t)) + (gcc-dirs-paths (string-join gcc-dirs ":")) + (prepend-to-env (lambda (val var) + (setenv + var (string-append + val + (or (getenv var) "")))))) + (prepend-to-env gcc-dirs-paths "LIBRARY_PATH") + (prepend-to-env gcc-dirs-paths "LD_LIBRARY_PATH") + (prepend-to-env gcc-dirs-paths "PATH") + #t))) + +(define-public gccemacs + (package + (inherit emacs-next) + (name "gccemacs") + (version gccemacs-version) + (source gccemacs-source) + (synopsis "The extensible, customizeable, self-documenting text +editor (from the native compilation branch)") + (inputs + `(("libgccjit" ,(canonical-package libgccjit)) + ,@(package-inputs emacs-next))) + (arguments + (substitute-keyword-arguments (package-arguments emacs-next) + ((#:phases p) + `(modify-phases ,p + (add-after 'bootstrap 'add-libgccjit-gcc-lib-to-library-path + ,add-libgccjit-gcc-lib-to-library-path))) + ((#:configure-flags flags ''()) + `(cons "--with-nativecomp" ,flags)))))) + (define-public emacs-no-x-toolkit (package/inherit emacs (name "emacs-no-x-toolkit") diff --git a/gnu/packages/patches/gccemacs-exec-path.patch b/gnu/packages/patches/gccemacs-exec-path.patch new file mode 100644 index 0000000000..3c75f9465e --- /dev/null +++ b/gnu/packages/patches/gccemacs-exec-path.patch @@ -0,0 +1,18 @@ +Do not capture the build-time value of $PATH in the 'emacs' executable +since this can noticeably increase the size of the closure of Emacs +with things like GCC being referenced. + +diff --git a/lisp/loadup.el.old b/lisp/loadup.el +index 158a4bf..f853a48 100644 +--- a/lisp/loadup.el ++++ b/lisp/loadup.el +@@ -509,7 +509,8 @@ lost after dumping"))) + ((equal dump-mode "dump") "emacs") + ((equal dump-mode "bootstrap") "emacs") + ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") +- (t (error "unrecognized dump mode %s" dump-mode))))) ++ (t (error "unrecognized dump mode %s" dump-mode)))) ++ (exec-path nil)) + (when (and (featurep 'nativecomp) + (equal dump-mode "pdump")) + ;; Don't enable this before bootstrap is completed the as the -- 2.29.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-Add-gcceamcs-no-x.patch >From f23ebabab5e57b22b45fea3a26f9a1814331f39a Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 21 Nov 2020 00:59:14 -0800 Subject: [PATCH 3/3] gnu: Add gcceamcs-no-x. * gnu/packages/emacs.scm (gccemacs-no-x): New variable. --- gnu/packages/emacs.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 6312fde3ad..721a13f429 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -487,6 +487,26 @@ editor (from the native compilation branch)") ((#:configure-flags flags ''()) `(cons "--with-nativecomp" ,flags)))))) +(define-public gccemacs-no-x + (package/inherit emacs-next-no-x + (name "gccemacs-no-x") + (version gccemacs-version) + (source gccemacs-source) + (synopsis "The extensible, customizable, self-documenting text +editor (console only, from the native compilation branch)") + (build-system gnu-build-system) + (inputs + `(("libgccjit" ,(canonical-package libgccjit)) + ,@(package-inputs emacs-next-no-x))) + (arguments + (substitute-keyword-arguments (package-arguments emacs-next-no-x) + ((#:phases p) + `(modify-phases ,p + (add-after 'bootstrap 'add-libgccjit-gcc-lib-to-library-path + ,add-libgccjit-gcc-lib-to-library-path))) + ((#:configure-flags flags ''()) + `(cons "--with-nativecomp" ,flags)))))) + (define-public emacs-no-x-toolkit (package/inherit emacs (name "emacs-no-x-toolkit") -- 2.29.1 --=-=-=--