Subject: bug#78877: 31.0.50; Command `package-vc-rebuild' fails with error '(wrong-type-argument stringp nil)'

From: Roi Martin <[email-masked]>
Date: Thu, 26 Jun 2025 23:32:22 +0200

Philip Kaludercic <[email-masked]> writes:

>> I think this bug could be related to the changes installed as part of
>> Bug#78017.
>
> Could you elaborate your suspicion?

The commit 4226eb2b2040 "Avoid using symbolic links when installing
local VC packages" replaced symlinks with autoload indirections.  So,
now the directory created by `package-vc-install-from-checkout' contains
the following files in my test:

<user-emacs-directory>/elpa/pkg-foo/pkg-foo-pkg.el

  ;;; Generated package description from pkg-foo.el  -*- no-byte-compile: t -*-
  (define-package "pkg-foo" "0" "No description available." 'nil :kind vc :commit "85d90568599b3716295fe44b4611b5b31cd3b611")

<user-emacs-directory>/elpa/pkg-foo/pkg-foo-autoloads.el

  ;; Autoload indirection for package-vc
  
  (load (expand-file-name "/home/n/tmp/pkg-foo/pkg-foo-autoloads.el" (or (and load-file-name (file-name-directory load-file-name)) (car load-path))))

My suspicion is that after this change, `package-vc--main-file' cannot
find a main file in that directory anymore.  Does it make sense?

        Roi