GNU bug report logs - #60923
29.0.60; package-vc-install: Allow specifying directories

Previous Next

Package: emacs;

Reported by: Mohammed Sadiq <sadiq <at> sadiqpk.org>

Date: Wed, 18 Jan 2023 04:25:01 UTC

Severity: normal

Found in version 29.0.60

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60923 in the body.
You can then email your comments to 60923 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Wed, 18 Jan 2023 04:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mohammed Sadiq <sadiq <at> sadiqpk.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 18 Jan 2023 04:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mohammed Sadiq <sadiq <at> sadiqpk.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; package-vc-install: Allow specifying directories
Date: Wed, 18 Jan 2023 09:54:41 +0530
When installing packages from vc, I want to ignore some directories (eg:
tests directory). I would like package-vc-install to have an option to
accept list of directories to ignore or include (eg: if source is in src
subdirectory)


In GNU Emacs 29.0.60 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.36, cairo version 1.16.0) of 2023-01-17 built on purism
Repository revision: e8c77d9abda9c5c48de546a4ff667ffdf3d27c94
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 
11.0.12101005
System Description: Debian GNU/Linux bookworm/sid




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Mon, 13 Feb 2023 20:00:01 GMT) Full text and rfc822 format available.

Message #8 received at 60923 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 60923 <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Mon, 13 Feb 2023 19:59:41 +0000
Mohammed Sadiq <sadiq <at> sadiqpk.org> writes:

> When installing packages from vc, I want to ignore some directories (eg:
> tests directory). I would like package-vc-install to have an option to
> accept list of directories to ignore or include (eg: if source is in src
> subdirectory)

What does "ignore" mean in this context?  On ELPA we have the following
attribute for package specifications:

  ** =:ignored-files FILES=
  Names of files or directories that should not be included in the tarballs.

package.el already supports ignoring the contents of a .elpaignore file,
but all that does is remove a few files from the byte-compilation process.

-- 
Philip Kaludercic




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Tue, 14 Feb 2023 15:29:01 GMT) Full text and rfc822 format available.

Message #11 received at 60923 <at> debbugs.gnu.org (full text, mbox):

From: Mohammed Sadiq <sadiq <at> sadiqpk.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 60923 <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Tue, 14 Feb 2023 20:58:14 +0530
On 2023-02-14 01:29, Philip Kaludercic wrote:

> What does "ignore" mean in this context?

Ignore as in, the file is never kept in the installation directory.

> package.el already supports ignoring the contents of a .elpaignore 
> file,
> but all that does is remove a few files from the byte-compilation 
> process.

I tried installing pareedit, and it doesn't seem to work. I tried:
emacs --batch --eval='(package-vc-install 
"https://github.com/emacsmirror/paredit.git")'

The project contains .elpaignore, which specifies the file test.el,
but the file test.el is still compiled to test.elc.  Also, since
it is installed, I'm able to access functions like 
`paredit-test-failed'.

Or am I missing something obvious?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Tue, 14 Feb 2023 16:01:02 GMT) Full text and rfc822 format available.

Message #14 received at 60923 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 60923 <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Tue, 14 Feb 2023 15:59:49 +0000
Mohammed Sadiq <sadiq <at> sadiqpk.org> writes:

> On 2023-02-14 01:29, Philip Kaludercic wrote:
>
>> What does "ignore" mean in this context?
>
> Ignore as in, the file is never kept in the installation directory.

I am afraid that would be contrary to the point of package-vc.  The
intention is to provide the facilities to manage a package (activate,
load, update, etc.) directory from source.

But perhaps I am misunderstanding you.  What would be the point of
removing the files from the installation directory?

>> package.el already supports ignoring the contents of a .elpaignore
>> file,
>> but all that does is remove a few files from the byte-compilation
>> process.
>
> I tried installing pareedit, and it doesn't seem to work. I tried:
> emacs --batch --eval='(package-vc-install
> "https://github.com/emacsmirror/paredit.git")'

(Is there a reason you specified a URL instead of the package?)

> The project contains .elpaignore, which specifies the file test.el,
> but the file test.el is still compiled to test.elc.  

It seems like this is a bug in `byte-recompile-directory' or rather in
the way it is invoked from package-compile.  I will have to look into
this at some point, if it is even regarded as a bug -- there was a
discussion that it is OK to attempt compiling every file in a project,
even if the actual Lisp files are only located in a subdirectory.  Most
of the time the issues in test files are just due to negligence, and
could also be fixed upstream.

>                                                      Also, since
> it is installed, I'm able to access functions like
> `paredit-test-failed'.

Just like that or after loading the file?

> Or am I missing something obvious?

Nothing obvious enough for me to see.

-- 
Philip Kaludercic




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Thu, 23 Feb 2023 13:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 60923 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 60923 <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Thu, 23 Feb 2023 13:17:33 +0000
ping?

Philip Kaludercic <philipk <at> posteo.net> writes:

> Mohammed Sadiq <sadiq <at> sadiqpk.org> writes:
>
>> On 2023-02-14 01:29, Philip Kaludercic wrote:
>>
>>> What does "ignore" mean in this context?
>>
>> Ignore as in, the file is never kept in the installation directory.
>
> I am afraid that would be contrary to the point of package-vc.  The
> intention is to provide the facilities to manage a package (activate,
> load, update, etc.) directory from source.
>
> But perhaps I am misunderstanding you.  What would be the point of
> removing the files from the installation directory?
>
>>> package.el already supports ignoring the contents of a .elpaignore
>>> file,
>>> but all that does is remove a few files from the byte-compilation
>>> process.
>>
>> I tried installing pareedit, and it doesn't seem to work. I tried:
>> emacs --batch --eval='(package-vc-install
>> "https://github.com/emacsmirror/paredit.git")'
>
> (Is there a reason you specified a URL instead of the package?)
>
>> The project contains .elpaignore, which specifies the file test.el,
>> but the file test.el is still compiled to test.elc.  
>
> It seems like this is a bug in `byte-recompile-directory' or rather in
> the way it is invoked from package-compile.  I will have to look into
> this at some point, if it is even regarded as a bug -- there was a
> discussion that it is OK to attempt compiling every file in a project,
> even if the actual Lisp files are only located in a subdirectory.  Most
> of the time the issues in test files are just due to negligence, and
> could also be fixed upstream.
>
>>                                                      Also, since
>> it is installed, I'm able to access functions like
>> `paredit-test-failed'.
>
> Just like that or after loading the file?
>
>> Or am I missing something obvious?
>
> Nothing obvious enough for me to see.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60923; Package emacs. (Wed, 01 Mar 2023 05:04:01 GMT) Full text and rfc822 format available.

Message #20 received at 60923 <at> debbugs.gnu.org (full text, mbox):

From: Mohammed Sadiq <sadiq <at> sadiqpk.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 60923 <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Wed, 01 Mar 2023 10:33:35 +0530
On 2023-02-14 21:29, Philip Kaludercic wrote:
> 
> But perhaps I am misunderstanding you.  What would be the point of
> removing the files from the installation directory?

My need was to avoid letting the code in test files never available
in Emacs (as defuns and such are not namespace separated, functions
written in tests may confuse with other functions)

But given that the entire source including the vc history is kept
as such, I don't think removing the file is for this purpose is
worth.

> 
>>> package.el already supports ignoring the contents of a .elpaignore
>>> file,
>>> but all that does is remove a few files from the byte-compilation
>>> process.
>> 
>> I tried installing pareedit, and it doesn't seem to work. I tried:
>> emacs --batch --eval='(package-vc-install
>> "https://github.com/emacsmirror/paredit.git")'
> 
> (Is there a reason you specified a URL instead of the package?)

I just chose the URL of a popular project that has a .elpaignore file.

> 
>>                                                      Also, since
>> it is installed, I'm able to access functions like
>> `paredit-test-failed'.
> 
> Just like that or after loading the file?

After loading the file.  `paredit-test-failed` is no big problem.
But some projects may define functions like `load-test-file` etc,
which may not be obvious where the function is defined unless the
documentation or its code is inspected.

But anyway, as suggested, I don't think it's worth to have a way to
remove specified files as the entire vc history is cloned and kept
locally.  So please close the issue.

Sorry for the delayed response.  I was away last month.


cheers,
Mohammed Sadiq




Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Wed, 01 Mar 2023 14:04:01 GMT) Full text and rfc822 format available.

Notification sent to Mohammed Sadiq <sadiq <at> sadiqpk.org>:
bug acknowledged by developer. (Wed, 01 Mar 2023 14:04:02 GMT) Full text and rfc822 format available.

Message #25 received at 60923-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 60923-done <at> debbugs.gnu.org
Subject: Re: bug#60923: 29.0.60; package-vc-install: Allow specifying
 directories
Date: Wed, 01 Mar 2023 14:03:02 +0000
Mohammed Sadiq <sadiq <at> sadiqpk.org> writes:

> On 2023-02-14 21:29, Philip Kaludercic wrote:
>> But perhaps I am misunderstanding you.  What would be the point of
>> removing the files from the installation directory?
>
> My need was to avoid letting the code in test files never available
> in Emacs (as defuns and such are not namespace separated, functions
> written in tests may confuse with other functions)
>
> But given that the entire source including the vc history is kept
> as such, I don't think removing the file is for this purpose is
> worth.

OK, I'll go ahead and mark the report as done then?

>>>> package.el already supports ignoring the contents of a .elpaignore
>>>> file,
>>>> but all that does is remove a few files from the byte-compilation
>>>> process.
>>> I tried installing pareedit, and it doesn't seem to work. I tried:
>>> emacs --batch --eval='(package-vc-install
>>> "https://github.com/emacsmirror/paredit.git")'
>> (Is there a reason you specified a URL instead of the package?)
>
> I just chose the URL of a popular project that has a .elpaignore file.

The reason I was asking is that you could have also invoked
`package-vc-install' using just a symbol, and it would have used the
default specification that the package archive (in this case NonGNU
ELPA) also uses to build the package:

  (package-vc-install 'paredit)

>>>                                                      Also, since
>>> it is installed, I'm able to access functions like
>>> `paredit-test-failed'.
>> Just like that or after loading the file?
>
> After loading the file.  `paredit-test-failed` is no big problem.
> But some projects may define functions like `load-test-file` etc,
> which may not be obvious where the function is defined unless the
> documentation or its code is inspected.
>
> But anyway, as suggested, I don't think it's worth to have a way to
> remove specified files as the entire vc history is cloned and kept
> locally.  So please close the issue.

Package-vc is just an alternative backend for package, the loading is
still taken care of by package.el.  And if the package doesn't autoload
these definitions, then they shouldn't appear.  One could contact the
maintainer and suggest them to be more hygienic in regard to tests or
other miscellaneous files, but considering that hacking on packages is
one of the main use-cases of package-vc, it shouldn't be prevented.

> Sorry for the delayed response.  I was away last month.

No problem, I hope I could help :).

> cheers,
> Mohammed Sadiq

-- 
Philip Kaludercic




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Mar 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.