all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65286: 30.0.50; package-install-file for built-in package
@ 2023-08-14 11:55 Ihor Radchenko
  2023-08-14 13:54 ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2023-08-14 11:55 UTC (permalink / raw)
  To: 65286

Hi,

I am trying to figure out ways to deal with mixing Org versions.
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762)

In my tests, I was trying to utilize M-x package-install-file to emulate
ELPA installation. And I think that I stumbled upon a bug in this
command.

Recipe:
1. Remove default elpa directory
2. cd /tmp; git clone --depth 1 --branch feature/provide-version https://git.sr.ht/~yantar92/org-mode
3. cd org-mode/lisp
4. emacs -Q
5. M-x org-version
6. M-x package-install-file <RET> /tmp/org-mode/lisp <RET>
7. Observe

ob-gnuplot.el:45:2: Error: Recursive load: "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/ox.el", "/home/yantar92/.emacs.d/elpa/org-9.7pre/ox-ascii.el"

The same does not happen if we skip step (4).

Also, keeping elpa directory around between the tests triggers various failures.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-08-13 built on localhost
Repository revision: bfde3a4482ce7775f00a17b597daa1b188ef0d43
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#65286: 30.0.50; package-install-file for built-in package
  2023-08-14 11:55 bug#65286: 30.0.50; package-install-file for built-in package Ihor Radchenko
@ 2023-08-14 13:54 ` Philip Kaludercic
  2023-08-14 14:02   ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2023-08-14 13:54 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 65286

Ihor Radchenko <yantar92@posteo.net> writes:

> Hi,
>
> I am trying to figure out ways to deal with mixing Org versions.
> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762)
>
> In my tests, I was trying to utilize M-x package-install-file to emulate
> ELPA installation. And I think that I stumbled upon a bug in this
> command.
>
> Recipe:
> 1. Remove default elpa directory
> 2. cd /tmp; git clone --depth 1 --branch feature/provide-version https://git.sr.ht/~yantar92/org-mode
> 3. cd org-mode/lisp
> 4. emacs -Q
> 5. M-x org-version
> 6. M-x package-install-file <RET> /tmp/org-mode/lisp <RET>
> 7. Observe
>
> ob-gnuplot.el:45:2: Error: Recursive load:
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/org-element.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/ox.el",
> "/home/yantar92/.emacs.d/elpa/org-9.7pre/ox-ascii.el"
>
> The same does not happen if we skip step (4).
>
> Also, keeping elpa directory around between the tests triggers various failures.

Are you sure that this is not an issue related to org-mode?

Could you create a minimal working example to reproduce this issue, by
removing as much as possible from the repository while retaining the
issue, and then send us a tarball with the remaining files?

> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.38, cairo version 1.17.8) of 2023-08-13 built on localhost
> Repository revision: bfde3a4482ce7775f00a17b597daa1b188ef0d43
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
> System Description: Gentoo Linux





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#65286: 30.0.50; package-install-file for built-in package
  2023-08-14 13:54 ` Philip Kaludercic
@ 2023-08-14 14:02   ` Ihor Radchenko
  2023-08-14 14:15     ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2023-08-14 14:02 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65286

Philip Kaludercic <philipk@posteo.net> writes:

>> Also, keeping elpa directory around between the tests triggers various failures.
>
> Are you sure that this is not an issue related to org-mode?

It might be. But the difference between package-install-file w/without
built-in Org loaded is unlikely Org's fault in any case.

> Could you create a minimal working example to reproduce this issue, by
> removing as much as possible from the repository while retaining the
> issue, and then send us a tarball with the remaining files?

Sorry, but the issue is triggered by interaction between built-in and
non-built-in Org. I have no idea if it is possible at all to create more
minimal reproducer.

To be clear, I have no clue at all what is going on. I made some
relatively innocent changes in Org that added a couple of provide
statements. I could see things breaking completely, but not __only__
when built-in Org is loaded. So, any attempt to reduce the reproducer
steps will be me trying random things - not very productive unless you
absolutely cannot use the reproducer I provided.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#65286: 30.0.50; package-install-file for built-in package
  2023-08-14 14:02   ` Ihor Radchenko
@ 2023-08-14 14:15     ` Philip Kaludercic
  2023-08-14 15:09       ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2023-08-14 14:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 65286

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Ihor Radchenko <yantar92@posteo.net> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>>> Also, keeping elpa directory around between the tests triggers various failures.
>>
>> Are you sure that this is not an issue related to org-mode?
>
> It might be. But the difference between package-install-file w/without
> built-in Org loaded is unlikely Org's fault in any case.

For the record, these are the changes between your checkout and what is
on master:


[-- Attachment #2: Type: text/plain, Size: 3375 bytes --]

diff -u /tmp/org-mode/lisp/ob-gnuplot.el /home/philip/Source/emacs/lisp/org/ob-gnuplot.el
--- /tmp/org-mode/lisp/ob-gnuplot.el	2023-08-14 16:10:37.615919936 +0200
+++ /home/philip/Source/emacs/lisp/org/ob-gnuplot.el	2023-04-05 22:53:26.932222097 +0200
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2009-2023 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
-;; Maintainer: Ihor Radchenko <yantar92 at posteo dot net>
+;; Maintainer: Ihor Radchenko <yantar92@gmail.com>
 ;; Keywords: literate programming, reproducible research
 ;; URL: https://orgmode.org
 
@@ -40,9 +40,11 @@
 
 ;;; Code:
 
-(require 'ob-9.7 "ob")
-(require 'org-macs-9.7 "org-macs")
-(require 'ox-ascii-9.7 "ox-ascii")
+(require 'org-macs)
+(org-assert-version)
+
+(require 'ob)
+(require 'org-macs)
 
 (declare-function org-time-string-to-time "org" (s))
 (declare-function orgtbl-to-generic "org-table" (table params))
@@ -196,7 +198,7 @@
 (defun org-babel-execute:gnuplot (body params)
   "Execute a block of Gnuplot code.
 This function is called by `org-babel-execute-src-block'."
-  (org-require-package 'gnuplot)
+  (require 'gnuplot)
   (let ((session (cdr (assq :session params)))
         (result-type (cdr (assq :results params)))
         (body (org-babel-expand-body:gnuplot body params))
@@ -260,7 +262,7 @@
 If there is not a current inferior-process-buffer in SESSION
 then create one.  Return the initialized session.  The current
 `gnuplot-mode' doesn't provide support for multiple sessions."
-  (org-require-package 'gnuplot)
+  (require 'gnuplot)
   (unless (string= session "none")
     (save-window-excursion
       (gnuplot-send-string-to-gnuplot "" "line")
@@ -293,33 +295,17 @@
   (require 'ox-org)
   (with-temp-file data-file
     (insert (let ((org-babel-gnuplot-timestamp-fmt
-		   (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S"))
-                  ;; Create custom limited backend that will disable
-                  ;; advanced ASCII export features that may alter the
-                  ;; original data.
-                  (ob-gnuplot-data
-                   (org-export-create-backend
-                    :parent 'ascii
-                    :transcoders
-                    `(;; Do not try to resolve links.  Export them verbatim.
-                      (link . (lambda (link _ _) (org-element-interpret-data link)))
-                      ;; Drop emphasis markers from verbatim and code.
-                      ;; This way, data can use verbatim when escaping
-                      ;; is necessary and yet be readable by Gnuplot,
-                      ;; which is not aware about Org's markup.
-                      (verbatim . (lambda (verbatim _ _) (org-element-property :value verbatim)))
-                      (code . (lambda (code _ _) (org-element-property :value code)))))))
+		   (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
 	      (orgtbl-to-generic
 	       table
 	       (org-combine-plists
-		`( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
+		'( :sep "\t" :fmt org-babel-gnuplot-quote-tsv-field
                    ;; Two setting below are needed to make :fmt work.
                    :raw t
-                   :backend ,ob-gnuplot-data)
+                   :backend ascii)
 		params)))))
   data-file)
 
 (provide 'ob-gnuplot)
-(provide 'ob-gnuplot-9.7)
 
 ;;; ob-gnuplot.el ends here

Diff finished.  Mon Aug 14 16:12:51 2023

[-- Attachment #3: Type: text/plain, Size: 1192 bytes --]


The (org-assert-version) seems new, with this check

  `(unless (or org--inhibit-version-check (equal (org-release) ,(org-release)))
     ...

could evaluating (org-release) during macro-expansion cause this
recursive load issue?

>> Could you create a minimal working example to reproduce this issue, by
>> removing as much as possible from the repository while retaining the
>> issue, and then send us a tarball with the remaining files?
>
> Sorry, but the issue is triggered by interaction between built-in and
> non-built-in Org. I have no idea if it is possible at all to create more
> minimal reproducer.

> To be clear, I have no clue at all what is going on. I made some
> relatively innocent changes in Org that added a couple of provide
> statements. I could see things breaking completely, but not __only__
> when built-in Org is loaded. So, any attempt to reduce the reproducer
> steps will be me trying random things - not very productive unless you
> absolutely cannot use the reproducer I provided.

No, sorry I couldn't reproduce it on my system :/

M-x emacs-version
GNU Emacs 30.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-08-14

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#65286: 30.0.50; package-install-file for built-in package
  2023-08-14 14:15     ` Philip Kaludercic
@ 2023-08-14 15:09       ` Ihor Radchenko
  2023-08-18 10:43         ` Max Nikulin
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2023-08-14 15:09 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65286

Philip Kaludercic <philipk@posteo.net> writes:

> For the record, these are the changes between your checkout and what is
> on master:

The same error happens for a number of other libraries. I just did not
list all the errors in the initial report.

Also, the error does not happen when using Org main.
I started getting error after the following edits in across Org libraries:

> -(require 'ob-9.7 "ob")
> -(require 'org-macs-9.7 "org-macs")
> -(require 'ox-ascii-9.7 "ox-ascii")
> +(require 'org-macs)
> +(org-assert-version)
>   ...
>  (provide 'ob-gnuplot)
> -(provide 'ob-gnuplot-9.7)

> The (org-assert-version) seems new, with this check
>
>   `(unless (or org--inhibit-version-check (equal (org-release) ,(org-release)))
>      ...
>
> could evaluating (org-release) during macro-expansion cause this
> recursive load issue?

Nope. `org-release' is defined in automatically generated org-version.el
library, which does not depend on anything:

;;; org-version.el --- autogenerated file, do not edit  -*- lexical-binding: t -*-
;;
;;; Code:
;;;###autoload
(defun org-release ()
  "The release version of Org.
Inserted by installing Org mode or when a release is made."
   (let ((org-release "9.6.7"))
     org-release))
;;;###autoload
(defun org-git-version ()
  "The Git version of Org mode.
Inserted by installing Org or when a release is made."
   (let ((org-git-version "release_9.6.7-13-g99cc96"))
     org-git-version))
\f
(provide 'org-version)
\f
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; coding: utf-8
;; End:
;;; org-version.el ends here

>> To be clear, I have no clue at all what is going on. I made some
>> relatively innocent changes in Org that added a couple of provide
>> statements. I could see things breaking completely, but not __only__
>> when built-in Org is loaded. So, any attempt to reduce the reproducer
>> steps will be me trying random things - not very productive unless you
>> absolutely cannot use the reproducer I provided.
>
> No, sorry I couldn't reproduce it on my system :/
>
> M-x emacs-version
> GNU Emacs 30.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-08-14

Curious.
To be sure, I just pulled the latest master, did autogen -> configure
(with no arguments) -> make bootstrap, and followed the steps to
reproduce. I can still see the same problem.

Same using Emacs 29, Emacs 28, and Emacs 27.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#65286: 30.0.50; package-install-file for built-in package
  2023-08-14 15:09       ` Ihor Radchenko
@ 2023-08-18 10:43         ` Max Nikulin
  0 siblings, 0 replies; 6+ messages in thread
From: Max Nikulin @ 2023-08-18 10:43 UTC (permalink / raw)
  To: Ihor Radchenko, Philip Kaludercic; +Cc: 65286

On 14/08/2023 22:09, Ihor Radchenko wrote:
> Philip Kaludercic writes:
>> No, sorry I couldn't reproduce it on my system :/

> Curious.
> To be sure, I just pulled the latest master, did autogen -> configure
> (with no arguments) -> make bootstrap, and followed the steps to
> reproduce. I can still see the same problem.

Spacemacs users recommend to install from file, not from ELPA
https://github.com/syl20bnr/spacemacs/issues/15896#issuecomment-1530129761

Maybe there is really some subtle difference how `package-install-file' 
processes packages. Something like running Emacs<29 from source tree vs. 
make install.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-18 10:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 11:55 bug#65286: 30.0.50; package-install-file for built-in package Ihor Radchenko
2023-08-14 13:54 ` Philip Kaludercic
2023-08-14 14:02   ` Ihor Radchenko
2023-08-14 14:15     ` Philip Kaludercic
2023-08-14 15:09       ` Ihor Radchenko
2023-08-18 10:43         ` Max Nikulin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.