mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: allow to specify more cargo configuration options
This allows to tweak via extractor options some aspects of the cargo configuration: * the target architecture * features (including `*` for all, which we must understand whether to set by default) * cfg overrides Integration tests will be added in a follow-up commit.
This commit is contained in:
@@ -130,11 +130,9 @@ fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
extractor.extract_without_semantics(file, "no manifest found");
|
||||
}
|
||||
let target_dir = &cfg
|
||||
.cargo_target_dir
|
||||
.unwrap_or_else(|| cfg.scratch_dir.join("target"));
|
||||
let cargo_config = cfg.to_cargo_config();
|
||||
for (manifest, files) in map.values().filter(|(_, files)| !files.is_empty()) {
|
||||
if let Some((ref db, ref vfs)) = RustAnalyzer::load_workspace(manifest, target_dir) {
|
||||
if let Some((ref db, ref vfs)) = RustAnalyzer::load_workspace(manifest, &cargo_config) {
|
||||
let semantics = Semantics::new(db);
|
||||
for file in files {
|
||||
let Some(id) = path_to_file_id(file, vfs) else {
|
||||
|
||||
Reference in New Issue
Block a user