380 Commits

Author SHA1 Message Date
Paolo Tranquilli
b390fac105 Rust: make ast-generator use mustache templates
This simplifies the code and decouples the code template from the data
that is fed into it.
2025-01-07 18:05:59 +01:00
Paolo Tranquilli
b4811906ea Rust: address review 2025-01-07 13:05:19 +01:00
Paolo Tranquilli
10d8aa454b Merge branch 'main' into redsun82/rust-mute-warnings-in-uncompiled-blocks 2025-01-06 10:01:57 +01:00
Paolo Tranquilli
485586f780 Rust: reinstate extraction of test code
Users will still be able to opt out:
* for unit tests, by providing the `cargo_cfg_overrides=-test` extractor
  option
* for integration tests, by excluding the test files from the analysis
  using `paths-ignore` in the codescanning configuration file

We may want to revisit whether we want a single option for both. Also
further work will be needed to restrict our security queries to non-test
code on the QL side.
2024-12-20 14:12:41 +01:00
Paolo Tranquilli
218bc8069b Rust: exclude extraction of code excluded by cfg 2024-12-18 13:34:40 +01:00
Arthur Baars
71959f5faa Rust: address clippy warnings 2024-12-18 13:00:13 +01:00
Arthur Baars
029e2604a3 Rust: //rust/codegen 2024-12-17 14:07:44 +01:00
Arthur Baars
3928efe05f Rust: update rust.ungram 2024-12-17 14:05:12 +01:00
Paolo Tranquilli
4c4a8d7619 Rust: extract isRef for SelfParam 2024-12-16 14:24:56 +01:00
Paolo Tranquilli
08de0b40ed Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-04 14:35:10 +01:00
Paolo Tranquilli
31b9b3adaa Merge branch 'main' into redsun82/rust-perf-measures 2024-12-04 10:50:37 +01:00
Paolo Tranquilli
59ea563d2a Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-04 10:44:11 +01:00
Paolo Tranquilli
e30a429c3d Rust: revert TupleStructPat.toString improvements 2024-12-04 10:34:28 +01:00
Paolo Tranquilli
53503002a1 Merge branch 'main' into redsun82/rust-tweaks 2024-12-04 09:35:01 +01:00
Paolo Tranquilli
353f1cafe6 Rust: distinguish [a, b] from [a; b]
This splits the `ArrayExpr` class into `ArrayListExpr` and `ArrayRepeatExpr`.
This uses the `synth.from_class` machinery to integrate seamlessly into the
generated code, by hiding the extracted `ArrayExpr` behind an internal class
and replacing it with a hierarchy of those two classes under a new
`ArrayExpr` class.
2024-12-03 15:09:20 +01:00
Paolo Tranquilli
ebe38bca23 Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-03 12:19:08 +01:00
Paolo Tranquilli
db18d1046b Rust: rename getTy -> getTypeRepr 2024-12-03 11:17:08 +01:00
Paolo Tranquilli
e89cf303e7 Rust: rename TypeRef -> TypeRepr 2024-12-02 17:58:40 +01:00
Paolo Tranquilli
c0e55a06e7 Merge branch 'main' into redsun82/rust-perf-measures 2024-12-02 15:20:42 +01:00
Paolo Tranquilli
b57a37479b Rust: make File usable in codegen 2024-12-02 15:15:46 +01:00
Paolo Tranquilli
e7ffddd52c Rust: rename all *Type to *TypeRef 2024-12-02 10:13:05 +01:00
Paolo Tranquilli
31775e21b7 Merge branch 'main' into redsun82/rust-less-canonical-paths 2024-12-02 08:27:05 +01:00
Paolo Tranquilli
9486e8b734 Rust: elaborate on path_to_file_id comment
This is a follow up to https://github.com/github/codeql/pull/18167, addressing a
review comment from @paldepind.
2024-12-02 08:16:52 +01:00
Paolo Tranquilli
488903280f Rust: tentative windows fix 2024-11-29 17:23:30 +01:00
Paolo Tranquilli
c46f44da5f Rust: fix QL compilation errors 2024-11-29 15:55:51 +01:00
Paolo Tranquilli
9cf2420c3b Rust: restrict canonical path calculations 2024-11-29 14:43:51 +01:00
Paolo Tranquilli
4bcc4254c6 Merge branch 'main' into redsun82/rust-perf-measures 2024-11-29 11:59:22 +01:00
Paolo Tranquilli
a8188598b0 Merge branch 'main' into redsun82/rust-canonical-enum 2024-11-27 15:01:47 +01:00
Paolo Tranquilli
4e7115538b Rust: move steps breakdown from JSON diagnostics to the DB 2024-11-27 14:55:46 +01:00
Paolo Tranquilli
27738eaacc Rust: reorganize perf diagnostics 2024-11-27 12:05:06 +01:00
Paolo Tranquilli
24eb65692f Rust: add some performance diagnostics
This outputs some duration counts for various parts of the extraction
process in the database in the form of telemetry diagnostics.

The diagnostics format was preferred to putting things in the relational
database as that will scale better to code scanning and is more flexible
as for the data we can put into it without passing through the dbscheme.
Also, although it's not the case yet, it will be possible to output
diagnostics even if creation of the database fails.
2024-11-26 16:35:38 +01:00
Simon Friis Vindum
d30f3e2822 Rust: Renamed expr on CallExpr and LetExpr 2024-11-26 15:22:14 +01:00
Paolo Tranquilli
8a01161d4a Rust: rename MatchExpr.expr to scrutinee in all layers
This doesn't require `ql.name` and is simpler while we don't have
to write upgrade scripts. The `ql.name` mechanism might get useful
once we do have to write upgrade scripts, as that doesn't change the
dbscheme.
2024-11-26 10:42:13 +01:00
Paolo Tranquilli
adafe3e5b0 Merge branch 'main' into redsun82/rust-canonical-enum 2024-11-25 15:28:45 +01:00
Simon Friis Vindum
0d02126f12 Generate ParamBase, superclass of Param and SelfParam 2024-11-25 14:07:50 +01:00
Paolo Tranquilli
f3cd61f043 Rust: add extended canonical paths on enum variants 2024-11-22 17:00:57 +01:00
Paolo Tranquilli
b4af5a61d1 Rust: more advanced toString 2024-11-20 16:21:23 +01:00
Paolo Tranquilli
99494dd540 Merge pull request #18012 from github/revert-18011-revert-17937-redsun82/rust-cargo-options
Revert "Revert "Rust: allow to specify more cargo configuration options""
2024-11-19 09:03:52 +01:00
Paolo Tranquilli
8377ee545f Rust: fix reading lists from options.yml 2024-11-18 17:22:23 +01:00
Paolo Tranquilli
0943389ca1 Rust: add rust-specific deps updater script 2024-11-18 16:16:54 +01:00
Paolo Tranquilli
abd73e16d4 Revert "Revert "Rust: allow to specify more cargo configuration options"" 2024-11-18 15:52:03 +01:00
Paolo Tranquilli
04072591c4 Revert "Rust: allow to specify more cargo configuration options" 2024-11-18 15:36:06 +01:00
Paolo Tranquilli
fa52d03194 Merge pull request #17937 from github/redsun82/rust-cargo-options
Rust: allow to specify more cargo configuration options
2024-11-18 13:24:39 +01:00
Paolo Tranquilli
8137419d93 Rust: only accept options.yml in QL tests 2024-11-18 10:40:29 +01:00
Paolo Tranquilli
75375be7ac Rust: add optional dependencies to ql tests
Also accept `options.yml` and `options.yaml` files as well for test options,
to get YAML syntax highlighting. In a follow up PR we might make the extension
mandatory.
2024-11-18 09:42:01 +01:00
Cornelius Riemenschneider
a66f8209f9 Rust: Vendor 3rdparty dependencies.
We've been observing some performance issues using crate_universe on CI.
Therefore, we're moving to vendor the auto-generated BUILD files
in our repository. This should provide a nice speed boost, while
getting rid of the complexity of the "rust cache" job we've been using
when we had a lot of git dependencies.

This PR includes a vendor script, and I'll put up a CI job internally
that runs that vendor script on Cargo.toml and Cargo.lock changes, to check
that the vendored files are in sync.
2024-11-13 13:22:14 +01:00
Paolo Tranquilli
94ba6473dd Merge branch 'main' into redsun82/rust-cargo-options 2024-11-08 17:54:59 +01:00
Paolo Tranquilli
f77f2b7ff0 Rust: turn off the test cfg by default 2024-11-08 17:07:03 +01:00
Paolo Tranquilli
9cea631399 Merge pull request #17931 from github/redsun82/rust-target-dir
Rust: allow to specify the target directory
2024-11-08 13:34:03 +01:00
Paolo Tranquilli
26839f5e15 Merge pull request #17882 from github/redsun82/rust-resolve
Rust: extract some resolved paths
2024-11-08 13:33:41 +01:00