Comments (1)
Fyi, I'm using this patch to get around this. Not sure if this is something we'll want to merge in
diff --git a/rust/private/rust_analyzer.bzl b/rust/private/rust_analyzer.bzl
index 3eea6c08..e2111671 100644
--- a/rust/private/rust_analyzer.bzl
+++ b/rust/private/rust_analyzer.bzl
@@ -204,10 +204,9 @@ def _create_single_crate(ctx, info):
# TODO: Some folks may want to override this for vendored dependencies.
is_external = info.crate.root.path.startswith("external/")
is_generated = not info.crate.root.is_source
- path_prefix = _EXEC_ROOT_TEMPLATE if is_external or is_generated else ""
- crate["is_workspace_member"] = not is_external
- crate["root_module"] = path_prefix + info.crate.root.path
- crate_root = path_prefix + info.crate.root.dirname
+ crate["is_workspace_member"] = True
+ crate["root_module"] = info.crate.root.path
+ crate_root = info.crate.root.dirname
if info.build_info != None:
out_dir_path = info.build_info.out_dir.path
diff --git a/tools/rust_analyzer/aquery.rs b/tools/rust_analyzer/aquery.rs
index 98f145be..fda67a04 100644
--- a/tools/rust_analyzer/aquery.rs
+++ b/tools/rust_analyzer/aquery.rs
@@ -100,6 +100,14 @@ pub fn get_crate_specs(
serde_json::from_reader(f)
.with_context(|| format!("Failed to deserialize file: {}", file.display()))
})
+ .map(|krate| {
+ let mut krate: CrateSpec = krate?;
+ let fullpath = workspace.join(&krate.root_module);
+ if let Ok(path) = std::fs::canonicalize(&fullpath) {
+ krate.root_module = path.into_os_string().into_string().unwrap();
+ }
+ Ok(krate)
+ })
.collect::<anyhow::Result<Vec<CrateSpec>>>()?;
consolidate_crate_specs(crate_specs)
from rules_rust.
Related Issues (20)
- nobzlmod behaves very differently than bzlmod HOT 4
- cargo_build_script: Some `CARGO_*` environment variables are not set HOT 6
- [BUG] - v0.43.0+ cargo-bazel generates bad selects HOT 2
- Error if dependency of dependency is not provided to`proto_library` HOT 1
- @rules_rust//:rustfmt depends on a copy of rustfmt built for the 'exec' platform, not the 'target' platform
- [BUG] 0.46.0 Selects wrong Tokio version HOT 3
- [BUG] cannot specify list extra_rustc_flags in rust_register_toolchains
- bzlmod crate annotations don't support setting gen_binaries to True HOT 1
- [BUG] Can't link to c++ dependencies on v0.46.0 HOT 1
- Bzlmod has no support for strip_level or opt_level HOT 3
- Feature: support auidt crates
- rust_bindgen should not require a static library HOT 1
- Restore thumbv7em-none-eabihf support
- Get at the output of `build.rs` from the execution of cargo_build_script, and/or files HOT 3
- rust analyzer support doesn't handle aliases properly
- repositories.bzl:835:9: name 'json' is not defined HOT 5
- gen_rust_project triggers download of -everything- HOT 1
- [Bazel CI] rust_project_json_test test is failing at Bazel@HEAD HOT 3
- segfault in test process glue when llvm_prof missing in rust 1.79
- rust_analyzer ignores repo srcs in crates with generated srcs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_rust.