Subject: bug#38568: Org Mode (as a dependency) is borked

From: Jelle Licht <[email-masked]>
Date: Wed, 11 Dec 2019 23:06:10 +0100

Hey Guix, 

Org-mode seems to still have some byte compilation issues when used as a
dependency for other packages. The specific symptom is extremely similar
to the one reported and fixed at [http://issues.guix.info/issue/38479].

To reproduce:
 1) Install emacs-org-jira in your profile, and set it up (lots of
    annoying steps with API tokens, authinfo etc etc)
 2) Run `M-x org-jira-get-boards':
    --8<---------------cut here---------------start------------->8---
    org-jira--render-board: Symbol’s function definition is void: org-outline-overlay-data
    --8<---------------cut here---------------end--------------->8---

To see the issue without reproducing it (using bash):
    --8<---------------cut here---------------start------------->8---
    $ grep -rni 'org-outline-overlay-data' $(guix build emacs-org-jira)
    --8<---------------cut here---------------end--------------->8---

This gives:
    --8<---------------cut here---------------start------------->8---
    Binary file org-jira.elc matches
    --8<---------------cut here---------------end--------------->8---

Byte-compiling the org-jira.el file manually gives an .elc file without
a reference to `org-outline-overlay-data'. This leads me to believe that
the previously posted fix for #38479 could be extended to make sure
Emacs' built-in packages are at the trailing end of EMACSLOADPATH, so
after any other packages. 

Regards,
Jelle