Skip to content

Allow the customization of sysroot_src in the generated rust-project.…#3306

Merged
illicitonion merged 6 commits intobazelbuild:mainfrom
photex:dev/chip/rust_analyzer_toolchain-rustc_srcs_path
Jun 22, 2025
Merged

Allow the customization of sysroot_src in the generated rust-project.…#3306
illicitonion merged 6 commits intobazelbuild:mainfrom
photex:dev/chip/rust_analyzer_toolchain-rustc_srcs_path

Conversation

@photex
Copy link
Copy Markdown
Contributor

@photex photex commented Feb 28, 2025

When specifying a local rust toolchain with an unconventional rust-src location; this attribute will allow you to influence what the sysroot_src path in the resulting rust-project.json.

In my particular case I'm working in a conda environment which I configure as a new_local_repo in my project.

There I define a rust toolchain and my rustc sources live in $CONDA_PREFIX/lib/rustlib/src/rust/library. By default, if I'm unable to provide this path, the resulting sysroot_src in my project ends up resolving to the equivalent of $CONDA_PREFIX/library.

…json

When specifying a local rust toolchain with an unconventional rust-src
location; this attribute will allow you to influence what the sysroot_src
path in the resulting rust-project.json.
@photex photex force-pushed the dev/chip/rust_analyzer_toolchain-rustc_srcs_path branch from 208efe1 to 4385abe Compare March 14, 2025 07:51
Copy link
Copy Markdown
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the huge delay here! This looks reasonable to me - do these simplifying suggestions make sense to you?

Comment thread rust/private/rust_analyzer.bzl Outdated
Comment thread rust/private/rust_analyzer.bzl Outdated
photex and others added 2 commits May 2, 2025 09:46
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
@photex
Copy link
Copy Markdown
Contributor Author

photex commented May 2, 2025

Thank you for the review and suggested improvements @illicitonion. :D

@illicitonion illicitonion added this pull request to the merge queue Jun 22, 2025
Merged via the queue into bazelbuild:main with commit 7020ecc Jun 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants