Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byte compilation issue with straight.el at commit b3760f5 #1136

Open
tonyaldon opened this issue Dec 19, 2023 · 4 comments
Open

Byte compilation issue with straight.el at commit b3760f5 #1136

tonyaldon opened this issue Dec 19, 2023 · 4 comments
Labels

Comments

@tonyaldon
Copy link

What's wrong

Byte compilation done by straight differs from the one done by byte-compile-file and seems to create a symbol that doesn't exist.

Directions to reproduce

When I let straight install and build the package one.el like this

(straight-use-package
 '(one :type git :host github :repo "tonyaldon/one.el"))

and called the following commands sequentially

  • M-x toggle-debug-on-error
  • M-x one-default-new-project
  • M-x one-build

I got the following error:

Debugger entered--Lisp error: (void-function org-element--property)
  org-element--property(:CUSTOM_ID (headline (:raw-value "one.elme" :begin 1 :end 358 :pre-blank 0 :contents-begin 12 :contents-end 357 :robust-begin 67 :robust-end 355 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil ...) (section (:begin 12 :end 358 :contents-begin 12 :contents-end 357 :robust-begin 12 :robust-end 355 :post-blank 1 :post-affiliated 12 :mode section :granularity nil :parent #2) (property-drawer (:begin 12 :end 69 :contents-begin 25 :contents-end 62 :post-blank 1 :post-affiliated 12 :mode planning :granularity nil :parent #5) (node-property ...) (node-property ...)) (paragraph (:begin 69 :end 102 :contents-begin 69 :contents-end 101 :post-blank 1 :post-affiliated 69 :mode nil :granularity nil :parent #5) #("This is a new " 0 14 ...) (code ...) #("project.\n" 0 9 ...)) (paragraph (:begin 102 :end 203 :contents-begin 102 :contents-end 202 :post-blank 1 :post-affiliated 102 :mode nil :granularity nil :parent #5) #("If you don't know how " 0 22 ...) (code ...) #("works, you can check the documen..." 0 42 ...) (link ...) #(".\n" 0 2 ...)) (paragraph (:begin 203 :end 357 :contents-begin 203 :contents-end 357 :post-blank 0 :post-affiliated 203 :mode nil :granularity nil :parent #5) #("If you want to list all the page..." 0 74 ...) (link ... ...) #(".\n" 0 2 ...)))) nil nil)
  one-internal-id((headline (:raw-value "one.elme" :begin 1 :end 358 :pre-blank 0 :contents-begin 12 :contents-end 357 :robust-begin 67 :robust-end 355 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil ...) (section (:begin 12 :end 358 :contents-begin 12 :contents-end 357 :robust-begin 12 :robust-end 355 :post-blank 1 :post-affiliated 12 :mode section :granularity nil :parent #1) (property-drawer (:begin 12 :end 69 :contents-begin 25 :contents-end 62 :post-blank 1 :post-affiliated 12 :mode planning :granularity nil :parent #4) (node-property ...) (node-property ...)) (paragraph (:begin 69 :end 102 :contents-begin 69 :contents-end 101 :post-blank 1 :post-affiliated 69 :mode nil :granularity nil :parent #4) #("This is a new " 0 14 ...) (code ...) #("project.\n" 0 9 ...)) (paragraph (:begin 102 :end 203 :contents-begin 102 :contents-end 202 :post-blank 1 :post-affiliated 102 :mode nil :granularity nil :parent #4) #("If you don't know how " 0 22 ...) (code ...) #("works, you can check the documen..." 0 42 ...) (link ...) #(".\n" 0 2 ...)) (paragraph (:begin 203 :end 357 :contents-begin 203 :contents-end 357 :post-blank 0 :post-affiliated 203 :mode nil :granularity nil :parent #4) #("If you want to list all the page..." 0 74 ...) (link ... ...) #(".\n" 0 2 ...)))))
  #f(compiled-function (elt) #<bytecode -0x1b65972288cb9119>)((headline (:raw-value "one.elme" :begin 1 :end 358 :pre-blank 0 :contents-begin 12 :contents-end 357 :robust-begin 67 :robust-end 355 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil ...) (section (:begin 12 :end 358 :contents-begin 12 :contents-end 357 :robust-begin 12 :robust-end 355 :post-blank 1 :post-affiliated 12 :mode section :granularity nil :parent #1) (property-drawer (:begin 12 :end 69 :contents-begin 25 :contents-end 62 :post-blank 1 :post-affiliated 12 :mode planning :granularity nil :parent #4) (node-property ...) (node-property ...)) (paragraph (:begin 69 :end 102 :contents-begin 69 :contents-end 101 :post-blank 1 :post-affiliated 69 :mode nil :granularity nil :parent #4) #("This is a new " 0 14 ...) (code ...) #("project.\n" 0 9 ...)) (paragraph (:begin 102 :end 203 :contents-begin 102 :contents-end 202 :post-blank 1 :post-affiliated 102 :mode nil :granularity nil :parent #4) #("If you don't know how " 0 22 ...) (code ...) #("works, you can check the documen..." 0 42 ...) (link ...) #(".\n" 0 2 ...)) (paragraph (:begin 203 :end 357 :contents-begin 203 :contents-end 357 :post-blank 0 :post-affiliated 203 :mode nil :granularity nil :parent #4) #("If you want to list all the page..." 0 74 ...) (link ... ...) #(".\n" 0 2 ...)))))
  #f(compiled-function (--data) #<bytecode -0x1d677490ab1973bf>)((headline (:raw-value "one.elme" :begin 1 :end 358 :pre-blank 0 :contents-begin 12 :contents-end 357 :robust-begin 67 :robust-end 355 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil ...) (section (:begin 12 :end 358 :contents-begin 12 :contents-end 357 :robust-begin 12 :robust-end 355 :post-blank 1 :post-affiliated 12 :mode section :granularity nil :parent #1) (property-drawer (:begin 12 :end 69 :contents-begin 25 :contents-end 62 :post-blank 1 :post-affiliated 12 :mode planning :granularity nil :parent #4) (node-property ...) (node-property ...)) (paragraph (:begin 69 :end 102 :contents-begin 69 :contents-end 101 :post-blank 1 :post-affiliated 69 :mode nil :granularity nil :parent #4) #("This is a new " 0 14 ...) (code ...) #("project.\n" 0 9 ...)) (paragraph (:begin 102 :end 203 :contents-begin 102 :contents-end 202 :post-blank 1 :post-affiliated 102 :mode nil :granularity nil :parent #4) #("If you don't know how " 0 22 ...) (code ...) #("works, you can check the documen..." 0 42 ...) (link ...) #(".\n" 0 2 ...)) (paragraph (:begin 203 :end 357 :contents-begin 203 :contents-end 357 :post-blank 0 :post-affiliated 203 :mode nil :granularity nil :parent #4) #("If you want to list all the page..." 0 74 ...) (link ... ...) #(".\n" 0 2 ...)))))
  mapc(#f(compiled-function (--data) #<bytecode -0x1d677490ab1973bf>) ((headline ... ...) (headline ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...)))
  #f(compiled-function (--data) #<bytecode -0x1d677490ab1973bf>)((org-data (:begin 1 :contents-begin 1 :contents-end 4896 :end 4896 :robust-begin 3 :robust-end 4894 :post-blank 0 :post-affiliated 1 :path "/media/youtube/youtu..." :mode org-data ...) (headline ... ...) (headline ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...)))
  org-element-map((org-data (:begin 1 :contents-begin 1 :contents-end 4896 :end 4896 :robust-begin 3 :robust-end 4894 :post-blank 0 :post-affiliated 1 :path "/media/youtube/youtu..." :mode org-data ...) (headline ... ...) (headline ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...) (headline ... ... ... ...)) headline #f(compiled-function (elt) #<bytecode -0x1b65972288cb9119>))
  one-parse-buffer()
  one-render-pages()
  one-build()
  funcall-interactively(one-build)
  call-interactively(one-build record nil)
  command-execute(one-build record)
  execute-extended-command(nil "one-build" nil)
  funcall-interactively(execute-extended-command nil "one-build" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

It is normal because org-element--property is not defined by org-mode. But what caught my attention is that one.el never calls org-element--property, it only calls org-element-property which is well defined.

I found org-element--property symbol in straight/build/one/one.elc file generated by straight (if I understand correctly):

;;; Compiled
;;; in Emacs version 29.1
;;; with all optimizations.

;;; ...

(defalias 'one-ox-headline #[771 "..." [org-element--property :level nil :raw-value :one-internal-id "" format "<div><h%s id=\"%s\">%s</h%s>%s</div>"] 14 (#$ . 1276)])#@120 Transcode a SECTION element from Org to HTML.

But if I byte compile one.el file with byte-compile-file directly, I no longer have that issue and the compiled file looks like this:

;;; Compiled
;;; in Emacs version 29.1
;;; with all optimizations.

;;; ...

(defalias 'one-ox-headline #[771 "..." [:level get-text-property 0 plist-get :raw-value :one-internal-id "" format "<div><h%s id=\"%s\">%s</h%s>%s</div>"] 14 (#$ . 1276)])#@120 Transcode a SECTION element from Org to HTML.

I recently switched from straight from commit 3eca39d to straight at commit b3760f5. I hadn't that issue with 3eca39d.

So, I disable byte compilation for that package:

(straight-use-package
 '(one :type git :host github :repo "tonyaldon/one.el"
       :build (:not compile)))

What do you think? Am I doing something wrong?

Version information

  • Emacs version: Emacs 29.1
  • Operating system: Ubuntu 22.04.2 LTS
@tonyaldon tonyaldon added the bug label Dec 19, 2023
@progfolio
Copy link
Contributor

I'm unable to reproduce with the following test case:

Test Case
(straight-bug-report
  :post-bootstrap
  (straight-use-package '(one :host github :repo "tonyaldon/one.el"))
  (one-default-new-project)
  (one-build))
  • Test run at: 2023-12-19 10:06:29
  • system-type: gnu/linux
  • straight-version: prerelease (HEAD -> develop, origin/develop, fork/develop) b3760f5 2023-10-21
  • emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-12-18
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/master, origin/develop, origin/HEAD) b3760f5 2023-10-21
Cloning one.el...
Cloning one.el...done
Building one...
Building one → Cloning jack...
Building one → Cloning jack...done
Building one → Building jack...
Building one → Building jack...done
Building one → Cloning emacs-htmlize...
Building one → Cloning emacs-htmlize...done
Building one → Building htmlize...
Building one → Building htmlize...done
Building one...
Building one...done

Build pages...
Build page ‘/’
Build page ‘/blog/default-home-list-pages/’
Build page ‘/blog/default/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-with-toc/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-with-sidebar/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-doc/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build pages...done
Packages:
"straight"                n/a                  develop b3760f5 2023-10-21
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 60b3f2b1 2023-12-17
"gnu-elpa-mirror"         n/a                  master ab9bcb0 2023-12-18
"nongnu-elpa"             n/a                  main b299b0d 2023-11-23
"el-get"                  melpa                master a5ba5852 2023-10-20
"emacsmirror-mirror"      n/a                  master 49cd2c4 2023-12-12
"one"                     melpa                master f94f183 2023-12-19
"jack"                    melpa                master 77f51e6 2023-11-12
"htmlize"                 melpa                master dd27bc3 2021-08-25

Does the error occur for you if you evaluate that test case?

@tonyaldon
Copy link
Author

I just evaluated the test case and no error occurred.

Test Case
(straight-bug-report
  :post-bootstrap 
  (straight-use-package
   '(one :host github :repo "tonyaldon/one.el"))
  (one-default-new-project)
  (one-build))
  • Test run at: 2023-12-19 16:30:26
  • system-type: gnu/linux
  • straight-version: prerelease (HEAD -> master, origin/master, origin/develop, origin/HEAD) b3760f5 2023-10-21
  • emacs-version: GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2023-12-11
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/master, origin/develop, origin/HEAD) b3760f5 2023-10-21
Cloning one.el...
Cloning one.el...done
Building one...
Building one → Cloning jack...
Building one → Cloning jack...done
Building one → Building jack...
Building one → Building jack...done
Building one → Cloning emacs-htmlize...
Building one → Cloning emacs-htmlize...done
Building one → Building htmlize...
Building one → Building htmlize...done
Building one...
Building one...done

Build pages...
Build page ‘/’
Build page ‘/blog/default-home-list-pages/’
Build page ‘/blog/default/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-with-toc/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-with-sidebar/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build page ‘/blog/one-default-doc/’
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Build pages...done
Packages:
"straight"                n/a                  develop b3760f5 2023-10-21
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 60b3f2b1 2023-12-17
"gnu-elpa-mirror"         n/a                  master ab9bcb0 2023-12-18
"nongnu-elpa"             n/a                  main b299b0d 2023-11-23
"el-get"                  melpa                master a5ba5852 2023-10-20
"emacsmirror-mirror"      n/a                  master 49cd2c4 2023-12-12
"one"                     melpa                master f94f183 2023-12-19
"jack"                    melpa                master 77f51e6 2023-11-12
"htmlize"                 melpa                master dd27bc3 2021-08-25

@progfolio
Copy link
Contributor

See if you can add to that reproduction case in a way that reproduces the error.
Otherwise it's difficult to diagnose.

@tonyaldon
Copy link
Author

Thanks for looking at it. I'll try to see how can reproduce the error within the test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants