Skip to content

fix: Wrap rust-analyzer when rust-src is present#233

Open
eureka-cpu wants to merge 1 commit intostagingfrom
eureka-cpu/rust-analyzer-wrapped
Open

fix: Wrap rust-analyzer when rust-src is present#233
eureka-cpu wants to merge 1 commit intostagingfrom
eureka-cpu/rust-analyzer-wrapped

Conversation

@eureka-cpu
Copy link
Contributor

Closes #232

This wraps rust-analyzer by default if the toolchain contains the rust-src component, exporting RUST_SRC_PATH. This also adds the option to override the nightly rust-analyzer with rust-src from a toolchain.

@eureka-cpu eureka-cpu self-assigned this Feb 17, 2026
@eureka-cpu eureka-cpu added the enhancement New feature or request label Feb 17, 2026
@eureka-cpu
Copy link
Contributor Author

Still need to test for the vs code extension and try it out in a few different terminal based editors.

@eureka-cpu
Copy link
Contributor Author

Tested it out in the helix editor on linux, seems to work fine. Looks like I need to investigate some build failure on macos.

@eureka-cpu eureka-cpu force-pushed the eureka-cpu/rust-analyzer-wrapped branch from d67fb78 to cd8816a Compare February 18, 2026 01:50
@eureka-cpu
Copy link
Contributor Author

Okay, I think I just needed to patch the correct binary if it gets wrapped that actually changes, but linux is less picky.

Ah here's the culprit:

rust-analyzer-preview-nightly-complete> error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/n8dxsy2r4h1w9x79f2q89d6gdzzn49ci-rust-analyzer-preview-nightly-complete-2026-02-17/bin/.rust-analyzer-wrapped (for architecture arm64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)

@figsoda
Copy link
Member

figsoda commented Feb 18, 2026

Sorry for not taking a look at the original issue earlier, but I don't think this is needed: #232 (comment)

@eureka-cpu
Copy link
Contributor Author

Sorry for not taking a look at the original issue earlier, but I don't think this is needed: #232 (comment)

I replied there, but just for posterity I'm actually having the same issues even while using withComponents, but this wrapper does solve the issue for me.

The macos failure is actually on main as well, I just ran it locally on my M1.

@figsoda figsoda changed the base branch from main to staging February 18, 2026 03:03
@eureka-cpu eureka-cpu force-pushed the eureka-cpu/rust-analyzer-wrapped branch from cd8816a to 30c8e5d Compare February 18, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust-analyzer doesn't have access to rust-src by default

2 participants