nyyManni / ejira

Emacs JIRA integration
GNU General Public License v3.0
255 stars 36 forks source link

(invalid-function #<buffer AAA.org>) #53

Open johnhamelink opened 1 year ago

johnhamelink commented 1 year ago

Hi there,

I'm trying to setup Ejira from scratch on a new JIRA instance, but experiencing an invalid-function error when attempting the first pull of data into org files.

A redacted stacktrace follows:

Debugger entered--Lisp error: (invalid-function #<buffer AAAA.org>)
  #<buffer AAAA.org>(#<marker at 676 in AAAA.org>)
  ejira--sort-comments("AAAA-1693")
  ejira--update-task(#s(ejira-task :key "AAAA-1693" :type "Bug" :reporter "Redacted Name" :assignee nil :deadline nil :status "Closed" :created (25591 19241) :updated (25591 39972) :epic nil :project "AAAA" :priority "Medium" :sprint nil :estimate nil :remaining-estimate nil :summary "Unable to paste text from Word documents into plac..." :parent nil :description "When trying to paste text into a placement, if the..." :comments nil))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_11>(((expand . "operations,versionedRepresentations,editmeta,chang...") (id . "26511") (self . "https://redacted.atlassian.net/rest/api/2/issue/26...") (key . "AAAA-1693") (fields (summary . "Unable to paste text from Word documents into plac...") (issuetype (self . "https://redacted.atlassian.net/rest/api/2/issuetyp...") (id . "10004") (description . "A problem or error.") (iconUrl . "https://redacted.atlassian.net/rest/api/2/universa...") (name . "Bug") (subtask . :json-false) (avatarId . 10303) (hierarchyLevel . 0)) (created . "2023-02-23T11:16:57.528+0000") (project (self . "https://redacted.atlassian.net/rest/api/2/project/...") (id . "10017") (key . "AAAA") (name . "Redacted") (projectTypeKey . "software") (simplified . :json-false) (avatarUrls (48x48 . "https://redacted.atlassian.net/rest/api/2/universa...") (24x24 . "https://redacted.atlassian.net/rest/api/2/universa...") (16x16 . "https://redacted.atlassian.net/rest/api/2/universa...") (32x32 . "https://redacted.atlassian.net/rest/api/2/universa..."))) (description . "When trying to paste text into a placement, if the...") (reporter (self . "https://redacted.atlassian.net/rest/api/2/user?acc...") (accountId . "6220a81c94f7e20069fe7458") (emailAddress . "redacted.email@redacted.com") (avatarUrls (48x48 . "https://secure.gravatar.com/avatar/3bf8cf68bb120d9...") (24x24 . "https://secure.gravatar.com/avatar/3bf8cf68bb120d9...") (16x16 . "https://secure.gravatar.com/avatar/3bf8cf68bb120d9...") (32x32 . "https://secure.gravatar.com/avatar/3bf8cf68bb120d9...")) (displayName . "Redacted Name") (active . t) (timeZone . "Europe/London") (accountType . "atlassian")) (priority (self . "https://redacted.atlassian.net/rest/api/2/priority...") (iconUrl . "https://redacted.atlassian.net/images/icons/priori...") (name . "Medium") (id . "3")) (timetracking) (duedate) (comment (comments) (self . "https://redacted.atlassian.net/rest/api/2/issue/26...") (maxResults . 0) (total . 0) (startAt . 0)) (assignee) (updated . "2023-02-23T17:02:28.895+0000") (status (self . "https://redacted.atlassian.net/rest/api/2/status/1...") (description . "The issue is considered finished, the resolution i...") (iconUrl . "https://redacted.atlassian.net/images/icons/status...") (name . "Closed") (id . "10102") (statusCategory (self . "https://redacted.atlassian.net/rest/api/2/statusca...") (id . 3) (key . "done") (colorName . "green") (name . "Done"))))))
  mapc(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_11> (... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  ejira-update-project("AAAA" nil)
  apply(ejira-update-project ("AAAA" nil))
  #f(compiled-function (&rest args-before) #<bytecode 0x1a1a9ed4f4e98f5f>)("AAAA")
  mapc(#f(compiled-function (&rest args-before) #<bytecode 0x1a1a9ed4f4e98f5f>) ("AAAA"))
  ejira-update-my-projects(nil)
  funcall-interactively(ejira-update-my-projects nil)
  command-execute(ejira-update-my-projects record)
  execute-extended-command(nil "ejira-update-my-projects" nil)
  funcall-interactively(execute-extended-command nil "ejira-update-my-projects" nil)
  command-execute(execute-extended-command)

I can eval (ejira--get-subheading (ejira--find-heading "AAAA-1693") ejira-comments-heading-name) and get a #<marker at 676 in AAAA.org>. If I comment out ejira--sort-comments, a crash happens at the next step which is ejira--refile.

nyyManni commented 1 year ago

I am facing the same issue also myself, I'll take a look at it once I have a suitable timeslot for it.

nyyManni commented 1 year ago

Hmmm. By re-evaluating the function definition the issue solved itself (I re-evaluated the whole package, so if there were other problematic functions they got resolved in the same way), which makes me wonder if the function is being incorrectly compiled to either bytecode or native code. Are you using native compilation with your Emacs?

johnhamelink commented 1 year ago

@nyyManni yes indeed I am. I'm working against Emacs master, specifically:

(version)
GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin20.6.0, NS appkit-2022.70 Version 11.7.5 (Build 20G1225)) of 2023-04-16

(dolist (opt (string-split system-configuration-options " ")) (message opt))
--disable-dependency-tracking
--disable-silent-rules
--enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
--infodir=/opt/homebrew/Cellar/emacs-plus@30/30.0.50/share/info/emacs
--prefix=/opt/homebrew/Cellar/emacs-plus@30/30.0.50
--with-xml2
--with-gnutls
--with-native-compilation
--without-compress-install
--with-dbus
--with-imagemagick
--with-modules
--with-rsvg
--with-xwidgets
--with-ns
--disable-ns-self-contained
’CFLAGS=-Os
-w
-pipe
-mmacosx-version-min=11
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
-DFD_SETSIZE=10000
-DDARWIN_UNLIMITED_SELECT’
’CPPFLAGS=-I/opt/homebrew/opt/zlib/include
-I/opt/homebrew/opt/jpeg/include
-I/opt/homebrew/opt/libomp/include
-I/opt/homebrew/opt/icu4c/include
-I/opt/homebrew/opt/openssl@1.1/include
-isystem/opt/homebrew/include
-F/opt/homebrew/Frameworks
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk’
’LDFLAGS=-L/opt/homebrew/opt/zlib/lib
-L/opt/homebrew/opt/jpeg/lib
-L/opt/homebrew/opt/libomp/lib
-L/opt/homebrew/opt/icu4c/lib
-L/opt/homebrew/opt/openssl@1.1/lib
-L/opt/homebrew/lib
-F/opt/homebrew/Frameworks
-Wl,-headerpad_max_install_names
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk’

Please do reach out if there's anything else I can do to help!

As an aside, I've been using jiralib2 to build a Confluence -> Org one-way sync tool (working name is "effluent" 😂) which I hope to release soon.

JH

nyyManni commented 1 year ago

I'll take a closer look at the compilation later. For now a (bad) workaround is to manually re-evaluate the file after launch. It might also be possible to disable the compilation specifically for ejira.

Confluence integration sounds interesting! I actually also tested my luck with it during the early days of developing ejira, but quickly gave up due to the lack of proper markup language. Anyway, I'll definitely keep an eye out for that package!

In the meantime, I'll push a new submodule for ejira - ejira-completion which implements what was previously in helm-ejira but with built-in emacs completion framework. Maybe then I can finally get ejira in melpa as I no longer need to drag the helm dependency in :)

nyyManni commented 1 year ago

Seems that this is happening on macOS-only. At least I cannot reproduce it on my Linux machine.