From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pankaj Jangid Newsgroups: gmane.emacs.bugs Subject: bug#59214: [PATCH] Alternate rust-analyzer command added Date: Thu, 17 Nov 2022 15:48:27 +0530 Message-ID: <8735ahsx3g.fsf@codeisgreat.org> References: <87o7tc2xu8.fsf@codeisgreat.org> <83leoag78l.fsf@gnu.org> <83fseig0h0.fsf@gnu.org> <87sfiirulw.fsf@xyz.invalid> <875yfem21z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26642"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59214@debbugs.gnu.org, Eli Zaretskii To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 17 11:19:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovbzQ-0006i2-HX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Nov 2022 11:19:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovbz7-0002CH-NS; Thu, 17 Nov 2022 05:19:05 -0500 Original-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 1ovbz4-0002Bs-8m for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 05:19:02 -0500 Original-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 1ovbz3-0000Vu-WA for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 05:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovbz3-0003Wx-Pr for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 05:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pankaj Jangid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2022 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59214-submit@debbugs.gnu.org id=B59214.166868032013543 (code B ref 59214); Thu, 17 Nov 2022 10:19:01 +0000 Original-Received: (at 59214) by debbugs.gnu.org; 17 Nov 2022 10:18:40 +0000 Original-Received: from localhost ([127.0.0.1]:59202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovbyi-0003WN-4H for submit@debbugs.gnu.org; Thu, 17 Nov 2022 05:18:40 -0500 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:37761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovbyf-0003W8-Ar for 59214@debbugs.gnu.org; Thu, 17 Nov 2022 05:18:38 -0500 Original-Received: by mail-pj1-f49.google.com with SMTP id d59-20020a17090a6f4100b00213202d77e1so5020614pjk.2 for <59214@debbugs.gnu.org>; Thu, 17 Nov 2022 02:18:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeisgreat-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bZ1/C6ZbNXlyQG7GJk0PzYCrxFdMzi2ap7xuVWFOIMc=; b=A2VJdZ/Wy+wXnDGySKgXSjH3VKGWBLvfZboVSzEXVSaG4FD5eD0PXVy6+/M8Pj6Cga 3gff3/tsKL50rfyP4Sazsou3OPckjuW6VRctlNDdRh4oiwU6Py9X7a5RT+8wYFIlDeS9 +Z1jUwAEp6nwcMKN/xE/NcAL2BjQJWY/+1mmDwlcT6ooh6S6PMg/NoS/IjXRuNxqHduH RswzSgRgR/9ObIsgwVfb1PQwR0FbwzHcnlha65vyzv8LL4wtUwBlPPI0nTC4RfSIUkqG oXu8j378cGiHcjf6q7s8bhbA8wMj03sswNZWsowurIE/lXyxkG1xDjH7Xt3MSphYjztp Rscg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bZ1/C6ZbNXlyQG7GJk0PzYCrxFdMzi2ap7xuVWFOIMc=; b=Hq51wPrdEtkizQCuf8RPEvbkarzusqp6C80uq8Ptytdo6O01i8QDvsW5UHHtTnViL/ J4WjPyBxQoj6oTkK7m9h1PzATbZEVgU6ZQOHig3xF3ugEhcHnMQKcnUYllIeHAVs9VOf aG5ZEKJ9ttubrFbNvMrnwovQA9GOpvNNQFhWOwGrXPt++UHmhj8dGrhXBjsbjU2Fut7C kAgq4s2T/3aa4ogt75BQalilLpSdjIQfUJsBRHb7Up1g52CvxenRGOOFq90+9StGRaDo E6YgW9iXC+wHGMd1yFRSElIuSFGipE8e0iGKB1+FRxQTut+VIVBGjPGxDFEvtC9axvRK goSA== X-Gm-Message-State: ANoB5pnrrlAP8JXG0dd5yzcf0mrs0W2wg2SXmUoNpBxKjV/tOrxecgBP xWO1sTAgWGuQZ4QTIu6khJekpIEVmF5ozA== X-Google-Smtp-Source: AA0mqf4kviR/2zBGDjj3ZCxndTtQ/H7JkE0jd0ifPW/5LuHIUfRh/Enz1xlUiIzfVqc6sOVuZeHmIQ== X-Received: by 2002:a17:903:31ce:b0:186:5f71:7939 with SMTP id v14-20020a17090331ce00b001865f717939mr1999081ple.162.1668680311210; Thu, 17 Nov 2022 02:18:31 -0800 (PST) Original-Received: from anant ([49.36.236.45]) by smtp.gmail.com with ESMTPSA id a6-20020a1709027e4600b0017f36638010sm827640pln.276.2022.11.17.02.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 02:18:30 -0800 (PST) In-Reply-To: <875yfem21z.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Thu, 17 Nov 2022 08:13:12 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248107 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > 1. If I was to start developing rust today as a average programmer but > Rust newbie and I installed one of these "stable" or "nightly" > things, which one would I probably pick? And would I have a > 'rust-analyzer' executable in my PATH as a result of that? If the installation was done using `rustup', as described in the official page - https://www.rust-lang.org/tools/install, then `rust-analyzer' executable will not be in PATH. But as pointed out by Ian, there may be other users who are following alternate installation methods. So keeping one or the other in server programs will be annoying for at least one set of users. > 2. What are the odds that a average Rust programmer understands a > message telling her > > "Searching for program: No such file or directory, rust-analyzer" > > and endeavors to create a 'rust-analyzer' script with sth like > > #!/bin/sh > rustup run rust-analyzer > > somewhere in this config? > > Node JS/NPM also has this 'npm link' which creates a global link to a > given specific version of an NPM package, and that includes ensuring > its executables are in the PATH. Is there such a thing in RustVille? If user has installed rust-analyzer using some other package manager from their distribution then this problem won't occur. But if user is following the `rustup' path then there are features like `rustup which' that user can use to find the location of executable and then create a link in an accessible location. It will not be difficult for a GNU/*nix user. But windows users will have to add the whole directory (return by `rustup which') in PATH. I can speak for myself though. It is easy for me to create that link. But I don't want to touch the directory which is managed by `rustup'. It would be best if `rust-analyzer' works out-of-box if I just install, Emacs and Rust (via rustup). Then I would just say, (add-hook 'rust-mode-hook #'eglot-ensure) > 3. What are the chances that an average Rust programmer stumbles across > the Eglot manual and reaches: > > (with-eval-after-load 'eglot > (add-to-list 'eglot-server-programs > ("fools" "--stdio"))) > > And understands what to do? If user is conversant with Emacs, this is ok. If the user is new to Emacs as well, then he/she might have some difficulty understanding this. > 4. The 'rust-analyzer' executable that was once, somehow, an > out-of-the-box thing, right? Why is it not anymore? Is it > temporary, i.e. it coming back in the future? Or does Rust frown > upon these things and inequivocally prefers 'rustup run' from now on? > Or was it never an out-of-the-box thing? If so, why is it in > eglot.el as if it was? I am not sure about this. I have never seen this in my PATH. May be because I just use `rustup' to install/update, like I use `apt' in Debian. > 5. If you take away the current 'rust-analyzer' entry, how many bug > reports from annoyed users will we get? 0? 1? Million? After reading Ian's arguments, I feel that it is best to keep both -- rust-analyzer and rustup ... -- to make it convenient for both non-rustup users and rustup users. So the first patch was more suitable.