emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Reproducible work with natively compiled Emacs
Date: Wed, 13 Mar 2024 17:52:19 +0100	[thread overview]
Message-ID: <CAO48Bk_A97YphZ927qRW-qk_SvgwEAMrPDMnxXHSb3HE6sJjYw@mail.gmail.com> (raw)
In-Reply-To: <87ttlawb1a.fsf@localhost>


[-- Attachment #1.1: Type: text/plain, Size: 3202 bytes --]

Hi Ihor,

Thanks for the feedback! I'm attaching a unified patch.

TODO: check that the emacs installed supports native compilation. This is
more for
make native.

Best, /PA


On Wed, 13 Mar 2024 at 13:46, Ihor Radchenko <yantar92@posteo.net> wrote:

> Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
>
> >> I have been experiencing some inconsistencies with org-mode, which I
> >> have been able to trace own to using native compilation and not knowing
> >> where the files from main were.
>
> Thanks for the patch!
> See my comments inline.
>
> > +# This is where Emacs stores the .eln files
> > +ELNDIR        = $(shell emacs --batch --eval '(princ (car
> native-comp-eln-load-path))')
>
> Please use $(EMACS).
>
> > +cleaneln::
> > +     for elnf in $(patsubst %.eln, %-*.eln, $(LISPN)); do \
> > +       find $(ELNDIR) -name $$elnf -exec $(RM) -v {} \; ;\
> > +     done
>
> $(FIND).
> Also, avoid using bash as much as possible in favor or GNU make
> constructs. You can use $(foreach ...) here.
>
> >  clean-install:
> >       if [ -d $(DESTDIR)$(lispdir) ] ; then \
> >         $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el*
> $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
> > --
> > 2.34.1
> > From 6d98dfb3d72171e0231823260165b23e8b9963ee Mon Sep 17 00:00:00 2001
> > From: "Pedro A. Aranda" <paaguti@gmail.com>
> > Date: Mon, 11 Mar 2024 09:47:12 +0100
> > Subject: [PATCH 1/3] Add cleaneln target
> >
> > * mk/targets.mk: add the 'cleaneln' target
> >
> > ---
> >  mk/targets.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/targets.mk b/mk/targets.mk
> > index de849c4fb..ab9ec2a1f 100644
> > --- a/mk/targets.mk
> > +++ b/mk/targets.mk
> > @@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
> >  $(CLEANDIRS:%=clean%):
> >       -$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM)
> {} +
> >
> > +cleaneln:
> > +     $(MAKE) -C lisp $@
> > +
>
> Should be in .PHONY
>
> > --- a/etc/ORG-NEWS
> > +++ b/etc/ORG-NEWS
> > @@ -11,7 +11,8 @@ See the end of the file for license conditions.
> >
> >  Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
> >
> > -* Version 9.7 (not released yet)
> > +* V
> > +ersion 9.7 (not released yet)
>
> This is a stray newline.
>
> > +*** ~make cleaneln~ will remove the .eln files from the user emacs
> configuration
> > +
> > +Natively compiled Emacs lisp files generated with ~make native~ are
> > +now correctly located and deleted with ~make cleaneln~.
> > +
> >  ** Miscellaneous
> >  *** =org-crypt.el= now applies initial visibility settings to decrypted
> entries
>
> "Add 'native' option to 'make help'" from the previous version of the
> patch still makes sense.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #1.2: Type: text/html, Size: 5153 bytes --]

[-- Attachment #2: 0001-Clean-eln-files-from-the-user-emacs-eln-directory.patch --]
[-- Type: text/x-patch, Size: 3889 bytes --]

From 52bcbc71c62717e84dd0504ccf37d32668ed3cac Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <paaguti@gmail.com>
Date: Wed, 13 Mar 2024 17:41:56 +0100
Subject: [PATCH] Clean eln files from the user emacs eln directory

---
lisp/Makefile: clean .eln files from the directory where the user's natively
compiled files are stored

* Makefile: Add help for =make native=
* lisp/Makefile: Implement =make cleaneln=
* mk/targets.mk: Add =cleaneln= target


 Makefile      | 1 +
 etc/ORG-NEWS  | 7 +++++++
 lisp/Makefile | 9 ++++++++-
 mk/targets.mk | 5 ++++-
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f476a3ea7..b3a167ecb 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ help helpall::
 	$(info make all            - ditto)
 	$(info make compile        - build Org ELisp files)
 	$(info make single         - build Org ELisp files, single Emacs per source)
+	$(info make native         - build Org natively compiled Elisp files)
 	$(info make autoloads      - create org-loaddefs.el to load Org in-place)
 	$(info make test           - build Org ELisp files and run test suite)
 	$(info make vanilla        - run Emacs with this Org-mode and no personal config)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index ca73f06e7..cb8ed9b71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -1281,6 +1281,13 @@ optional argument =NEW-HEADING-CONTAINER= specifies where in the
 buffer it will be added.  If not specified, new headings are created
 at level 1 at the end of the accessible part of the buffer, as before.

+*** ~make cleaneln~ will remove the .eln files from the user emacs configuration
+
+Natively compiled Emacs lisp files generated with ~make native~ are
+now correctly located and deleted with ~make cleaneln~.
+
+*** Add text for =make native= to ~make help~
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries

diff --git a/lisp/Makefile b/lisp/Makefile
index c570d9cfa..0186b4246 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -11,12 +11,15 @@ LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
 _ORGCM_ := dirall single native source slint1 slint2
+# This is where Emacs stores the .eln files
+ELNDIR        = $(shell $(EMACS) --batch --eval '(princ (car native-comp-eln-load-path))')
+
 -include local.mk

 .PHONY:	all compile compile-dirty \
 	$(_ORGCM_) $(_ORGCM_:%=compile-%) \
 	autoloads \
-	install clean cleanauto cleanall cleanelc clean-install
+	install clean cleanauto cleanall cleanelc cleaneln clean-install

 # do not clean here, done in toplevel make
 all compile compile-dirty::	 | autoloads
@@ -79,6 +82,10 @@ cleanauto clean cleanall::
 clean cleanall cleanelc::
 	$(RM) *.elc

+cleaneln::
+	@$(foreach elnf,$(patsubst %.eln, %-*.eln, $(LISPN)), \
+	  $(FIND) $(ELNDIR) -name $(elnf) -exec $(RM) -v {} \; ;)
+
 clean-install:
 	if [ -d $(DESTDIR)$(lispdir) ] ; then \
 	  $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
diff --git a/mk/targets.mk b/mk/targets.mk
index de849c4fb..4ab5fa13c 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -31,7 +31,7 @@ endif
 	info html pdf card refcard doc docs \
 	autoloads cleanall clean $(CLEANDIRS:%=clean%) \
 	clean-install cleanelc cleandirs \
-	cleanlisp cleandoc cleandocs cleantest \
+	cleanlisp cleandoc cleandocs cleantest cleaneln \
 	compile compile-dirty uncompiled \
 	config config-test config-exe config-all config-eol config-version \
 	vanilla repro
@@ -143,6 +143,9 @@ cleanall: cleandirs cleantest
 $(CLEANDIRS:%=clean%):
 	-$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} +

+cleaneln:
+	$(MAKE) -C lisp $@
+
 cleanelc:
 	$(MAKE) -C lisp $@

--
2.34.1

  reply	other threads:[~2024-03-13 16:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10 11:49 Reproducible work with natively compiled Emacs Pedro A. Aranda
2024-03-11  9:11 ` Pedro Andres Aranda Gutierrez
2024-03-13 12:50   ` Ihor Radchenko
2024-03-13 16:52     ` Pedro Andres Aranda Gutierrez [this message]
2024-03-13 17:17       ` Ihor Radchenko
     [not found]         ` <CAO48Bk8v7f3ajv1P3QMvZOuLCBn8f1qp5VQKeUByX0hbKqeEmQ@mail.gmail.com>
2024-03-14  7:50           ` Pedro Andres Aranda Gutierrez
2024-03-15 14:08             ` Ihor Radchenko
2024-03-15 11:17               ` Pedro Andres Aranda Gutierrez
     [not found]                 ` <CAO48Bk9TgysKrAGmhiyR5NZ_4LYj9GMZf-LUo=fjREJYsuXFFg@mail.gmail.com>
2024-03-15 17:08                   ` Ihor Radchenko
2024-03-16  6:16                     ` Pedro Andres Aranda Gutierrez
2024-03-16 10:20                       ` Ihor Radchenko
2024-03-17  6:13                         ` Pedro Andres Aranda Gutierrez
2024-03-17  8:19                           ` Max Nikulin
2024-03-17 10:16                           ` Ihor Radchenko
2024-03-17 10:30                             ` Pedro Andres Aranda Gutierrez
2024-03-17 14:26                               ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO48Bk_A97YphZ927qRW-qk_SvgwEAMrPDMnxXHSb3HE6sJjYw@mail.gmail.com \
    --to=paaguti@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).