all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Benjamin Orthen <benjamin@orthen.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Philip Kaludercic <philipk@posteo.net>
Cc: 63916@debbugs.gnu.org
Subject: bug#63916: 30.0.50; use-package: changes do not propagate to elpa-devel
Date: Fri, 08 Sep 2023 12:55:38 +0200	[thread overview]
Message-ID: <db97512773b995b351782a1c62eb5537fcbc9182.camel@orthen.net> (raw)
In-Reply-To: <bd9414ec73ab925cd081e4ed333ebd95310aabd7.camel@orthen.net>


[-- Attachment #1.1: Type: text/plain, Size: 1983 bytes --]

Related to this,

I have a patch for elpa-admin.el (in the elpa repository) which would
improve devel versioning for core packages:

Instead of looking only at the git log of the main package file, we
look instead at the git log of all files of the core package.
This way, a new devel version is created when any other package file is
changed, not just the main file.

Is this the right mailing list to send the patch? If not, where could I
send it to?


Best,
Benjamin

On Sun, 2023-06-11 at 19:32 +0200, Benjamin Orthen wrote:
> Hi,
> 
> I think I figured out why elpa does not build a new version of use-
> package.
> 
> To determine the devel version, it looks only at the git log of
> `(elpa-
> -main-file pkg-spec)`, which in this case turns out to be use-
> package.el. However, use-package.el has not been changed since
> 20230115, I suppose this is why no new version is built.
> 
> Best, Benjamin
> 
> 
> On Sun, 2023-06-11 at 12:55 -0400, Stefan Monnier wrote:
> > > > I agree that these kinds of problems are annoying to debug.  It
> > > > would be
> > > > nice to offer a "debug mode" where the user can see what's
> > > > going
> > > > on
> > > > within the sandbox.  Maybe we could do that by opening an
> > > > interactive
> > > > shell with a message saying "this is the command that we want
> > > > to
> > > > run"
> > > > and then let the user run that command?
> > > Shouldn't just invoking bash do that?
> > 
> > Yes, it should be fairly easy to do.
> > 
> > > But returning to the initial issue (hoping I did not miss
> > > anything), if
> > > the issue is not what I mentioned, then why is use-package not
> > > building?
> > 
> > You did not miss anything: it's not building simply because the
> > process
> > run within the sandbox cannot read the target of the `use-
> > package.texi`
> > symlink because the sandbox does not expose this target.
> > 
> > 
> >         Stefan
> > 
> 


[-- Attachment #1.2: Type: text/html, Size: 3379 bytes --]

[-- Attachment #2: 0001-Add-elpa-core-files-to-get-more-exact-devel-versions.patch --]
[-- Type: text/x-patch, Size: 3530 bytes --]

From d29163e00313690435b2baacc770a734598dd956 Mon Sep 17 00:00:00 2001
From: Benjamin Orthen <git@orthen.net>
Date: Fri, 8 Sep 2023 12:05:14 +0200
Subject: [PATCH] Add elpa--core-files to get more exact devel-versions for
 core packages

---
 elpa-admin.el | 51 ++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index 2c2d2aeab7..57dfee8f18 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -908,20 +908,49 @@ of the current `process-environment'.  Return the modified copy."
                0)))
     (encode-time (list s mi h d mo y nil nil zs))))
 
+(defun elpaa--core-files (pkg-spec)
+  "Get a list of core files (and only files) for PKG-SPEC.
+Core folders are recursively searched, excluded files are ignored."
+  (when-let
+      ((core (elpaa--spec-get pkg-spec :core)))
+    (let*
+        ((excludes (elpaa--spec-get pkg-spec :excludes))
+         (emacs-repo-root (expand-file-name "emacs"))
+         (default-directory emacs-repo-root)
+         (file-patterns
+          (if (listp core)
+              core
+            (list core)))
+         (core-files nil))
+      ;; we look at each file or files in folder and add them
+      ;; to core-files if they are in the excludes
+      (cl-labels ((process-item (item)
+                    (unless (member item excludes)
+                      (if (file-directory-p item)
+                          (dolist (file (directory-files item nil directory-files-no-dot-files-regexp))
+                            (process-item (concat item file)))
+                        (push item core-files)))))
+        (dolist (item file-patterns)
+          (process-item item)))
+      core-files)))
+
 (defun elpaa--get-devel-version (dir pkg-spec)
   "Compute the date-based pseudo-version used for devel builds."
-  (let* ((ftn (file-truename      ;; Follow symlinks!
-              (expand-file-name (elpaa--main-file pkg-spec) dir)))
-         (default-directory (file-name-directory ftn))
-         (gitdate
+  (let* ((gitdate
           (with-temp-buffer
-           (if (plist-get (cdr pkg-spec) :core)
-               ;; For core packages, don't use the date of the last
-               ;; commit to the branch, but that of the last commit
-               ;; to the main file.
-               (elpaa--call t "git" "log" "--pretty=format:%cI" "--no-patch"
-                            "-1" "--" (file-name-nondirectory ftn))
-             (elpaa--call t "git" "show" "--pretty=format:%cI" "--no-patch"))
+            (if (plist-get (cdr pkg-spec) :core)
+                (let
+                    ((core-files (elpaa--core-files pkg-spec))
+                     (default-directory (expand-file-name "emacs")))
+                  ;; For core packages, don't use the date of the last
+                  ;; commit to the branch, but that of the last commit
+                  ;; to the core files.
+                  (apply 'elpaa--call t "git" "log" "--pretty=format:%cI" "--no-patch"
+                         "-1" "--" core-files))
+              (let* ((ftn (file-truename      ;; Follow symlinks!
+                           (expand-file-name (elpaa--main-file pkg-spec) dir)))
+                     (default-directory (file-name-directory ftn)))
+                (elpaa--call t "git" "show" "--pretty=format:%cI" "--no-patch")))
             (buffer-string)))
          (verdate
           ;; Convert Git's date into something that looks like a version number.
-- 
2.41.0


  reply	other threads:[~2023-09-08 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 21:21 bug#63916: 30.0.50; use-package: changes do not propagate to elpa-devel Benjamin Orthen
2023-06-10  9:03 ` Philip Kaludercic
2023-06-10 16:01   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-11 10:34     ` Philip Kaludercic
2023-06-11 15:55       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-11 16:37         ` Philip Kaludercic
2023-06-11 16:55           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-11 17:32             ` Benjamin Orthen
2023-09-08 10:55               ` Benjamin Orthen [this message]
2023-09-08 17:14                 ` Philip Kaludercic
2023-09-08 19:35                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11  9:58                   ` Benjamin Orthen
2023-09-27 10:53                     ` Benjamin Orthen
2023-09-28 19:52                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db97512773b995b351782a1c62eb5537fcbc9182.camel@orthen.net \
    --to=benjamin@orthen.net \
    --cc=63916@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.