From unknown Tue Sep 23 17:51:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52107: rust-analyzer shipped broken without rust-src Resent-From: Nicholas von Klitzing Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 25 Nov 2021 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52107 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 52107@debbugs.gnu.org X-Debbugs-Original-To: "bug-guix@gnu.org" Reply-To: Nicholas von Klitzing Received: via spool by submit@debbugs.gnu.org id=B.16378520223433 (code B ref -1); Thu, 25 Nov 2021 14:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2021 14:53:42 +0000 Received: from localhost ([127.0.0.1]:56303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqG86-0000tJ-Di for submit@debbugs.gnu.org; Thu, 25 Nov 2021 09:53:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:33210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqG81-0000t4-Qp for submit@debbugs.gnu.org; Thu, 25 Nov 2021 09:53:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqG81-0004HZ-K2 for bug-guix@gnu.org; Thu, 25 Nov 2021 09:53:37 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:52719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqG7x-0007V4-V3 for bug-guix@gnu.org; Thu, 25 Nov 2021 09:53:37 -0500 Date: Thu, 25 Nov 2021 14:53:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvk.pm; s=protonmail3; t=1637852003; bh=O4rMqUoutuPuvN+/rPHmM6NQOHsAywj//5FcQ2qUf9w=; h=Date:To:From:Reply-To:Subject:From; b=DDNByAXKKDtGFj3nBBfKgiQdNSqub5+IdLKstEUfbkNiBb0/y51f9eoPSA+XIVIrY s+Yk+G4ORHFn3595N1DIjkTdsirQ1fvAqPsJLWYFmu/y4La27+vw+G9PWPpc0LvKu7 XU+qMRX9+HD9fTgRHoHVH6jcML0G2D+Ayl/yknqANJStEFyFh6L5YJei6W2kMWDa9J Y0x8FUgfIGzqQnQYs0NOaVsvdyGtxs/zt6ECZfRh+LYzWhK6hcMbu2Sm2fqicoaR36 /8pmRMIw2LajtQDsazttF8x2rkKgh8Fg35tc/UDTT1GpebUdpMr1qmTDS5YVacqhwP /xtQK/EGq1q6A== From: Nicholas von Klitzing Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.136; envelope-from=nicholas@nvk.pm; helo=mail-40136.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello Guix, The rust-analyzer package depends on having a local copy of the rust compil= er (rustc) source code available in order for it to function. Currently, neither the rust-analyzer nor the rust package include rust-src,= which means rust-analyzer is broken by default. On non-guix systems the rustc source code is usually installed using `rustu= p component add rust-src`. The workaround I'm currently using is to run `guix build --source rust` fol= lowed by adding `export RUST_SRC_PATH=3D/home/$user/rustc-$version-src/libr= ary` to ~/.profile following every rust upgrade. rust-analyzer is a crucial tool for many rust developers, so this experienc= e should definitely be improved or at least documented. I am not very familiar with guix and therefore cannot recommend a good way = to solve this. What would possible solutions to this issue be? Kind regards, Nicholas From unknown Tue Sep 23 17:51:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52107: An Idea References: In-Reply-To: Resent-From: Nicholas von Klitzing Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 26 Nov 2021 09:43: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: "52107@debbugs.gnu.org" <52107@debbugs.gnu.org> Reply-To: Nicholas von Klitzing Received: via spool by 52107-submit@debbugs.gnu.org id=B52107.16379197726006 (code B ref 52107); Fri, 26 Nov 2021 09:43:02 +0000 Received: (at 52107) by debbugs.gnu.org; 26 Nov 2021 09:42:52 +0000 Received: from localhost ([127.0.0.1]:58696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqXkq-0001Yn-Gg for submit@debbugs.gnu.org; Fri, 26 Nov 2021 04:42:52 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:13827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqXkn-0001YW-JW for 52107@debbugs.gnu.org; Fri, 26 Nov 2021 04:42:50 -0500 Date: Fri, 26 Nov 2021 09:42:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvk.pm; s=protonmail3; t=1637919762; bh=qIdXtZpm7pxWo5Uews5RDLbw2nxMIzRBtDodbdI/3oE=; h=Date:To:From:Reply-To:Subject:From; b=QYoXWmNYyHwxU6yyESZKaWOwkp3tFb/3Mpfi7bSWu92Jkb5TKk1eY7mUG0SBTT/E/ d0rJI1N5B+s63hgLzI5TVTn+XdXFxYHHUMZ3YV2Poqqhh2NuRdyrXOrqaXlzbivGy3 rp5jC0JVHCcKk6p50TJXaQboczqcuLEJiZfPEErS+5Uyah2h7I314x39F+aLXBUCaz G8XfViCWZay5rm2eOK8qMPGCfQh79tYTvY5ZHJjZZc9IYg6knjv809uLQG5wGf2lc6 FzzoKWv3l79qrVh9TuzQLPJMeHp2pozsvqSkxfNDeR9btfx7S536vh0Zuk/UMaERCZ qhy9Om+r3cZZQ== From: Nicholas von Klitzing Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Just to get the ball rolling, here is a possible idea. It might makes sense to add an additional output to the rust package `src` = and then require this by the rust-analyzer package as `rust:src`. In the rust-analyzer package we could then copy a thing from `icedove-wayla= nd`: `` (arguments '(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((bash (assoc-ref %build-inputs "bash")) (icedove (assoc-ref %build-inputs "icedove")) (out (assoc-ref %outputs "out")) (exe (string-append out "/bin/icedove"))) (mkdir-p (dirname exe)) (call-with-output-file exe (lambda (port) (format port "#!~a ;; This style of overriding environment variables could be used for ;; RUST_SRC_PATH, although I am not sure if this is the idiomatic ;; way to do it. MOZ_ENABLE_WAYLAND=3D1 exec ~a $@" (string-append bash "/bin/bash") (string-append icedove "/bin/icedove")))) ... ((icedove) out)) #t)))) `` From unknown Tue Sep 23 17:51:33 2025 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 14:22:01 +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 , "52107@debbugs.gnu.org" <52107@debbugs.gnu.org> Received: via spool by 52107-submit@debbugs.gnu.org id=B52107.163793649827695 (code B ref 52107); Fri, 26 Nov 2021 14:22:01 +0000 Received: (at 52107) by debbugs.gnu.org; 26 Nov 2021 14:21:38 +0000 Received: from localhost ([127.0.0.1]:59016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqc6c-0007Cd-9U for submit@debbugs.gnu.org; Fri, 26 Nov 2021 09:21:38 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:46304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqc6a-0007CU-AQ for 52107@debbugs.gnu.org; Fri, 26 Nov 2021 09:21:37 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id P2Ma260084UW6Th062MaTB; Fri, 26 Nov 2021 15:21:34 +0100 Message-ID: <7e36114357dd0ccd37490ed3b422364c709d60a3.camel@telenet.be> From: Maxime Devos Date: Fri, 26 Nov 2021 14:21:34 +0000 In-Reply-To: References: 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=1637936494; bh=HrvxBURLyIn7c+wACCSlHw1MTzfEFb0yc2r1m7o9unA=; h=Subject:From:To:Date:In-Reply-To:References; b=VUpE4SYkoZFLawFBqw7T6YGRmcd1/ZpEHGFfCqAjzVRbtXrRTPv6xlPE9EiX9hJjt wWRIBgbtLIhkWFvsHdO8mxLd7nXVgcIOiIRd9xY9zBj4B/PlpnMB5WrBxVLpAWvtjK YT7qd/JUP6ppzqPGcUm6rPHggIYsTEctDMmhqudClzFEAJkeQh8GzgmmgfhvgMJk6K ALyy8z9kbFDSJJjkoYuuYar1OL1v15wr/IxAQhZvSCnuNCRWQNaQxYWGjqS0KvJGGv V1eOlQDd2zyU2lFikGVra7l+ABU4tRE1NarTPQhPGTzwgS7QDCVsYzPZU/EeLr9rBy va+xTUtlLoUmQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Nicholas von Klitzing schreef op vr 26-11-2021 om 09:42 [+0000]: > Just to get the ball rolling, here is a possible idea. > > It might makes sense to add an additional output to the rust package > `src` and then require this by the rust-analyzer package as > `rust:src`. I'd use a native-search-path instead of a wrapper setting the environment variable, such that rust-analyzer can be used with any version of rust and the user can override the source code used. > In the rust-analyzer package we could then copy a thing from > `icedove-wayland`: > [ >  ...]           (call-with-output-file exe >               (lambda (port) >                 (format port "#!~a > ;; This style of overriding environment variables could be used for > ;; RUST_SRC_PATH, although I am not sure if this is the idiomatic > ;; way to do it. >  MOZ_ENABLE_WAYLAND=1 exec ~a $@" 'wrap-program' could be used here, instead of manually making shell scripts. Greetings, Maxime From unknown Tue Sep 23 17:51:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52107: An Idea Resent-From: Nicholas von Klitzing Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 26 Nov 2021 17:41:01 +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: Maxime Devos Cc: "52107@debbugs.gnu.org" <52107@debbugs.gnu.org> Reply-To: Nicholas von Klitzing Received: via spool by 52107-submit@debbugs.gnu.org id=B52107.163794842325571 (code B ref 52107); Fri, 26 Nov 2021 17:41:01 +0000 Received: (at 52107) by debbugs.gnu.org; 26 Nov 2021 17:40:23 +0000 Received: from localhost ([127.0.0.1]:60529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqfCw-0006eN-Oy for submit@debbugs.gnu.org; Fri, 26 Nov 2021 12:40:23 -0500 Received: from mail-4323.proton.ch ([185.70.43.23]:20757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqfCs-0006e6-QI for 52107@debbugs.gnu.org; Fri, 26 Nov 2021 12:40:21 -0500 Date: Fri, 26 Nov 2021 17:40:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvk.pm; s=protonmail3; t=1637948411; bh=QCCdsKkaEFlgUgKsZCthSpdzIoOZPjvZJqiZH32Hmls=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=vxoZ4ueQ3u2O2FtX+l2hQhCPJSuEzgTm6nIQja1aGhlyAzblN7i+f4VGT0GR9gZtz 8ECw5HpkOtjX3n6v58+u4r81PH5VAqGTpoWlJrqCmgYdlggy5D1eyd5DtLenoqZATz DI0wOH2bhcqFdt0VIqKqpY5KpkfkxqJUGT31r4qsLZM06DzfoLLd57HRxwtW7EoTus wb07lCvrB88pjNPt2KvdSBSNyKpn+Q4WgrGZRitz7kVRsU/asN2RMLI3mtizKPDMlq ydNOTWgqvYjVoHrELC98IkQ7MCAY5B8l7HGl/V3VKEUARvViwlQeT8b8ZAFSN/++7S osrGAEiQVh3Gg== From: Nicholas von Klitzing Message-ID: In-Reply-To: <7e36114357dd0ccd37490ed3b422364c709d60a3.camel@telenet.be> References: <7e36114357dd0ccd37490ed3b422364c709d60a3.camel@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 a= pply them correctly. The rust-1.18 package has a native-search-paths declaration: `` (native-search-paths (list (search-path-specification (variable "C_INCLUDE_PATH") (files '("include"))) (search-path-specification (variable "CPLUS_INCLUDE_PATH") (files '("include/c++" "include"))) (search-path-specification (variable "LIBRARY_PATH") (files '("lib" "lib64"))) ;; 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 this tak= es `` The directory structure of the rust repository, changes over time, so the p= aths 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? 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)) `` I'd appreciate your feedback, since I'm mostly clueless :) Kind regards, Nicholas =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, November 26th, 2021 at 2:21 PM, Maxime Devos wrote: > Nicholas von Klitzing schreef op vr 26-11-2021 om 09:42 [+0000]: > > > Just to get the ball rolling, here is a possible idea. > > > > It might makes sense to add an additional output to the rust package > > > > `src` and then require this by the rust-analyzer package as > > > > `rust:src`. > > I'd use a native-search-path instead of a wrapper setting the > > environment variable, such that rust-analyzer can be used with any > > version of rust and the user can override the source code used. > > > In the rust-analyzer package we could then copy a thing from > > > > `icedove-wayland`: > > > > [ > > > > =C2=A0...]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (call-with-output-file exe > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (lambda (port) > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (format port "#!~a > > > > ;; This style of overriding environment variables could be used for > > > > ;; RUST_SRC_PATH, although I am not sure if this is the idiomatic > > > > ;; way to do it. > > > > =C2=A0MOZ_ENABLE_WAYLAND=3D1 exec ~a $@" > > 'wrap-program' could be used here, instead of manually making shell > > scripts. > > Greetings, > > Maxime From unknown Tue Sep 23 17:51:33 2025 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 Cc: 52107@debbugs.gnu.org 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-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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