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: Changing a cl-defstruct definition in a published package Date: Thu, 12 Jul 2018 16:12:54 -0400 Message-ID: <9afc36c6-5759-6ea0-4cd4-9d6eb6b073b5@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 1531426310 20939 195.159.176.226 (12 Jul 2018 20:11:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jul 2018 20:11:50 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 12 22:11:46 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 1fdhwI-0005J9-7P for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2018 22:11:46 +0200 Original-Received: from localhost ([::1]:33882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdhyP-0000tX-3R for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2018 16:13:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdhxR-0000rY-2H for emacs-devel@gnu.org; Thu, 12 Jul 2018 16:12:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdhxQ-0003B3-5H for emacs-devel@gnu.org; Thu, 12 Jul 2018 16:12:57 -0400 Original-Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:41879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdhxQ-0003Ac-01 for emacs-devel@gnu.org; Thu, 12 Jul 2018 16:12:56 -0400 Original-Received: by mail-qk0-x22d.google.com with SMTP id d22-v6so16102391qkc.8 for ; Thu, 12 Jul 2018 13:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=/AVp7P59SMSkqsiuhCWDDu2pvHED2xIV2DKFwYVzlQc=; b=jFj0XGuiWznG8zHS2beG3UzaXQDFpl74LI8U799MgIk3PIdk5mlMHXb0wT1XfoYhmG +gA1TUA5xc03/mNMBrZV+wq+8OaVw8b2Vu8hGdLfCLgQqQL+p4X9zSYBJ+UayLQ/gFsu DTc8uh3jcPyCFUwkKusZVRTqZoI75mI+wHgKiVp2SMDVe4V9VMSXAjVSlSjAgbwGJqJM Ktm3kPV2MLACfIXHSt23QS9qICu92GqJp/C4S6dwR0AiGMIKNee+kNiIe31xIUNOl5pQ Y5sDbZsZQnYy65csBq7shIL7g3OCN7wKnlp3SNJcRLLbqsvsthB8B9Uq6DbsutkglGh6 BCRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=/AVp7P59SMSkqsiuhCWDDu2pvHED2xIV2DKFwYVzlQc=; b=Ebgd+1OVAdTCdWR6CNaxQo7XJPOBeddXfT16AXrFn3Li7HFTBb/my4tP5fW3JdHeNe 4ae1gvChDptXRws14NDl+zR0JCf/lrngF9CpGMxbZjc4ybjQsj0km4B4fztU5YLY67wU vhuTA0nZICwZtRNYhRE+fMYVDirqYN8V/sSj45sFF2ljNpCvNxEjyMF6lwRooKuYFWUx nRHSWN6t9uarOQ9dEde8zc7lB7A+b/GflOKDhAO33Jcsy5nN3l3YS4WXKLJWzu79D2Dr 4pAAU+624MpVXTUNHSRlNH5LFENR6K8xOXjn1iXwcOLU+XQydWLYvywpVrxcGmtKf1jJ fAog== X-Gm-Message-State: AOUpUlFBx/wvvSByczHDjBOnARa4cHwS8tNkX2boRioMgMBqDnPv35oU v0gBqdYoJbxxctJRWVXnAx0WbPuS X-Google-Smtp-Source: AAOMgpfUQoYpbcykVev2fVjrdwQBzLQQIfrHOVW8aKsSMINtR7rUQxOquDmBR0QoErp8/9u8nBLpbg== X-Received: by 2002:a37:6d44:: with SMTP id i65-v6mr3009242qkc.142.1531426375220; Thu, 12 Jul 2018 13:12:55 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:8c91:a307:4721:dd91? ([2601:184:4180:66e7:8c91:a307:4721:dd91]) by smtp.gmail.com with ESMTPSA id s1-v6sm2231934qte.89.2018.07.12.13.12.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 13:12:54 -0700 (PDT) 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::22d 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:227299 Archived-At: Hi all, I'm sure this has already been discussed, but I couldn't find the relevant discussion. I'm running into issues trying to update a package without breaking other packages that depend on it. Advice would be very welcome. I maintain package A, which contains this: (cl-defstruct aaa-info line message) (provide 'aaa) Someone else wrote a package B that contains this: (require 'aaa) (defun bbb-print-message (info) (message (aaa-info-message info))) (provide 'bbb) Users have installed both packages through package.el. I update A by adding a new field to the definition of aaa-info, and push the update to ELPA or MELPA: (cl-defstruct aaa-info line column message) Users update using package.el, but this does not cause b to be recompiled. From this point on, any subsequent call to bbb-print-message to bbb-print-message fails: for example, (bbb-print-message (make-aaa-info :line 1 :column 2 :message "XYZ")) prints this: Debugger entered--Lisp error: (wrong-type-argument stringp 2) message(2) bbb-print-message(#s(aaa-info :line 1 :column 2 :message "XYZ")) Similarly, if I update the constructor of aaa-info to give the new 'column' field a default value, instances created by the previously-compiled B will still be missing the 'column' slot, leading to all sorts of errors. What is the recommended way to change a cl-defstruct definition without running into these issues? Thanks! Clément.