Subject: bug#79188: 31.0.50; Cannot build packages installed from VC

From: Przemyslaw Kryger <[email-masked]>
Date: Thu, 07 Aug 2025 12:33:44 +0100

I am using package-vc to manage a few pakcages I maintain.  However, in Emacs
31 I observed a couple issues.

The first discrepancy with what used to happen on Emacs 30 is when a package is
installed from a custom location, no *.elc files are produced.  I don't know
what the expected behaviour should be here.

In addition to that when I attempt to rebuild such a package with
package-vc-rebuild it signals an error, which I believe shouldn't happen,
should it?  In this case no *.elc files have been produced nor updated.  Such a
workflow used to work on Emacs 30.

I observed this on a Emacs macport (from
https://github.com/jdtsmith/emacs-mac/tree/emacs-mac-gnu_master_exp), but the
issue is reproducible on master (68aaeb3519fd7f6176050e142f0dbc27e07992d2) as
well.

git clone https://github.com/pkryger/helm-projectile "${HOME}/tmp/helm-projectile"
emacs -Q

(require 'package)
(add-to-list 'package-archives '(melpa . "https://melpa.org/packages/"))
;; Just to avoid using existing elpa
(setq package-user-dir (expand-file-name "tmp/elpa" (getenv "HOME")))
(package-refresh-contents)
;; In my config I use hardcoded paths, but `use-package' needs a
;; string for `:load-path', so just for this sample
(let ((pkg-dir (expand-file-name "tmp/helm-projectile" (getenv "HOME"))))
  (eval
   `(use-package helm-projectile
      :vc t
      :load-path ,pkg-dir)))
      
;; At this point `helm-projectile' has been installed, but no *.elc files are
;; produced, which differs from Emacs 30.

(setq debug-on-error t)
M-x package-vc-rebuild RET helm-projectile RET

Which yields the following:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  vc-file-getprop(nil vc-working-revision)
  vc-working-revision(nil)
  package-vc--unpack-1(#s(package-desc :name helm-projectile :version (1 3 1) :summary "Helm integration for Projectile" :reqs nil :kind vc :archive nil :dir "/Users/pkryger/tmp/elpa/helm-projectile/" :extras ((:commit . "2ecd3d85b7077f39bb2fefe2227cc46931d4b92b")) :signed nil) "/Users/pkryger/tmp/elpa/helm-projectile/")
  package-vc-rebuild(#s(package-desc :name helm-projectile :version (1 3 1) :summary "Helm integration for Projectile" :reqs nil :kind vc :archive nil :dir "/Users/pkryger/tmp/elpa/helm-projectile/" :extras ((:commit . "2ecd3d85b7077f39bb2fefe2227cc46931d4b92b")) :signed nil))
  funcall-interactively(package-vc-rebuild #s(package-desc :name helm-projectile :version (1 3 1) :summary "Helm integration for Projectile" :reqs nil :kind vc :archive nil :dir "/Users/pkryger/tmp/elpa/helm-projectile/" :extras ((:commit . "2ecd3d85b7077f39bb2fefe2227cc46931d4b92b")) :signed nil))
  call-interactively(package-vc-rebuild record nil)
  command-execute(package-vc-rebuild record)
  execute-extended-command(nil "package-vc-rebuild" "pack-v-re")
  funcall-interactively(execute-extended-command nil "package-vc-rebuild" "pack-v-re")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Could these be introduced by  4226eb2b20408ba49787195bbc59bb0066c9c9e4?

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.5.0, X toolkit,
 cairo version 1.18.4, Xaw3d scroll bars) of 2025-08-07 built on
 Przemyslaws-MacBook-Air.local
Repository revision: 68aaeb3519fd7f6176050e142f0dbc27e07992d2
Repository branch: master
System Description:  macOS 15.5

Configured using:
 'configure --without-ns --with-gnutls --with-modules
 --with-native-compilation=no --with-jpeg=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable CFLAGS=-O3'

Configured features:
ACL CAIRO FREETYPE GLIB GNUTLS GSETTINGS HARFBUZZ LCMS2 LIBXML2 MODULES
NOTIFY KQUEUE PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XAW3D XDBE XIM XINERAMA XPM XRANDR LUCID ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  xterm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/Users/pkryger/tmp/elpa/helm-4.0.4/helm-packages hides /Users/pkryger/tmp/elpa/helm-core-4.0.4/helm-packages
/Users/pkryger/tmp/elpa/helm-4.0.4/helm-x-icons hides /Users/pkryger/tmp/elpa/helm-core-4.0.4/helm-x-icons

Features:
(shadow sort mail-extr emacsbug use-package-ensure help-fns cl-print
debug backtrace find-func helm-projectile projectile helm-files
image-dired image-dired-tags image-dired-external image-dired-util
image-mode exif filenotify dired-x ffap tramp rx trampver
tramp-integration tramp-message tramp-compat shell pcomplete parse-time
iso8601 tramp-loaddefs helm-tags helm-buffers helm-x-icons helm-occur
helm-grep helm-regexp format-spec helm-utils helm-locate helm-help helm
helm-types helm-global-bindings helm-easymenu edmacro kmacro helm-core
helm-source helm-multi-match helm-lib cus-edit pp cus-start cus-load
wid-edit helm-projectile-autoloads helm-autoloads helm-core-autoloads
vc-git diff-mode track-changes files-x wfnames-autoloads smtpmail
dired-async dired-aux async-bytecomp async bug-reference async-autoloads
project skeleton ibuf-macs pcase find-dired grep ibuf-ext ibuffer
ibuffer-loaddefs thingatpt compile comint ansi-osc ansi-color ring
projectile-autoloads easy-mmode loaddefs-gen radix-tree tar-mode
arc-mode archive-mode package-vc vc vc-dispatcher lisp-mnt cl-extra
help-mode use-package-core finder-inf mm-archive message sendmail
yank-media dired dired-loaddefs rfc822 mml mml-sec epa derived gnus-util
text-property-search mailabbrev gmm-utils mailheader mm-decode mm-bodies
mm-encode mail-utils gnutls network-stream url-cache warnings url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm puny epg rfc6068 epg-config package browse-url xdg
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
map url-vars time-date subr-x cl-loaddefs cl-lib xt-mouse term/xterm
xterm byte-opt gv bytecomp byte-compile rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads kqueue
lcms2 dynamic-setting system-font-setting font-render-setting cairo
x-toolkit x multi-tty move-toolbar make-network-process tty-child-frames
emacs)

Memory information:
((conses 16 349318 58285) (symbols 48 22829 1) (strings 32 68024 3090)
 (string-bytes 1 2006739) (vectors 16 34746)
 (vector-slots 8 661887 21587) (floats 8 132 421)
 (intervals 56 1420 25) (buffers 1064 20))