From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gFZ5AGlZk2MDTAAAbAwnHQ (envelope-from ) for ; Fri, 09 Dec 2022 16:51:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mPUsO2hZk2MF4QAAG6o9tA (envelope-from ) for ; Fri, 09 Dec 2022 16:51:04 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3DA9228042 for ; Fri, 9 Dec 2022 16:51:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3fdS-0007Sh-T8; Fri, 09 Dec 2022 10:50:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3fdD-0007QE-54 for emacs-orgmode@gnu.org; Fri, 09 Dec 2022 10:49:55 -0500 Received: from avasout-peh-003.plus.net ([212.159.14.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3fdA-0001Gg-DL for emacs-orgmode@gnu.org; Fri, 09 Dec 2022 10:49:46 -0500 Received: from london.london ([87.114.28.51]) by smtp with ESMTPA id 3fd1plZybbPhb3fd2prwXk; Fri, 09 Dec 2022 15:49:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1670600979; bh=0UlK6PpTzWMFe5eQdm09K+OwsJNQT9R4SlvN5xG8cRc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=OgxS0vu/AhBgBSrc3lDqg70BNZdwcjGKv0AeuzAtN9/z3XURfWMXR2j8Zq4yaUD8q LyDV8kl9f10yFMAPjNOuEE811HejoUcOhUViFalKNLUVfte782kiCKnTGGkt+0v26F EqgcG23yftYTPBJfwpMaEhTlps31ZeoL5rUmD1XfpClEZ5kLaUiIuwtNV/e/bcOnWT 2ctb9v2Anl+XGdp+6NM4ewTJWrbpJq16HE0EAYI7coH3KhTNB1SSV5xw94+ndqUJje cLnWhI5mCYsEae5Wi2azddCwkbHOEIcajmqdrNAKPQsc8YYXKN5/Qy8sWScdvE2FFL zO7dyn0vSvidw== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.4 cv=U+qBsMnu c=1 sm=1 tr=0 ts=63935913 a=JyC08/YlFreN0m7SyoyysA==:117 a=JyC08/YlFreN0m7SyoyysA==:17 a=pGLkceISAAAA:8 a=LhUXCpvhAAAA:8 a=LlzXLoV6AAAA:8 a=iI7HsYTVAAAA:8 a=bAHfVwKlAAAA:8 a=m3r9v53Ys3nUtDsiXWYA:9 a=zlKCoY9d4EIA:10 a=BIPpIoh2KZEA:10 a=6hn7YuiAyr8A:10 a=67rsiGD1-74G9O1zBWS0:22 a=A9pLXl7zLAuIpCaAaqdO:22 a=GZlKbjYrzjkL8u0iLdre:22 a=diwpeB1DDhFXqWA7J4Up:22 a=KxyM1Xthmv57RbWRIpnN:22 a=fjrkRJ71zQ2jzMzczd-K:22 X-AUTH: skimble09@:2500 From: Sharon Kimble To: Tim Cross Cc: David Masterson , emacs-orgmode@gnu.org, 59882@gnu.org Subject: Re: Multiple versions of Org in load-path problem In-Reply-To: <86cz8txc6q.fsf@gmail.com> (Tim Cross's message of "Fri, 09 Dec 2022 17:56:37 +1100") References: <87tu27jq7h.fsf@localhost> <87k032nyok.fsf@localhost> <39a5810d-75bc-4ddb-8722-703f762ed4de@app.fastmail.com> <86lenhxxs9.fsf@gmail.com> <86cz8txc6q.fsf@gmail.com> Date: Fri, 09 Dec 2022 15:49:30 +0000 Message-ID: <87tu24d1bp.fsf@skimble09.plus.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfCuj8yQ/ki3Ut8ttYkBtO2BmrCUv2rAdmBW7PHCQasad7g+LQFFe/kFcgSY6m7UUlYthJil5Onl3GCYxozEjox0aI1ZN0QqMMMk997y5vnCiZBk5xwp4 D+bgYAquOcLiIFNiFl0kGHuYjJDwPJwyeIcOPsdHWZQFN+mEyMBcsTl1GXGfmao1DJBcEri/lCnw7vntfif3jdg8F0J+O/25Oco= Received-SPF: none client-ip=212.159.14.19; envelope-from=boudiccas@skimble09.plus.com; helo=avasout-peh-003.plus.net X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670601064; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0UlK6PpTzWMFe5eQdm09K+OwsJNQT9R4SlvN5xG8cRc=; b=JWa/gS5wXRdTHvuVnK2zt49dnvosGtwAxu7nqP5cDDFeAQrDs6FnPBgQFgYL5HptqMtsAU 3cediXjyt1/r2f6jyBlx7VsF+bdmETQsKSWZE3nOQ6D/str/y7jeL2CmelerkrRAWqRn5n 5H7GVbGWPjit1ZfTY2LzA0AJKvbm9dKIcJVh31K9N4Sv8s8ruSpgHHeovIoadEQn8kzF8j TNlOeON3yI63ihHA49skl0Xt2UkvhxfKiK18O1lezfw4+YU/nkcaaWiKoWfy711mqKD1XE NzMuiimiFe0Bb2dMu2Hz9jDpsfALYGV9KAdTaM+BnyFxzM2R8OU7E72sCxGv2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=plus.com header.s=042019 header.b="OgxS0vu/"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670601064; a=rsa-sha256; cv=none; b=Sre46VfVDlVeM6/j8VnJozRQd2BqSi/3w3kjvg8vbjhAOQV9sHIfXWqegwHBP2tDnEs/fM K43DrwVsCUrjvKp5UW4dsQ6Sp2hY5skyYdUQGV2Ni6b7u3SkS2uEAnlekFAKbg+yNIPf2R rv+Friyv7t5oSa8fcorgOz0lwOUHkuYBuhVEpZY3vX/zsN8rBEuQsIR6GWJCf64JVEcqWJ VFgUOPc1XCnuRjdtx4dmMGSFe2kcPp2zsYLzmU4pDgG60FWfbyC9PFVywodHA8gTLCwjpG gnN1plHP+5csSo7R8U1jHWU1mRCNx3jS6XHzYBXUrvXj8Bcm3lr0LzTxV6g7fw== X-Migadu-Spam-Score: -6.91 X-Spam-Score: -6.91 X-Migadu-Queue-Id: 3DA9228042 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=plus.com header.s=042019 header.b="OgxS0vu/"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: To1rDIMjK13H =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Tim Cross writes: > David Masterson writes: > >> Tim Cross writes: >> >>> David Masterson writes: >>> >>>> "Michel Schinz" writes: >>>> >>>>> Just for the record, I also ran into problems when installing Org 9.6 >>>>> using Emacs' package system on top of an older version that came with >>>>> Emacs. If I tried to install it as usual (M-x list-packages, then >>>>> install the package from there), I had errors during compilation rela= ted >>>>> to `org-assert-version`, and then if I restarted Emacs, I would get a >>>>> fatal error in an unrelated package. >>>>> >>>>> I managed to solve that problem by: >>>>> 1. uninstalling Org 9.6 and exiting Emacs, >>>>> 2. starting Emacs with -q, >>>>> 3. installing Org 9.6 from there (using M-x list-packages as usual), >>>>> 4. restarting Emacs. >>>> >>>> Interesting! I tried this (essentially) and it worked for my case. In >>>> my case, I had a built-in Org-9.3 and I was trying to use list-packages >>>> to install Org-9.6. I checked that using -q still added Org-9.3 to >>>> the >>>> load-path, but, since Org wasn't loaded, the install via list-packages >>>> worked. >>>> >>>> The question is what's the proper way of doing this without '-q'? This is what is in my 'init.el' file - =3D=3D=3D=3D=3D ;;; init.el --- sharon's config -*- eval: (read-only-mode 1) -*- ;; Make sure that Git version of Org mode is being loaded instead of the bu= ilt-in version. ;;; (add-to-list 'load-path (expand-file-name "/home/boudiccas/.emacs.d/elp= a/org-9.5.5")) (add-to-list 'load-path (expand-file-name "/home/boudiccas/.emacs.d/elpa/or= g-9.6")) (add-to-list 'load-path (expand-file-name "/home/boudiccas/git/org-contrib/= lisp")) (require 'package) (setq package-enable-at-startup nil) (package-initialize) (require 'ob-tangle) (org-babel-load-file "/home/boudiccas/.emacs.d/config22-2.org")=20=20=20=20 =3D=3D=3D=3D=3D And the first thing that is loaded is org-9.6 *before* anything else! And y= ou could equally have org-mode loading from a git repository on your hard d= rive, just by changing the filepath. Super-easy without having to faff about with 'emacs -q' etc. And as you can see I'm using org-9.6 from elpa, and I didn't move over to i= t until this morning, so far so good.=20=20 Thanks Sharon.=20=20 =20=20 >> >> [...] >> >>> I don't think there is any safe way to install an updated version of >>> org-mode other than >>> >>> 1. Use the -q approach outlined above >> >> Thinking about it, this only works if Org is in elpa as melpa (etc.) are >> not added to package-archives. You'd have to do some handwritten elisp >> out of *scratch* to setup package-archives if Org-9.6 was still coming >> out of melpa. That's why this can only be labeled as a hack and not a >> solution. >> > > Well, yes, if your going to use this technique to load a package which > is not in the default package archives you would need to add that > archive first. People who use this technique often just have a > 'update.el' file which they load/evaluate when starting Emacs with -q.=20 > > >>> 2. Craft your init.el file such that org functionality is only loaded >>> when explicitly requested and always update as the first action after >>> starting emacs. >> >> In this case, something happened in package-install when trying to >> install Org-9.6 with a built-in Org-9.3. During the compilation check >> (.el -> .elc) many files failed because the new 'org-assert-version' >> macro was not defined. Sort of like, after package-install started >> working on Org-9.6, org-macs.el (where org-assert-version should be) got >> loaded *before* the new load-path had been set causing it to load the >> old one from 9.3. Thereafter, everything went awry.=20 >> > > You must have some custom code in your init.el or are using something > like use-package as package.el doesn't try to install or upgrade > packages during init by default. > > Where people can come undone is when they are using use-package and set > the :ensure t option. In this case, use-package will not know about the > bundled version and will attempt to install org from ELPA. If use > package runs after org has already been loaded (possibly because some > other package has been loaded which depends on/requires org mode and has > loaded the bundled version) then things will break because you will end > up with a mixed version install. This is why I always ensure org is the v= ery > first use-package in my init.el and it comes before any other code which > loads or initialises anything.=20=20 > >>> The first approach is actually the easiest. The second is hard to get >>> right and very fragile because packages like use-package and more >>> specifically, other packages with leverage off org functionality, make = it >>> impossible to reliably know exactly when org is loaded. >> >> Using ':after" in use-package is supposed to help that, but I'm not sure >> it is reliable. Packages are often incomplete about what other packages >> it depends on. >> > > You cannot rely on :after. The problem is, other packages may require > org functionality and will load org when they are loaded. This can be > very subtle as there are a lot of packages which only make very small > use of org mode, but even that requires that org mode is loaded.=20 > >>> An approach used by many 'canned' distributions is to postpone package >>> updates. You have a function you run to check for updates which >>> generates a list of packages to update and writes that list to a >>> file. Each time emacs is started, it looks for this update list and if >>> it finds it, it installs packages updates at the very beginning of the >>> init process (before any of your other init.el code or custom >>> blocks). The process also looks for org in the list of packages to >>> update and if it is found, updates it first.=20 >> >> Probably doesn't work in this case as you would need to be able to use >> package.el suggesting that the load-path has been updated for all >> built-ins already. The thing I note is that the load-path has already >> been updated for built-ins at the beginning of >> '~/.emacs.d/early-init.el', but the libraries haven't been loaded yet >> (unless needed). That's okay if the newer version of a package then >> cleanly replaces all the files in the old version. >> > > It does work. Distributions like Sapcemacs use this approach and do not > have the mixed versions issue. I've not looked closely at their > implementation, but they well might do all this work as part of the > early-init.el file. > > >>> I don't think there is a safe way to load org mode after the init >>> process i.e. after booting emacs by M-x package-update. >> >> Where is package-update called in the boot process of emacs? I don't >> see package-update in Emacs v2.7. >> > > Sorry, I wasn't clear. > > What I meant is that there is no clean and reliable way of running the > package update process after emacs has initialised. The package.el API > has changed, but previously, you would run M-x package-update-packages > to update installed packages. Now it is M-x package-update-all. With > many packages, you can run this command and update your installed > packages. However, more complex packages, like org-mode, cannot handle > this due to potential mixed version problems - a problem which has > existed for many years.=20 > > By default, there is no automated package update setting (unless that > has been added in recent versions). There are some add-on packages which > can do this and the elisp to make this happen is trivial (but much > harder to do it and make it robust).=20 > > >>> I've had good success using straight.el. I had to be careful regarding >>> how I structured my init.el file (ensuring any straight stuff happens >>> first and the first use package stanza is for org. The main reason >>> straight works well for me is that my work flow is to do a M-x >>> straight-pull-all when I want to update my packages. This does a git >>> pull for all the sources, but does not do any build/install. This occurs >>> when I next start Emacs and because I have all the straight stuff at the >>> start and because org mode is the first straight-use-package, the update >>> and install happens before any other org functionality is loaded, >>> avoiding mixed version issues. >> >> Where do you get straight.el? I don't see it in [m]elpa. > > No, to use straight.el, you add some code to your init.el which will > retrieve the current straight.el file from the github > repository. Straight.el does not use the ELPA/NONGNU ELPA/MELPA archives > - at least not directly. It does use information from those archives to > build recipes which it sues to obtain the code. Essentially, straight.el > clones the package source repositories and builds it locally. It give a > lot more control and is really great if you want to modify the code > (basically, it creates a local fork). Of course, with all that extra > power, there is also additional responsibility placed on the user. You > may need to tell it which versions you want to use, which ones to 'pin' > to, which branches or fix merge conflicts when you have made changes and > want to update from the upstream soruces etc. I've been using it for > about 12 months and find it really good. YMMV. =2D --=20 A taste of linux =3D http://www.sharons.org.uk TGmeds =3D http://www.tgmeds.org.uk DrugFacts =3D https://www.drugfacts.org.uk Debian 11.5, fluxbox 1.3.7, emacs 29.0.50, org 9.6=20 =2D----BEGIN PGP SIGNATURE----- iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmOTWQodHGJvdWRpY2Nh c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1sBchAAkByRu8RZ6EV9WkAi tbYOMCW9+rBQ9Oib2i6pj4XuGC1opjjjgMr84y2+UfgFm1bbcFo6bv1hi33UFvM2 9D8ORzSPW/wcPjGILcwHS6w1hbwkflB8qwRDwL7TxUFuZqCZ3mr9q7aLZR4ZVuf9 3WFzUHd30O61H6rLKrJWRPJgB2zYcUS4pbsiurOTK35sYoiogAshoV4akTNxQefV TmLFcoHmJvK0M+L/5BhPJblvrG0jkudUyMCYPeAHGxDfDpXiW/aFdYJuibqhk4mm nblCIe1EFBa5Lxu3m0lTkY7X9I/XtS1cf92gkj7qA9Y/ZYtVfWO54FyDA5sJFOZ2 aHcQrGS2vqoU1HNYv9u0CVj+/QJQbUSGrI60lrwIikOe+Xt+iHVlyx6dmmgKHLzt YHuZVKwMZxOEJtUjVwHc23+MzDmHc1WbJ8o5yOomFnYivFg/P0GQpY0o9O3CDJCV yV/ux7qPSPlyQZcJqKVHjrg05y/t76i5CPsiYAeUUQPa8jdU3F5SHxtpmuf9KPgQ +5EmUYkYodcNyss93YAuPEamKI491nLuWkc+F4t+fi24QS/t3FJaemkfW+UIIBuk gpg8/fgMkOdrs8E4IEwb7wZkCEHl52J0WypsGv9Of+vcrb5YXdPk7x/dJoHUmADm SremPednv0xBoZCKg12orlIQzIM=3D =3DcfTm =2D----END PGP SIGNATURE-----