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

From: Philip Kaludercic <[email-masked]>
Date: Thu, 26 Jun 2025 21:39:06 +0000

Roi Martin <[email-masked]> writes:

> 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?

Of course, that does make sense and is an issue that the change seems to
have introduced.  I will take a look at how we can improve this,
probably by trying to follow the indirection when looking for a main
file...

>         Roi