melpa / package-build

Tools for assembling a package archive
https://github.com/melpa/melpa
25 stars 34 forks source link

New stable release? #57

Closed Phundrak closed 2 years ago

Phundrak commented 2 years ago

The issue

The current release on Melpa Stable dates from January 19th, 2020 with commit https://github.com/melpa/package-build/commit/bc06686806d676658b5e962497770e47025c17f1. At that time, package-build still used the macro defmethod from the package cl.

Not only has cl been deprecated in favor of cl-lib, it has now been removed from Emacs. Unfortunately, Cask relies on Melpa Stable to download its required dependencies to run, including the now outdated package-build version. The lack of (require 'cl) in the file crashes version 29 of Emacs.

A fix for that would be to push a newer version to Melpa Stable with the addition of a new tag/release.

Steps to reproduce:

  1. Use Emacs 29 on master
  2. Perform a clean installation of cask (including removing the .cask directory in $HOME or $HOME/.config/emacs)
  3. Run cask init in a dummy project
  4. Obsevre Cask crash when it attempts to compile package-build.
    Cask’s logs regarding `package-build`
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Contacting host: stable.melpa.org:443
Parsing tar file... 
Parsing tar file...done
Extracting... \ 
Extracting...done
  INFO     Scraping files for package-build-autoloads.el... 
  INFO     Scraping files for package-build-autoloads.el...done
Checking /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4...
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build-autoloads.el...
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build-badges.el...

In toplevel form:
package-build-badges.el:36:2: Error: Symbol’s function definition is void: defmethod
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build-pkg.el...
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build.el...

In toplevel form:
package-build.el:48:2: Error: Symbol’s function definition is void: defmethod
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-recipe-mode.el...

In toplevel form:
package-recipe-mode.el:36:2: Error: Symbol’s function definition is void: defmethod
Compiling /home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-recipe.el...

In toplevel form:
package-recipe.el:54:43: Warning: ‘(rcp package-recipe)’ is a malformed function
package-recipe.el:54:12: Warning: reference to free variable ‘package-recipe--working-tree’
package-recipe.el:56:28: Warning: reference to free variable ‘rcp’
package-recipe.el:58:43: Warning: ‘(rcp package-recipe)’ is a malformed function
package-recipe.el:58:12: Warning: reference to free variable ‘package-recipe--upstream-url’

In end of data:
package-recipe.el:54:2: Warning: the function ‘defmethod’ is not known to be defined.
Done (Total of 1 file compiled, 3 failed, 2 skipped)
Package ‘package-build’ installed.

Error: void-variable (package-recipe--working-tree)
  debug-early-backtrace()
  debug-early(error (void-variable package-recipe--working-tree))
  byte-code("\304\10\305 \306\307\310\11\311\"\n\"!#\210\304\13\312 \310\11\313\"\206$\0\314\310\11\315\"\310\11\316\"\"#\210\317\320\321\322!\"\210\317\323\324\322!\"\210\317\325\323\"\210\326\325\327\330#\210\331\322\332\323#\333\322\334\335\336$\207" [package-recipe--working-tree rcp package-build-working-dir package-recipe--upstream-url defmethod (rcp package-recipe) file-name-as-directory expand-file-name eieio-oref name (rcp package-recipe) url format url-format repo defalias package-git-recipe-p eieio-make-class-predicate package-git-recipe package-git-recipe--eieio-childp eieio-make-child-predicate package-git-recipe-child-p make-obsolete "use (cl-typep ... 'package-git-recipe) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal (package-recipe) ((tag-regexp :initform "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\( [+-][0-9]\\{4\\}\\)?\\)")) nil] 8)
  require(package-recipe)
  eval-buffer(#<buffer  *load*-961490> nil "/home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build.el" nil t)
  load-with-code-conversion("/home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build.el" "/home/phundrak/.config/emacs/.cask/29.0/bootstrap/package-build-2.4/package-build.el" nil t)
  require(package-build)
  (if (featurep pkg) nil (if (package-installed-p pkg) nil (if package-archive-contents nil (package-refresh-contents)) (package-install pkg)) (require pkg))
  (let ((pkg (car --dolist-tail--))) (if (featurep pkg) nil (if (package-installed-p pkg) nil (if package-archive-contents nil (package-refresh-contents)) (package-install pkg)) (require pkg)) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((pkg (car --dolist-tail--))) (if (featurep pkg) nil (if (package-installed-p pkg) nil (if package-archive-contents nil (package-refresh-contents)) (package-install pkg)) (require pkg)) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- deps)) (while --dolist-tail-- (let ((pkg (car --dolist-tail--))) (if (featurep pkg) nil (if (package-installed-p pkg) nil (if package-archive-contents nil (package-refresh-contents)) (package-install pkg)) (require pkg)) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let (package-alist package-archive-contents (load-path load-path) (package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://stable.melpa.org/packages/"))) (package-user-dir cask-bootstrap-dir) (deps '(s f commander git epl shut-up cl-lib cl-generic package-build eieio ansi))) (package-initialize) (if (version= emacs-version "24.4") (progn (require 'tls) (custom-set-default 'tls-program '("openssl s_client -connect %h:%p -no_ssl3 -no_ssl2 -ign_eof")) (advice--add-function :override (cons #'(lambda nil (symbol-function 'gnutls-available-p)) #'(lambda (gv--val) (fset 'gnutls-available-p gv--val))) #'ignore nil))) (if (version< emacs-version "25.1") (progn (if (package-installed-p 'cl-lib) nil (if package-archive-contents nil (package-refresh-contents)) (package-install 'cl-lib)) (require 'package-recipe (expand-file-name "package-recipe-legacy" cask-directory)) (require 'package-build (expand-file-name "package-build-legacy" cask-directory)))) (let ((--dolist-tail-- deps)) (while --dolist-tail-- (let ((pkg (car --dolist-tail--))) (if (featurep pkg) nil (if (package-installed-p pkg) nil (if package-archive-contents nil (package-refresh-contents)) (package-install pkg)) (require pkg)) (setq --dolist-tail-- (cdr --dolist-tail--))))))
  eval-buffer(#<buffer  *load*-581539> nil "/usr/share/cask/cask-bootstrap.el" nil t)
  load-with-code-conversion("/usr/share/cask/cask-bootstrap.el" "/usr/share/cask/cask-bootstrap.el" nil t)
  require(cask-bootstrap "/usr/share/cask/cask-bootstrap")
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_100>(#<buffer  *load*> "/usr/share/cask/cask-cli.el")
  load-with-code-conversion("/usr/share/cask/cask-cli.el" "/usr/share/cask/cask-cli.el" nil t #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_100>)
  command-line--load-script("/usr/share/cask/cask-cli.el")
  command-line-1(("-scriptload" "/usr/share/cask/cask-cli.el" "--" "init"))
  command-line()
  normal-top-level()
Symbol’s value as variable is void: package-recipe--working-tree

By modifying Cask’s Melpa source to melpa.org instead of stable.melpa.org, I no longer have this issue.

purcell commented 2 years ago

Cool, I tagged the latest master version as 3.0, which MELPA Stable should soon pick up and build.

tarsius commented 2 years ago

This was a slightly rushed release. I was going to create a release too, but a bit more carefully. I'll probably release 3.1 soon.

tarsius commented 2 years ago

Okay, I am ready for a release too now. :grinning:

@melpa/maintainers, I'll wait a few days before I create another release, just in case someone wants to add something before then.

IMO releases should be done using a dedicated release commit with summary Release version VERSION and that commit must update Package-Requires to VERSION. Then that commit should be tagged, using message Package-Build VERSION (for consistency with previous release tags). It would also be good to sign both the commit and the tag. After the release a new commit should be created, which changes Package-Requires to VERSION-git.

My sisyphus package can help with that.

purcell commented 2 years ago

Yep, this was definitely half-assed. Happy with any more organised process. The more work it is to make a release, the less I am likely to be the person who does it, but that might not be a bad outcome! 😁

tarsius commented 2 years ago

:grimacing: