From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: org 9.2.6 and org 9.1.9 Date: Wed, 27 Nov 2019 08:41:08 +1100 Message-ID: References: <7D2A3D8D-CB71-4B0D-8839-9633BD9F9C4B@traduction-libre.org> <874kyqcuup.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009da04e059846bd27" Return-path: In-Reply-To: <874kyqcuup.fsf@alphaville.usersys.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sender: "Emacs-devel" To: Nick Dokos Cc: Org-mode , Emacs developers List-Id: emacs-orgmode.gnu.org --0000000000009da04e059846bd27 Content-Type: text/plain; charset="UTF-8" There is a very important rule which must be followed wrt org-mode installation. It is critical that no version of org is already loaded before installing a new version. This can be quite tricky as many of us have org setups which automatically load some org functionality without explicitly opening an org file or agenda view (for example, you might be using an org add-on for email). Situation is worse if we are loading org as part of our init.el. I'm also not sure that tweaking the load-path order is sufficient if your installing org via M-x package-install as there is a 'chicken and egg' problem with the initial install. If your init.el file is loading org functionality and you only have the built-in org version installed, that version will be loaded before you run package-install. Probably works if you install via your init.el though. I've found the safest thing to do is only use autoload or use-package with deferred loading for org and whenever updating org (I use the org-plus-contrib package from the org elpa repo) only update immediately after a fresh restart of emacs and before doing anything else. Failing to do this often results in a broken build as you get a set of new org elc files which contains definitions from two different org versions. When the versions are only different in minor version numbers, this mixed build may not even be noticeable, but when major version differences exist, you get the symptom of broken functionality, missing definitions or unbound symbols. The situation is made worse by package maintainers specifying the latest org version rather than the version built into Emacs when the bundled version would be sufficient. It took me a while to structure my init.el file such that no org functionality was loaded until I used something which depends on it. However, once I did, provided I only update org in a fresh new session, all works flawlessly. I found use-package package really helped with this. On Wed, 27 Nov 2019 at 06:22, Nick Dokos wrote: > Jean-Christophe Helary > writes: > > > org 9.1.9 is a built-in > > > > but org 9.2.6 comes as a dependency to some packages and having both > installed creates conflicts. > > > > What conflicts are you seeing? I have the built-in 9.1.9 org that > comes with emacs but I run (close to) latest master and I see no > problems: the only thing I do is to set my load-path to point to the > right place (and make sure that that setting precedes the > /usr/local/share/emacs/27.0.50/lisp/org setting that emacs adds): > > (add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp")) > > Although that has been enough for me, it's probably safer to delete > from load-path all other org entries, thereby making the built-in > version invisible to emacs - in my case, I just have the one: > > (delete "/usr/local/share/emacs/27.0.50/lisp/org" load-path) > > That way, if you happen to do something like `(require 'old-org-req)' > with a requirement that is not satisfied by current org, but is > satisfied by the built-in org, you'd get an error, rather than getting > a mixed installation. > > > Why does that happen ? > > > > Can't 9.2.6 override 9.1.9 ? It's not the first time I have issues > > with that situation and that's extremely confusing. What is the best > > way to solve that ? > > > > I think the above should be enough (and IME it is), but maybe someone can > think of other things that might trip one up. > > -- > Nick > > "There are only two hard problems in computer science: cache > invalidation, naming things, and off-by-one errors." -Martin Fowler > > > -- regards, Tim -- Tim Cross --0000000000009da04e059846bd27 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There is a very important rule which must be followed= wrt org-mode installation. It is critical that no version of org is alread= y loaded before installing a new version. This can be quite tricky as many = of us have org setups which automatically load some org functionality witho= ut explicitly opening an org file or agenda view (for example, you might be= using an org add-on for email). Situation is worse if we are loading org a= s part of our init.el.

I'm also not sure = that tweaking the load-path order is sufficient if your installing org via = M-x package-install as there is a 'chicken and egg' problem with th= e initial install. If your init.el file is loading org functionality and yo= u only have the built-in org version installed, that version will be loaded= before you run package-install. Probably works if you install via your ini= t.el though.

I've found the safest thing t= o do is only use autoload or use-package with deferred loading for org and = whenever updating org (I use the org-plus-contrib package from the org elpa= repo) only update immediately after a fresh restart of emacs and before do= ing anything else.=C2=A0 Failing to do this often results in a broken build= as you get a set of new org elc files which contains definitions from two = different org versions. When the versions are only different in minor versi= on numbers, this mixed build may not even be noticeable, but when major ver= sion differences exist, you get the symptom of broken functionality, missin= g definitions or unbound symbols.

The situation is= made worse by package maintainers specifying the latest org version rather= than the version built into Emacs when the bundled version would be suffic= ient.

It took me a while to structure my init= .el file such that no org functionality was loaded until I used something w= hich depends on it. However, once I did, provided I only update org in a fr= esh new session, all works flawlessly. I found use-package package really h= elped with this.



On Wed, 27 Nov 201= 9 at 06:22, Nick Dokos <ndokos@gmail= .com> wrote:
Jean-Christophe Helary <jean.christophe.helary@traduction-libr= e.org> writes:

> org 9.1.9 is a built-in
>
> but org 9.2.6 comes as a dependency to some packages and having both i= nstalled creates conflicts.
>

What conflicts are you seeing? I have the built-in 9.1.9 org that
comes with emacs but I run (close to) latest master and I see no
problems: the only thing I do is to set my load-path to point to the
right place (and make sure that that setting precedes the
/usr/local/share/emacs/27.0.50/lisp/org setting that emacs adds):

=C2=A0 =C2=A0 (add-to-list 'load-path (expand-file-name "~/elisp/o= rg-mode/lisp"))

Although that has been enough for me, it's probably safer to delete
from load-path all other org entries, thereby making the built-in
version invisible to emacs - in my case, I just have the one:

=C2=A0 =C2=A0(delete "/usr/local/share/emacs/27.0.50/lisp/org" lo= ad-path)

That way, if you happen to do something like `(require 'old-org-req)= 9;
with a requirement that is not satisfied by current org, but is
satisfied by the built-in org, you'd get an error, rather than getting<= br> a mixed installation.

> Why does that happen ?
>
> Can't 9.2.6 override 9.1.9 ? It's not the first time I have is= sues
> with that situation and that's extremely confusing. What is the be= st
> way to solve that ?
>

I think the above should be enough (and IME it is), but maybe someone can think of other things that might trip one up.

--
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



--
regards,

Tim=

--
Tim Cross

--0000000000009da04e059846bd27--