d12frosted / homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
MIT License
2.34k stars 181 forks source link

installing packages in emacs-plus@30 gives "Wrong type argument: package-desc" error #645

Closed simonmichael closed 8 months ago

simonmichael commented 9 months ago

I don't see a better category for this issue so here it is. Thanks for emacs-plus!

Please make sure to follow these steps (and mark the checkboxes):

What you were trying to do

Install emacs packages using package-install

What happened (include command output)

After every package install, emacs reports a "package-unpack: Wrong type argument: package-desc, nil" error.

With debug-on-error:

    Debugger entered--Lisp error: (wrong-type-argument package-desc nil)
      package-desc-full-name(nil)
      package-unpack(#s(package-desc :name ack :version (1 11) :summary "interface to ack-like tools" :reqs nil :kind tar :archiv$
      #f(compiled-function (&optional good-sigs) #<bytecode -0x11535c856719e4a2>)((#s(epg-signature :status good :key-id "066DAFC$
      #f(compiled-function () #<bytecode 0x120299dc9b2cce2f>)()
      package--with-response-buffer-1("https://elpa.gnu.org/packages/" #f(compiled-function () #<bytecode 0x120299dc9b2cce2f>) :f$
      package--check-signature("https://elpa.gnu.org/packages/" "ack-1.11.tar" "ack-1.11/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$
      #f(compiled-function () #<bytecode 0x993c6f600e34868>)()
      package--with-response-buffer-1("https://elpa.gnu.org/packages/" #f(compiled-function () #<bytecode 0x993c6f600e34868>) :fi$
      package-install-from-archive(#s(package-desc :name ack :version (1 11) :summary "interface to ack-like tools" :reqs nil :ki$
      package-download-transaction((#s(package-desc :name ack :version (1 11) :summary "interface to ack-like tools" :reqs nil :k$
      package-install(#s(package-desc :name ack :version (1 11) :summary "interface to ack-like tools" :reqs nil :kind tar :archi$
      package-menu--perform-transaction((#s(package-desc :name ack :version (1 11) :summary "interface to ack-like tools" :reqs n$
      package-menu-execute()
      funcall-interactively(package-menu-execute)
      command-execute(package-menu-execute)

Output of brew config

$ brew config
HOMEBREW_VERSION: 4.2.1-36-gbc566b5
ORIGIN: https://github.com/Homebrew/brew
HEAD: bc566b5cd0d540a8afda2bbaac0c395823d66ec0
Last commit: 49 minutes ago
Core tap HEAD: 75d208978834ba4d255fd4aa6f56def786c0833b
Core tap last commit: 73 minutes ago
Core tap JSON: 31 Dec 18:20 UTC
Core cask tap HEAD: 9f966200030403d245f2453ea25bc3ecbc40abc1
Core cask tap last commit: 48 minutes ago
Core cask tap JSON: 31 Dec 18:20 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.nSDSk4zH4U/org.macosforge.xquartz:0
HOMEBREW_EDITOR: emacsclient -a "" -s2 -nw
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_INSTALL_CLEANUP: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.43.0 => /opt/homebrew/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.2.1-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: N/A
Rosetta 2: false

Output of brew doctor

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed casks are deprecated or disabled.
You should find replacements for the following casks:
  wkhtmltopdf

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  darcs
  dosbox
  gcal
  openssl@1.1
  sdl_net
  sdl_sound

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libwkhtmltox.0.12.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/wkhtmltox/image.h
  /usr/local/include/wkhtmltox/pdf.h

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python-certifi
  python-pytz
  python-pyparsing
  python-packaging
  python-click
  pycparser
  cffi
  fonttools
  python-lxml
  pillow
  gnupg
$ brew info emacs-plus@30
==> d12frosted/emacs-plus/emacs-plus@30: stable 30.0.50
/opt/homebrew/Cellar/emacs-plus@30/30.0.50 (4,553 files, 259.1MB) *
  Built from source on 2023-05-24 at 13:38:59 with: --with-xwidgets --with-no-frame-refocus --with-native-comp --with-poll --with-imagemagick --with-mailutils
...
$ emacs --version
GNU Emacs 30.0.50
...
simonmichael commented 9 months ago

PS if you'd like, share the commit that emacs-plus@30 corresponds to and I can bisect.

d12frosted commented 8 months ago

This is unlikely to be an issue with Emacs+, looks like GNU Emacs issue. Better to report it there/search online. Remember that Emacs+ is just a formula for GNU Emacs.

d12frosted commented 8 months ago

PS if you'd like, share the commit that emacs-plus@30 corresponds to and I can bisect.

Forgot to say, emacs-plus@30 builds from master, not from specific commit. You can inspect logs to see, where emacs repository is cloned to (in my case it's ~/Library/Caches/Homebrew/emacs-plus@30--git/). Keep in mind that checking out any branch or commit doesn't make any effect on the build as brew resets this local copy to whatever is set in the formula (ie master) with optional fetch prior to that.

I've documented the process of pining master to specific revision. See https://github.com/d12frosted/homebrew-emacs-plus/tree/master#how-to-changepin-commit-emacs-plus30-is-built-from.

simonmichael commented 8 months ago

Thanks! So I guess brew info "Built from source on 2023-05-24 at 13:38:59" means it was built from master at the time, or roughly so.

I expect when the formula next is updated it'll pick up the fix from master, I'll just keep using my temporary build for now.

d12frosted commented 8 months ago

So I guess brew info "Built from source on 2023-05-24 at 13:38:59" means it was built from master at the time, or roughly so.

Yes. I recall that there was a way to check which commit exactly was used to build Emacs from, but can't find it. You can also check what commit your local git repo is on.

I expect when the formula next is updated it'll pick up the fix from master

Just for reference. emacs-plus@30 points to master, not to commit. As maintainer I don't update the formula when I want to build from the latest commit. As a user I simply uninstall emacs-plus@30 and install it again - this is how I update my local build.

Why? Because emacs-plus@30 is a bleeding edge, it was not released yet. If you want to use stable releases - stick to emacs-plus@29 (just an example), which installs the latest release - Emacs 29.1 (Jul 30, 2023).