From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Changing a cl-defstruct definition in a published package Date: Mon, 30 Jul 2018 17:52:58 -0400 Message-ID: References: <9afc36c6-5759-6ea0-4cd4-9d6eb6b073b5@gmail.com> <87601jx6xa.fsf@gmail.com> <8806cd3a-da5f-28da-1aa6-fff611214396@gmail.com> <33b59faf-9357-706e-2239-68411096bc51@gmail.com> <133dfba4-e6c7-3aca-a39f-4d26a688c8b5@gmail.com> <285c8ce6-3cc0-a4ca-55c2-d95e68f05d22@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532987499 26121 195.159.176.226 (30 Jul 2018 21:51:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2018 21:51:39 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 30 23:51:34 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkG4j-0006eU-Kq for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2018 23:51:33 +0200 Original-Received: from localhost ([::1]:56054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkG6q-0005xW-AN for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2018 17:53:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkG6B-0005xJ-T7 for emacs-devel@gnu.org; Mon, 30 Jul 2018 17:53:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkG68-00064c-Ob for emacs-devel@gnu.org; Mon, 30 Jul 2018 17:53:03 -0400 Original-Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:38513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkG68-00063p-Jh for emacs-devel@gnu.org; Mon, 30 Jul 2018 17:53:00 -0400 Original-Received: by mail-qk0-x22b.google.com with SMTP id 126-v6so8921609qke.5 for ; Mon, 30 Jul 2018 14:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=jMDvbFr+6xDxIRpvMdhmlOT1ahujPfLbK2HcpQJWOyc=; b=uh5b0tCKpVd9vOYHix5KjIUaOgCG889eSIedoT8BQikuxv99HXbx0W8arI7EKof0XO rxJNyAhwx+fiYaI+RL91P9b2ZgDHF0cayVPpiKOVX+hiiWwXy5zgK9FOcfzSNqVr7f4N CpdtJW060kFvsJGQD0BtHp+/I+wIWhJ0kScrR1A7+I2ZV7mJRQ0sQBdzRwubZb+s7CEN qWF3DrQX2WjgSjhFEQYP3Vlc/XiSZLp4nzVUdYqL+vNcKmpkUjJMr5idEa8Z6x8qEbbt dM0B+DK1wBy/c6zuPQBaJb25tp3+DCZMd/J5CYO15dND48EmpQ/eA0JCpx6Mry2FWONo dmwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jMDvbFr+6xDxIRpvMdhmlOT1ahujPfLbK2HcpQJWOyc=; b=ZbZUigGgyEdhYPZYpLb4LjzvMzasa7iKFcbMy6xIGaoAjWWWXSonAkwBxkCbzxkJN7 ztImhfWfpTI1tj+nIVBR6lm2aZnacM54pGefBX1gAmmxiy83VleTd1pAWJrf80D+MDQD O35/zesdbrRBDtTTM3k1SqZlrM5rGyXrcShaOrpJNHYJb7cmuDGuETVk6TiidzIrUp6n XMbVwoDRqr6pEu2XWkq2AObJmOxwq9Z8zLkwppUy5xPH4H1NNz+i7b1nOZQIjmxb5N+c c+SFFlEGyiMpjv/hXPLdZR9FIy2qmUlnLlvDrsPBX7e7qliNMD7jEKzqjrVhRXMXhcXx Cmuw== X-Gm-Message-State: AOUpUlHOTpm4lvwgwGp7jSFQYBSMXJVfLfEjylwNrZNtAgoyjdWZwN5I wMyNzxFIUuGcO4b0QWN0wtdG3TX2 X-Google-Smtp-Source: AAOMgpeRH9Stg8HtuBEyFSy5RWd8W6e9rdelDa79jCas/1C7l2V43r6evmEcQyIfHXt3TeCq3I74uQ== X-Received: by 2002:a37:3a45:: with SMTP id h66-v6mr18010157qka.118.1532987579727; Mon, 30 Jul 2018 14:52:59 -0700 (PDT) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id t11-v6sm10261614qtc.2.2018.07.30.14.52.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 14:52:59 -0700 (PDT) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228022 Archived-At: 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.