* [BUG] Async pdf export broken with native-comp
@ 2021-07-15 17:45 Sébastien Miquel
2021-07-15 23:15 ` Tim Cross
2021-07-15 23:36 ` Mark Barton
0 siblings, 2 replies; 6+ messages in thread
From: Sébastien Miquel @ 2021-07-15 17:45 UTC (permalink / raw)
To: emacs-orgmode
Hi,
The async pdf export functionality appears to be broken with latest org
and a
recent emacs version compiled with native-comp enabled (I have not tested
without native-comp).
To reproduce:
- use `emacs -q` and an empty init.el file (your init file gets picked
up by
the async emacs instance)
- (setq org-export-async-debug t)
- find any org file and hit =C-c C-e C-a C-l C-p= to export as pdf file.
The async process will exit abnormaly.
The issue stems from this line in `org-export-to-file`
: (ignore-errors (funcall ',post-process ,file))
In `org-latex-export-to-pdf`, this `post-process` is set to
: (lambda (file) (org-latex-compile file))
I think native-comp compiles this lambda, which messes things up.
As a fix, you can quote the lambda in `org-latex-export-to-pdf`
: '(lambda (file) (org-latex-compile file))
The same applies to other backends but I don't know if it's the right
thing to do.
Regards,
--
Sébastien Miquel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] Async pdf export broken with native-comp
2021-07-15 17:45 [BUG] Async pdf export broken with native-comp Sébastien Miquel
@ 2021-07-15 23:15 ` Tim Cross
2021-07-15 23:36 ` Mark Barton
1 sibling, 0 replies; 6+ messages in thread
From: Tim Cross @ 2021-07-15 23:15 UTC (permalink / raw)
To: emacs-orgmode
Sébastien Miquel <sebastien.miquel@posteo.eu> writes:
> Hi,
>
> The async pdf export functionality appears to be broken with latest org and a
> recent emacs version compiled with native-comp enabled (I have not tested
> without native-comp).
>
> To reproduce:
>
> - use `emacs -q` and an empty init.el file (your init file gets picked up by
> the async emacs instance)
> - (setq org-export-async-debug t)
> - find any org file and hit =C-c C-e C-a C-l C-p= to export as pdf file.
>
> The async process will exit abnormaly.
>
> The issue stems from this line in `org-export-to-file`
> : (ignore-errors (funcall ',post-process ,file))
>
> In `org-latex-export-to-pdf`, this `post-process` is set to
> : (lambda (file) (org-latex-compile file))
>
> I think native-comp compiles this lambda, which messes things up.
>
> As a fix, you can quote the lambda in `org-latex-export-to-pdf`
> : '(lambda (file) (org-latex-compile file))
>
> The same applies to other backends but I don't know if it's the right thing to
> do.
>
I think native comp has a way to go before we begin to worry about how
to address any bugs which it may introduce/discover. While it is good to
have information like this posted to the list for anyone who wants to
experiment with native comp, it would be premature to apply any fixes to
the org code base.
--
Tim Cross
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] Async pdf export broken with native-comp
2021-07-15 17:45 [BUG] Async pdf export broken with native-comp Sébastien Miquel
2021-07-15 23:15 ` Tim Cross
@ 2021-07-15 23:36 ` Mark Barton
2021-07-16 6:05 ` Timothy
1 sibling, 1 reply; 6+ messages in thread
From: Mark Barton @ 2021-07-15 23:36 UTC (permalink / raw)
To: sebastien.miquel; +Cc: emacs-orgmode
> On Jul 15, 2021, at 10:45 AM, Sébastien Miquel <sebastien.miquel@posteo.eu> wrote:
>
> Hi,
>
> The async pdf export functionality appears to be broken with latest org and a
> recent emacs version compiled with native-comp enabled (I have not tested
> without native-comp).
>
> To reproduce:
>
> - use `emacs -q` and an empty init.el file (your init file gets picked up by
> the async emacs instance)
> - (setq org-export-async-debug t)
> - find any org file and hit =C-c C-e C-a C-l C-p= to export as pdf file.
>
> The async process will exit abnormaly.
>
> The issue stems from this line in `org-export-to-file`
> : (ignore-errors (funcall ',post-process ,file))
>
> In `org-latex-export-to-pdf`, this `post-process` is set to
> : (lambda (file) (org-latex-compile file))
>
> I think native-comp compiles this lambda, which messes things up.
>
> As a fix, you can quote the lambda in `org-latex-export-to-pdf`
> : '(lambda (file) (org-latex-compile file))
>
> The same applies to other backends but I don't know if it's the right thing to do.
>
> Regards,
>
> --
> Sébastien Miquel
>
>
Did you post this to the Emacs list? Native-comp is in master, but not “released”. So I agree with what Tim said about it is too soon for Org to consider solutions if it happens to be an edge case that native-comp might be able to address. I use native-comp, but have not tried the async export yet.
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] Async pdf export broken with native-comp
2021-07-15 23:36 ` Mark Barton
@ 2021-07-16 6:05 ` Timothy
2021-07-16 6:31 ` Tim Cross
2021-07-16 9:32 ` Sébastien Miquel
0 siblings, 2 replies; 6+ messages in thread
From: Timothy @ 2021-07-16 6:05 UTC (permalink / raw)
To: Mark Barton; +Cc: sebastien.miquel, emacs-orgmode
Mark Barton <mbarton98@gmail.com> writes:
> I use native-comp, but have not tried the async export yet.
FWIW I use native-comp (with Doom + my config) and async PDF export
works.
--
Timothy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] Async pdf export broken with native-comp
2021-07-16 6:05 ` Timothy
@ 2021-07-16 6:31 ` Tim Cross
2021-07-16 9:32 ` Sébastien Miquel
1 sibling, 0 replies; 6+ messages in thread
From: Tim Cross @ 2021-07-16 6:31 UTC (permalink / raw)
To: emacs-orgmode
Timothy <tecosaur@gmail.com> writes:
> Mark Barton <mbarton98@gmail.com> writes:
>
>> I use native-comp, but have not tried the async export yet.
>
> FWIW I use native-comp (with Doom + my config) and async PDF export
> works.
It might be useful for the OP if you could post what commit of Emacs 28
you are running. Native compilation is a moving feast and it could be
either the OP is running an older version (and issue has been fixed) or
a later version (and issue has been recently introduced). Knowing which
commit you are building from might help him identify whether an update
might fix the issue.
One thing I did notice when I was running native-comp was that the
caching strategy was a little hit and miss - it could also be that your
version is not running native compiled org.
When I was trying native compilation, I found that
- native compilation was a bit restrictive - it didn't compile things
correctly in some situations because it didn't load some dependencies
(i.e. you got errors and warning you don't see with normal *.elc
compilation)
- The caching was a bit hit and miss
- There was no noticeable performance improvement.
I think all of these issues will eventually be addressed as things
mature. However, for now, I don't see any real benefit in enabling
native compilation other than on an academic level.
--
Tim Cross
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [BUG] Async pdf export broken with native-comp
2021-07-16 6:05 ` Timothy
2021-07-16 6:31 ` Tim Cross
@ 2021-07-16 9:32 ` Sébastien Miquel
1 sibling, 0 replies; 6+ messages in thread
From: Sébastien Miquel @ 2021-07-16 9:32 UTC (permalink / raw)
To: Timothy; +Cc: emacs-orgmode
Hi,
Timothy writes:
> FWIW I use native-comp (with Doom + my config) and async PDF export
> works.
Would you mind checking that ~org-latex-export-to-pdf~ is native
compiled, using
=describe-function= ?
I've updated to latest emacs master and I'm still hitting this issue,
although the steps to reproduce in my original mail are wrong :
+ with =emacs -q= async export fails, but for a different reason : I get a
=wrong argument stringp, nil= error because ~user-init-file~ is nil
inside
~org-export-async-start~.
+ The issue I described occurs when you use an empty init.el file and
start
=emacs=. Perhaps you need to make sure that ~org-latex-export-to-pdf~ is
native compiled.
Regards,
--
Sébastien Miquel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-07-16 9:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-15 17:45 [BUG] Async pdf export broken with native-comp Sébastien Miquel
2021-07-15 23:15 ` Tim Cross
2021-07-15 23:36 ` Mark Barton
2021-07-16 6:05 ` Timothy
2021-07-16 6:31 ` Tim Cross
2021-07-16 9:32 ` Sébastien Miquel
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).