From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qAylFI4ioWGC5QAAgWs5BA (envelope-from ) for ; Fri, 26 Nov 2021 19:08:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eKdmEI4ioWF5PgAA1q6Kng (envelope-from ) for ; Fri, 26 Nov 2021 18:08:14 +0000 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 89DBA14E02 for ; Fri, 26 Nov 2021 19:08:12 +0100 (CET) Received: from localhost ([::1]:55012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqfdr-0004hv-45 for larch@yhetil.org; Fri, 26 Nov 2021 13:08:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqfdi-0004hl-MR for bug-guix@gnu.org; Fri, 26 Nov 2021 13:08:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqfdi-00075w-E3 for bug-guix@gnu.org; Fri, 26 Nov 2021 13:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqfdi-0007Op-68 for bug-guix@gnu.org; Fri, 26 Nov 2021 13:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52107: An Idea Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 26 Nov 2021 18:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52107 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Nicholas von Klitzing Received: via spool by 52107-submit@debbugs.gnu.org id=B52107.163795003328378 (code B ref 52107); Fri, 26 Nov 2021 18:08:02 +0000 Received: (at 52107) by debbugs.gnu.org; 26 Nov 2021 18:07:13 +0000 Received: from localhost ([127.0.0.1]:60538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqfcv-0007Ne-7S for submit@debbugs.gnu.org; Fri, 26 Nov 2021 13:07:13 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:59874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqfct-0007NU-9v for 52107@debbugs.gnu.org; Fri, 26 Nov 2021 13:07:12 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id P6792600J4UW6Th01679wj; Fri, 26 Nov 2021 19:07:10 +0100 Message-ID: From: Maxime Devos Date: Fri, 26 Nov 2021 18:07:09 +0000 In-Reply-To: References: <7e36114357dd0ccd37490ed3b422364c709d60a3.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1637950030; bh=PNU1L3Ymo/lYq6qwWR9YkY/EUpy8V4I+UL1LpuF5atM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cgCUYsTxWZgaxgYHHdLdtZ3pD2MonD/ei5MptmrjHEAyfH6PgHipusC7lD+dlByW4 sD5qZuGZjp7RrxdVq0UjpXkWlbl3KeUuJrxYZjge2XnN6i+AfNjlPp7q6j01+b1LTy qjlinOfBivwjAvItTowjidD14RHCXO4vr9s0vqD4GZvFQ1MRke6bQDHEMhObgBa1rv cXfZkFvJxkcEC8mY+/AjlDilPxEUIQLq3gDq510bCxF2JZTsnvKeSOpakVjciN9s3P AvT/1S56GarxAjbM675x8KfaveGK/prMo9uUk2GmW0GcHMFEp0h7wpUe+2Zd6ddMDH otxzK2QwhErmw== 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: , Cc: 52107@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637950092; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PNU1L3Ymo/lYq6qwWR9YkY/EUpy8V4I+UL1LpuF5atM=; b=pkozyVqhky1vFz0K/oioD8akOyHyZc6x4atDn4MCbyFHF2wCIsJYnKYPTrGlff9KOJQOyp Tv2OPOaf9AKNfj4+QT6gXZU9SxblL0aGxRBocxQWDrt5iIdlNQtwwyQnyTEmxF/XUnsixc BLBu3co0WHdJs/W1RwmEh82/thXiCD/Pl3LxlHXkvJGIvWQK+2UbkxxPX7WqDeMfBzg8oB sx6l8rUW+f1k5dJ+inGrtLF1KJU7W84rhrxJNNfwT18R3KkafFY4fXWcFq42O+HmaS57rv aIh5BX12MttE8z7iH7SeYlMb2rS0XJSj0LHFKYz9nCrSRM+gXDhw8vfiyP24lQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637950092; a=rsa-sha256; cv=none; b=qgRE1oar5SHW63AvvaIbDyjrshLGankpZ0Z57BrJQ6oXAsUeMS/MK9AtspEDN6GwM8svXV 9QIycCic8yh8YNitq7gTYqzDiUjKfzrF7pHycUSCRBwbu62WtsMkX5k2s0cA4L/OBDEFyB 0cMS1ibUV8AX2KM+boNggdNH2J/OxZ1sPSdo/MP8DFwKlezrakohVuDCPDczGsuvj0bazD R31kk9GTesekTpf79iFEjoZeAS0swOXs6bsZkZP6JNbkUenEq5cOKAo2R5a1ONtmJOvgi1 /0K8xL9vuHsdmc1Tc75iFKuTO9NjGG3Bq19JPzP1faajXmWSu+hanTyKcNo5aw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=cgCUYsTx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=cgCUYsTx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 89DBA14E02 X-Spam-Score: -1.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: qlpTntEzPQTb Nicholas von Klitzing schreef op vr 26-11-2021 om 17:40 [+0000]: > That's definitely a much better solution. > > I'm having trouble finding documentation about both native-search- > paths and wrap-program, so let me know if I understand your > suggestions and how to apply them correctly. > > The rust-1.18 package has a native-search-paths declaration: > `` > (native-search-paths >      (list [...] >            ;; Do you mean add something along the lines of >            ;; this to every rust-xx package? >            (search-path-specification >             (variable "RUST_SRC_PATH") >             (files '("library"))))) ;; I'm not sure what arguments The package that is using RUST_SRC_PATH is rust-analyzer, not rust@some-version. As such, the search path should be added to rust- analyzer, not rust. Search paths are added to the consumer, not the producer, as I've seen it described somewhere. Probably (separator #f) should be added, because I don't think rust- analyzer supports using source code of multiple rusts at once. > this takes > > `` > The directory structure of the rust repository, changes over time, so > the paths would need to be adjusted depending on the version. Would I > also need to add an additional build step to copy over the source and > register it as an output? The idea is to copy the unpacked source code to some output (let's call it "source"). We would have to choose some subdirectory. Looking at the package definition of rust-analyzer, it appears to like ‘lib/rustlib/src/rust’, so the source code could be copied to (string- append #$output:src "/lib/rustlib/src/rust"). If that directory is used, files would be set to '("lib/rustlib/src/rust"). > And for the rust-analyzer package we then add something along the > lines of? > > `` > (add-after >             'install 'wrap-rust-analyzer >             (lambda* (#:key inputs outputs #:allow-other-keys) >               (let ((out             (assoc-ref outputs "out")) >                     (rust-src-path (getenv "RUST_SRC_PATH"))) >                 (wrap-program (string-append out "/bin/rust- > analyzer") >                   `("RUST_SRC_PATH" ":" prefix (,rust-src-path)))) >               #t)) > `` Both wrapping and a search path wouldn't make much sense: the wrapping would effectively override the search path, basically hard-coding the source code used. Either go for a wrapper, a search path, or a wrapper only setting the environment variable if it wasn't set already (*)(such that the wrapper only sets a default). (*) see docstring of wrap-program for how to do this, and whether it is actually possible. If you go for a wrapper instead of native-search-path, then RUST_SRC_PATH would be unset in the build environment, so the (getenv ...) would need to be replaced with (search-input-directory (or native- inputs inputs) "lib/rustlib/src/rust")). Greetings, Maxime