Commit Graph

263 Commits

Author SHA1 Message Date
Paolo Tranquilli
c844db09d2 Merge branch 'redsun82/rust-pick-edition' into redsun82/cargo-upgrade 2025-04-11 17:03:29 +02:00
Paolo Tranquilli
868680f078 Merge branch 'redsun82/rust-fix-member-aggregation' into redsun82/rust-pick-edition 2025-04-11 16:46:16 +02:00
Paolo Tranquilli
60aa3a8d9d Rust: fix workspace member aggregation when absolute path is a glob pattern
We were interpreting the absolute path of a workspace as a glob pattern,
which doesn't work if the path has some special characters (e.g. `[` or
`]`).
2025-04-11 16:41:51 +02:00
Paolo Tranquilli
dbbd80f4dc Rust: pick correct edition for the files
Previously we would unconditionally set the edition to the latest stable
according to rust-analyzer (2021 at the moment). Now we ask
rust-analyzer itself to pick the correct edition for the file.
2025-04-11 15:36:45 +02:00
Paolo Tranquilli
260322b669 Rust: fix compilation errors 2025-04-07 15:25:19 +02:00
Paolo Tranquilli
afb97d2797 Rust: regenerate schema 2025-04-07 14:34:33 +02:00
Paolo Tranquilli
db9c908d1d Cargo: upgrade dependencies 2025-04-07 14:30:00 +02:00
Arthur Baars
1d49252c03 Rust: QLTest: delete Cargo.lock files 2025-04-01 12:38:57 +02:00
Paolo Tranquilli
32f6acb985 Rust: fix compilation errors after rename 2025-03-31 13:11:45 +02:00
Paolo Tranquilli
1c89b5185a Rust: rename RecordFieldList to StructFieldList 2025-03-31 13:11:45 +02:00
Paolo Tranquilli
24f547074f Rust: fix extractor compilation errors after renames 2025-03-31 13:11:44 +02:00
Paolo Tranquilli
8bfc1c424e Rust: rename several entities using more accepted names 2025-03-31 13:07:43 +02:00
Paolo Tranquilli
1eb51c7a2f Merge pull request #19063 from github/redsun82/codegen-rename-dbscheme
Codegen: add `ql.db_table_name` property pragma
2025-03-31 12:01:35 +02:00
Arthur Baars
c135af2300 Rust: crate_graph: generate 'use' statements for re-exported items 2025-03-28 17:12:32 +01:00
Paolo Tranquilli
01a69bffbe Merge branch 'main' into redsun82/codegen-rename-dbscheme 2025-03-28 15:06:08 +01:00
Paolo Tranquilli
bd201afa8e Rust: apply formatting and linting 2025-03-21 11:00:30 +01:00
Paolo Tranquilli
8f8fe2f8b6 Rust: silence warning by removing unused generated function 2025-03-21 10:59:39 +01:00
Paolo Tranquilli
04f9694f89 Rust: drop extraction of anonymous canonical paths 2025-03-21 09:47:02 +01:00
Arthur Baars
cf8e270384 Rust: fix crate_graph.rs 2025-03-20 19:08:10 +01:00
Paolo Tranquilli
fe7e1c0a6c Rust: solve all compilation errors but the ones related to the crate graph 2025-03-20 17:49:35 +01:00
Paolo Tranquilli
7cf3cac24a Rust: reinstate Variant as Addressable 2025-03-20 16:55:37 +01:00
Paolo Tranquilli
ea11b08f28 Rust: rerun code generation 2025-03-20 16:51:35 +01:00
Paolo Tranquilli
13370200cc Cargo: upgrade dependencies 2025-03-20 16:48:29 +01:00
Paolo Tranquilli
b48d9a255e Rust: undo rename of Path::segment to Path::part 2025-03-20 16:30:35 +01:00
Paolo Tranquilli
cd15fb3611 Merge pull request #19071 from github/redsun82/codegen-rust-ancestor-order
Rust: preserve ordering in rust generated code
2025-03-20 15:50:48 +01:00
Paolo Tranquilli
e2d6643600 Merge pull request #19072 from github/redsun82/rust-fix-canonical-paths-after-rename
Rust: fix canonical paths broken on `StructExpr` and `StructPath`
2025-03-20 13:40:24 +01:00
Paolo Tranquilli
e9b931e2aa Merge branch 'main' into redsun82/codegen-rust-ancestor-order 2025-03-20 13:13:10 +01:00
Paolo Tranquilli
b77c13802b Rust: fix canonical paths broken on StructExpr and StructPath
After the rename done in https://github.com/github/codeql/pull/19059,
canonical path extraction was lost on `StructExpr` and `StructPath` as
the identifiers used for the type in the `emit_detached!` macro were not
updated. This fixes that.
2025-03-20 12:16:47 +01:00
Paolo Tranquilli
4110636032 Rust: preserve ordering in rust generated code
This is a small devex improvement to the rust code generator.

Usage of `sorted` in `rustgen.py` was causing the generated code to be
completely reshuffled on renames, which made diffs hard to follow. As an
example see [this generated file diff](https://github.com/github/codeql/pull/19059/files#diff-c938ba77a3398dd4c633ada5702a03477705c24740a2f7d1e40d4b270d8c3f86).

This will make the order deterministically based on the order of
definitions in the schema file. This means that renames will find the
same place in the generated file, and the place in the generated file
will generally be more predictable with respect to the schema.

However, that does mean this change is heavily reshuffling the generated
code.
2025-03-20 12:12:52 +01:00
Tom Hvitved
cbb9987a20 Merge remote-tracking branch 'upstream/main' into rust/dependency-renaming 2025-03-20 11:45:03 +01:00
Tom Hvitved
d19188db8f Address review comment 2025-03-20 11:39:52 +01:00
Simon Friis Vindum
b2b650ddd3 Rust: Rename classes with Record to Struct 2025-03-19 12:05:39 +01:00
Tom Hvitved
0bf2bfa2f1 Rust: Take depdency renaming into account when extracting the crate graph 2025-03-19 08:39:22 +01:00
Tom Hvitved
0dd59cbb25 Rust: Make Crate a sub class of Locatable 2025-03-14 13:18:02 +01:00
Arthur Baars
fa79dbc89a Merge pull request #18228 from github/aibaars/crate-graph
Rust: extract crate graph
2025-03-13 10:00:48 +01:00
Paolo Tranquilli
79e06153ed Merge pull request #18813 from github/redsun82/rust-turn-off-ra-resolution
Rust: add flag to turn off extractor path resolution
2025-03-10 14:52:07 +01:00
Arthur Baars
9814aef71f Address review comment 2025-03-10 10:31:31 +01:00
Arthur Baars
5855a12b03 Rust: fix crate graph after rust-analyzer upgrade 2025-03-10 10:16:28 +01:00
Arthur Baars
845f002124 Rust: add file for root modules of crates 2025-03-10 10:16:26 +01:00
Arthur Baars
8961a22a71 Rust: crate_graph: extract only public items 2025-03-10 10:16:24 +01:00
Arthur Baars
c601adfc65 Rust: add ExtractionStep::CrateGraph 2025-03-10 10:16:18 +01:00
Arthur Baars
e21a7f5336 Rust: extract crate graph 2025-03-10 10:16:13 +01:00
Arthur Baars
75ca04f3dd Rust: add Crate to dbscheme 2025-03-10 10:16:12 +01:00
Paolo Tranquilli
a444bbc080 Merge branch 'main' into redsun82/rust-turn-off-ra-resolution 2025-02-27 11:11:06 +01:00
Paolo Tranquilli
bfcf9ea606 Rust: fix compilation errors after rust-anlyzer update 2025-02-25 13:37:00 +01:00
Paolo Tranquilli
cbae16b392 Rust: rerun code generation 2025-02-25 13:31:16 +01:00
Paolo Tranquilli
83e442a266 Rust/Ruby: run cargo upgrade --incompatible --pinned 2025-02-25 13:31:16 +01:00
Paolo Tranquilli
6089a75262 Rust/Ruby/Python: format code 2025-02-25 13:19:03 +01:00
Paolo Tranquilli
e8799e346d Rust/Python: fix edition-related errors 2025-02-25 13:16:58 +01:00
Paolo Tranquilli
eff87d24fa Rust/Ruby/Python: update rustc and edition 2025-02-25 13:15:19 +01:00