From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KBmtG+0a12PUSAAAbAwnHQ (envelope-from ) for ; Mon, 30 Jan 2023 02:18:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MBfBGu0a12MDEwAAG6o9tA (envelope-from ) for ; Mon, 30 Jan 2023 02:18:37 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BB6BF215A1 for ; Mon, 30 Jan 2023 02:18:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMIoH-0000Au-GY; Sun, 29 Jan 2023 20:18:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMIo6-00009t-Va for bug-guix@gnu.org; Sun, 29 Jan 2023 20:18:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMIo6-0006Hj-DO for bug-guix@gnu.org; Sun, 29 Jan 2023 20:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pMIo6-00006A-1C for bug-guix@gnu.org; Sun, 29 Jan 2023 20:18:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#61161: package-input-rewriting causes different ordering of grafts Resent-From: Akira Kyle Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 30 Jan 2023 01:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61161 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 61161@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1675041468355 (code B ref -1); Mon, 30 Jan 2023 01:18:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jan 2023 01:17:48 +0000 Received: from localhost ([127.0.0.1]:45643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMIns-00005f-CJ for submit@debbugs.gnu.org; Sun, 29 Jan 2023 20:17:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:55100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMInq-00005X-4o for submit@debbugs.gnu.org; Sun, 29 Jan 2023 20:17:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMInp-00008z-Qd for bug-guix@gnu.org; Sun, 29 Jan 2023 20:17:45 -0500 Received: from ms11p00im-qufo17281401.me.com ([17.58.38.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMInn-0006GK-Pc for bug-guix@gnu.org; Sun, 29 Jan 2023 20:17:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akirakyle.com; s=sig1; t=1675041461; bh=5rr+y4prxqYDcPcgiRlBqK4kkCkFKB8cY04pJ9D5Sio=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=e5NZ5VBSbmTTMVy5U0A+VL+JNeAOjSetuW2Z3uLSPtfppMWeJ7fLRFZMNceqSX+f8 K75BVdbZ6X17DQAzJ5AL8TmEuxsJ5rgNFoAmZ8aO2m2hS+P8zlO8qsNutJNIZUfWcR C31dD8Fj+9rAXKhSAn1r5EmWjuNQhhUUGnK39TRWdMej79JLDpKFHg1XhFc0rmU1jP NZJ/zovI/znwWI9lK7rSD+rQ6flnFQfP46mGY28L/rHWfUhJj2VblpXqZ1XLicDHmG hpevJ/utPA8Fx9WBzyiZjBbyMGMjnlviTLQgWXxN7x1KKjNX9iqZJ7yqTmJ0s5Wwmy IP0Ck5p05L07g== Received: from data (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-qufo17281401.me.com (Postfix) with ESMTPSA id D3D19BA03EE for ; Mon, 30 Jan 2023 01:17:40 +0000 (UTC) User-agent: mu4e 1.9.16; emacs 29.0.50 From: Akira Kyle Date: Sun, 29 Jan 2023 17:59:57 -0700 Message-ID: <875ycox1l8.fsf@akirakyle.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Proofpoint-ORIG-GUID: zy-L2FKCIeHxRZVjefUqoi1NYekoErCR X-Proofpoint-GUID: zy-L2FKCIeHxRZVjefUqoi1NYekoErCR X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.138, 18.0.572, 17.0.605.474.0000000 definitions=2020-02-14_11:2020-02-14_02, 2020-02-14_11, 2020-01-23_02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=534 phishscore=0 mlxscore=0 spamscore=0 clxscore=1030 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2301300010 Received-SPF: pass client-ip=17.58.38.51; envelope-from=akira@akirakyle.com; helo=ms11p00im-qufo17281401.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675041517; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=5rr+y4prxqYDcPcgiRlBqK4kkCkFKB8cY04pJ9D5Sio=; b=EVyJPkaM+X1JbIpFUpFWWGD9dzk1Qi0lhaYXYU1Tm9ID7kduzaWOU7fJZejeuizouktD1A AGGiJJiz5Oj4Dwi2VBKC+XWrsKxH2zX42R0P2J4za932id+/7ov4zK8BdIk2/XlwfdfzHc MznwzhrFr1UWEweSdpwVNUIshSqi1CpPaHbJEGZxnVjPlVBONvN72YD1z8SxjKYYIHUmrI Hg+reKVMh6LjYDi5SlOCFe+CoxiFN0XHQZUChsHhwaWeI4WVJximAebf2aiRRsQT0VrngD iALI9knEFB5pBrDWeECGzg/xXdlkEDSFX0BhbiqhIZIDWE96ZAAMDp/TpqWBxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=akirakyle.com header.s=sig1 header.b=e5NZ5VBS; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675041517; a=rsa-sha256; cv=none; b=mFwNIk3LHi87Lys7TGSKyTuNP887+k/on8XGZqe4MCiFjK7rjMLdQjOBAQTkRraIOIk50H OdreToKgv8ATmoGLIDC1vcUl0hQkLYKr7twQy1OeV2eLip3WhL3V7bRcmGlDdCERjL1xgY kPnd4sGNHb1OUUN4HmJ0Jo57YKPre9fnz3S/LWWIT3gSjkWGGRzauTQVxrKirY60u4cpAo vkwK70L6uRDLVBo1PKK6tVENUzdZOOB93GSM3cSfstVdyiV/umohn7+pIUfux00sXKwDkY +Qtw5lR5Fj05OFJR8PwBGiwX85BPy56C5PZi82KTzzOPRc3AEdhpw/rd42exAw== X-Spam-Score: 0.62 X-Migadu-Spam-Score: 0.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=akirakyle.com header.s=sig1 header.b=e5NZ5VBS; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BB6BF215A1 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2UwYVIJzDbHo I think this may be a strange, subtle bug and hopefully this is sufficient to reproduce. This was all done with guix commit da9af8c72fe427e3eeb718b53c599139a8958d61. Consider the following: (use-modules (guix packages) (guix gexp) (guix monads) (guix store) (guix git) (guix download) (guix git-download) (gnu packages compression) (gnu packages emacs-xyz)) (define (package-commit pkg commit checksum) "Return a package variant using the given commit and sha256." (package (inherit pkg) (name (package-name pkg)) (version (substring commit 0 7)) (source (origin (method git-fetch) (uri (git-reference (url (git-checkout-url (git-reference->git-checkout (origin-uri (package-source pkg))))) (commit commit))) (sha256 (base32 checksum)) (file-name (git-file-name name version)))))) (define emacs-magit-latest (package-commit emacs-magit "45be64e5f1ef0d03156c53543eb198829177a934" "19b1d4200x1rhffmxf834kh55nj2zjps09hkkhw9hrsdig3nlfl9")) (define emacs-compat-latest (package (inherit emacs-compat) (version "29.1.3.0") (source (origin (method url-fetch) (uri (string-append "https://elpa.gnu.org/packages/" "compat-" version ".tar.lz")) (sha256 (base32 "0jnk81rg5w6zhf413nf3j72i2mr8vfdms55gahrdx28727w8gfj8")))) (native-inputs (modify-inputs (package-native-inputs emacs-compat) (prepend lzip))))) (define with-replacements (package-input-rewriting `((,emacs-compat . ,emacs-compat-latest)))) (list emacs-magit-latest (with-replacements emacs-magit-latest) ) emacs-magit-latest depends on /gnu/store/xrwyv6s8gsazgb2hqxxvh3h6d9cvkxal-git-2.39.1.drv whereas (with-replacements emacs-magit-latest)` depends on /gnu/store/x2gd1dsqvpas4rwvlxdmj7p9w2d2ba49-git-2.39.1.drv Which is surprising since I didn't change anything about the git package. Following this a bit further reveals that the difference comes down to the grafts being applied to python where emacs-magit-latest depends on /gnu/store/848hfdz4xj91jail0y8lfj22dkgb3d12-python-3.9.9-builder whereas (with-replacements emacs-magit-latest)` depends on /gnu/store/f3b6wlkwnnp2zfm20br6hbc9i0pipi24-python-3.9.9-builder Inspecting these derivations, the difference between them seems to be that in the former has zlib first in the `mapping` field of the graft while in the latter zlib is last. My guess is this is due to the fact that the emacs-compat override adds lzip to its native-inputs and causes a different traversal order for grafting zlib. But this is my first time attempting to look at the grafting machinery in detail, so hopefully the experts can figure out if this really is a bug and how to fix it! I don't have a concrete example where this causes issues in practice, since here the two packages would conflict anyways due to different compat versions, but it seems like that's mostly a consequence of emacs-packages having propagated dependencies. At the very least it would seem to cause unnecessary duplication in the store.