-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Tweak nix shell & helix config #147848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tweak nix shell & helix config #147848
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
28f077d to
ae6e555
Compare
src/tools/nix-dev-shell/shell.nix
Outdated
| ] ++ lists.flatten (attrsets.attrValues env); | ||
|
|
||
| shellHook = '' | ||
| export PATH=$(pwd)/build/host/stage0/bin:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds stage0 tools (rustc, cargo) to path. This allows r-a to pick them up, which is arguably the right thing (rustc should be compiled by stage0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want stage0 rustc in my path 😨, I want rustup rustc in my path which I can use properly to use my linked toolchains and everything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the issue I'm running into is this: I don't use rustup. therefore r-a picks up cargo/rustc from $PATH. I want it to pick up the stage0 stuff.
I agree that this hack is awful, but I'm not sure what would be a proper solution. I've skimmed comments on rust-lang/rust-analyzer#3154 and it seems like all solutions assume rustup...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything stopping you from just using rustup in the shell?
This will break using rustc directly so that seems really bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing is technically stopping me, I just don't want to use rustup ^^'
either way, I removed this. I fixed the problem on my side by adding the following to my helix config:
[language-server.rust-analyzer.environment]
RUSTC = "/home/wffl/prog/rust-r/build/host/stage0/bin/rustc"
CARGO = "/home/wffl/prog/rust-r/build/host/stage0/bin/cargo"| pkgs.nix | ||
| pkgs.glibc.out | ||
| pkgs.glibc.static | ||
| pkgs.rust-analyzer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this goes towards an aspect of editor configuration that is the users responsibility and not the projects, though I guess having the package around doesn't hurt even when it's unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, idk about this too. The reason I added this is that I want for the shell to work with 0 outside setup, including having any tools (like r-a or even cargo).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Noratrieb should I remove this from this PR?
ae6e555 to
294ae3f
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
src/etc/rust_analyzer_helix.toml
Outdated
|
|
||
| [language-server.rust-analyzer.config.cargo.buildScripts] | ||
| enable = true | ||
| invocationLocation = "root" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/etc/rust_analyzer_settings.json doesn't have invocationLocation = "root", AFAICT it's no longer relevant: rust-lang/rust-analyzer#17888.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed ✅
294ae3f to
8815d57
Compare
r? Noratrieb