all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Changing a cl-defstruct definition in a published package
Date: Mon, 30 Jul 2018 17:52:58 -0400	[thread overview]
Message-ID: <c8f771d3-54c9-b30c-5ff1-dec2934e5f6b@gmail.com> (raw)
In-Reply-To: <jwvsh4k9daa.fsf-monnier+gmane.emacs.devel@gnu.org>

On 2018-07-15 21:51, Stefan Monnier wrote:
> I don't think so, no (by the time we're compiling the file, the package
> is already installed and activated).

Great, thanks :)

I've made a bit of progress on this.  It's indeed fairly easy to force recompilation of all packages that Flycheck depends on:

(let ((dependencies nil))
  (dolist (name-descs package-alist)
    (let ((reqs (package-desc-reqs (cadr name-descs))))
      (when (assq 'flycheck reqs)
        (push desc dependencies))))
  (message "Flycheck: forcing recompilation of the following packages: %s"
           (mapconcat (lambda (d) (symbol-name (package-desc-name d)))
                      dependencies ", "))
  (dolist (desc (nreverse dependencies))
    ;; The following fragment was taken from `package-unpack':
    ;; -------------------------------------------------------
    ;; Activation has to be done before compilation, so that if we're
    ;; upgrading and macros have changed we load the new definitions
    ;; before compiling.
    (when (package-activate-1 desc :reload :deps)
      ;; FIXME: Compilation should be done as a separate, optional, step.
      ;; E.g. for multi-package installs, we should first install all packages
      ;; and then compile them.
      (package--compile desc)
      ;; After compilation, load again any files loaded by
      ;; `activate-1', so that we use the byte-compiled definitions.
      (package--load-files-for-activation desc :reload))))

I'm now looking for a way to make sure this only happens once — that is, that not all future Flycheck updates cause the recompilation, only the first one introducing the breaking change.

Is there a way to know during byte-compilation which version of the package was previously installed?

Thanks!
Clément.



  reply	other threads:[~2018-07-30 21:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 20:12 Changing a cl-defstruct definition in a published package Clément Pit-Claudel
2018-07-13 17:01 ` João Távora
2018-07-13 17:38   ` Basil L. Contovounesios
2018-07-13 18:21     ` Clément Pit-Claudel
2018-07-13 18:26   ` Clément Pit-Claudel
2018-07-13 19:38     ` João Távora
2018-07-13 19:52       ` Clément Pit-Claudel
2018-07-13 20:40         ` Stefan Monnier
2018-07-13 21:07           ` Clément Pit-Claudel
2018-07-14  3:36             ` Stefan Monnier
2018-07-15  4:25               ` Clément Pit-Claudel
2018-07-15 13:11                 ` Stefan Monnier
2018-07-15 13:25                   ` Clément Pit-Claudel
2018-07-16  1:51                     ` Stefan Monnier
2018-07-30 21:52                       ` Clément Pit-Claudel [this message]
2018-07-30 22:49                         ` Stefan Monnier
2018-07-31  3:28                           ` Clément Pit-Claudel
  -- strict thread matches above, loose matches on Subject: below --
2018-07-19 20:27 Jake
2018-07-19 21:10 ` Stefan Monnier
2018-07-19 21:34   ` Jake

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=c8f771d3-54c9-b30c-5ff1-dec2934e5f6b@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.