Re: [BUG] Async pdf export broken with native-comp

2021-07-16 Thread Sébastien Miquel

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




Re: [BUG] Async pdf export broken with native-comp

2021-07-16 Thread Tim Cross


Timothy  writes:

> Mark Barton  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



Re: [BUG] Async pdf export broken with native-comp

2021-07-16 Thread Timothy


Mark Barton  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



Re: [BUG] Async pdf export broken with native-comp

2021-07-15 Thread Mark Barton



> On Jul 15, 2021, at 10:45 AM, Sébastien Miquel  
> 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


Re: [BUG] Async pdf export broken with native-comp

2021-07-15 Thread Tim Cross


Sébastien Miquel  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