Rust: support glob members in workspaces

This commit is contained in:
Paolo Tranquilli
2025-02-17 15:09:35 +01:00
parent 7fa41c438f
commit 755140152c
12 changed files with 68 additions and 4 deletions

View File

@@ -0,0 +1,4 @@
[workspace]
members = [ "*" ]
exclude = [ "other" ]
resolver = "2"

View File

@@ -0,0 +1,7 @@
[package]
name = "exe"
version = "0.1.0"
edition = "2021"
[dependencies]
lib = { path = "../lib" }

View File

@@ -0,0 +1,5 @@
use lib::hello;
fn main() {
hello();
}

View File

@@ -0,0 +1,6 @@
[package]
name = "lib"
version = "0.1.0"
edition = "2021"
[dependencies]

View File

@@ -0,0 +1,3 @@
pub fn hello() {
println!("Hello, world!");
}

View File

@@ -0,0 +1,6 @@
[package]
name = "other"
version = "0.1.0"
edition = "2021"
[dependencies]

View File

@@ -0,0 +1,3 @@
exe/src/main.rs
lib/src/lib.rs
other/src/lib.rs

View File

@@ -0,0 +1,10 @@
| Cargo.toml:0:0:0:0 | LoadManifest(Cargo.toml) |
| exe/src/main.rs:0:0:0:0 | Extract(exe/src/main.rs) |
| exe/src/main.rs:0:0:0:0 | Parse(exe/src/main.rs) |
| file://:0:0:0:0 | FindManifests |
| lib/src/lib.rs:0:0:0:0 | Extract(lib/src/lib.rs) |
| lib/src/lib.rs:0:0:0:0 | Parse(lib/src/lib.rs) |
| other/Cargo.toml:0:0:0:0 | LoadManifest(other/Cargo.toml) |
| other/src/lib.rs:0:0:0:0 | Extract(other/src/lib.rs) |
| other/src/lib.rs:0:0:0:0 | LoadSource(other/src/lib.rs) |
| other/src/lib.rs:0:0:0:0 | Parse(other/src/lib.rs) |

View File

@@ -0,0 +1,4 @@
import codeql.rust.elements.internal.ExtractorStep
from ExtractorStep step
select step

View File

@@ -0,0 +1,5 @@
import pytest
def test_cargo(codeql, rust, check_source_archive):
codeql.database.create()