80 Commits

Author SHA1 Message Date
Simon Friis Vindum
4846cf4791 Cargo: upgrade dependencies 2025-09-30 10:21:17 +02:00
Simon Friis Vindum
55d022f6eb Cargo: upgrade dependencies 2025-09-11 10:47:26 +02:00
Paolo Tranquilli
6ad8af0ea9 Cargo: upgrade dependencies 2025-08-12 16:46:29 +02:00
Paolo Tranquilli
911d6f07b6 Shared tree-sitter extractor: run clippy 2025-08-11 17:04:22 +02:00
Paolo Tranquilli
45c0c46c9d Cargo: align rust toolchain version with internal repository
Also:
* remove new warnings raised by the rust toolchain
* run new formatting and linting
* update the rust toolchain used by `cargo`

While we keep `bazel` builds using the same toolchain as internally
(now a nightly one), I opted for using a stable toolchain for `cargo`.
The nightly toolchain is only required internally for build reasons, we
should keep not using any unstable rust features in our sources.
2025-08-11 16:45:47 +02:00
Nick Rolfe
b51940d1e2 Ruby: add overlay[local] annotations to AST/CFG/SSA layers 2025-07-08 13:09:27 +01:00
Nick Rolfe
7c5b186c71 Ruby/QL: add discard predicates for locations 2025-07-04 16:15:38 +01:00
Nick Rolfe
d8574a6919 Ruby: use overlayChangedFiles extensional in discard predicates 2025-07-03 12:44:15 +01:00
Nick Rolfe
72b4e67477 Java/Ruby/Rust/QL: add overlayChangedFiles relation to dbscheme 2025-07-03 12:44:09 +01:00
Nick Rolfe
867826466e Ruby/QL: unconditionally generate discard predicates 2025-06-25 15:35:58 +01:00
Nick Rolfe
57b866bbe1 Ruby/Rust/QL: move databaseMetadata to prefix.dbscheme
This has no effect on ruby.dbscheme, and adds the relation to
ql.dbscheme and rust.dbscheme. (The relation will be required for
overlay support).
2025-06-25 15:35:08 +01:00
Nick Rolfe
a9ddf0026b Ruby: generate overlay discard predicates 2025-06-25 11:47:27 +01:00
Nick Rolfe
c6ff07ad5a Merge branch 'main' into nickrolfe/ruby-overlay-extraction 2025-06-25 05:46:26 -04:00
Paolo Tranquilli
ce29d8a59a Cargo: run upgrade 2025-06-20 17:34:23 +02:00
Nick Rolfe
665df4baef Ruby: add minimal path transformer support
Supports only a minimal subset of the project layout specification;
enough to work with the transformers produced by the CLI when building
an overlay database.
2025-06-19 16:34:16 +01:00
Nick Rolfe
1bd7c4f11c Ruby: add databaseMetadata relation to dbscheme
This is required for overlay support.
2025-06-19 16:34:15 +01:00
Paolo Tranquilli
923a2854cb Ruby, Rust: add zstd compression option 2025-05-28 16:41:55 +02:00
Paolo Tranquilli
4a9e31ebd8 Shared: add zstd crate to tree-sitter-extractor dependencies 2025-05-28 16:41:55 +02:00
Paolo Tranquilli
13370200cc Cargo: upgrade dependencies 2025-03-20 16:48:29 +01:00
Paolo Tranquilli
d9ecb6255e Shared: fix clippy warning 2025-02-25 13:41:34 +01:00
Paolo Tranquilli
83e442a266 Rust/Ruby: run cargo upgrade --incompatible --pinned 2025-02-25 13:31:16 +01:00
Paolo Tranquilli
d2105a7528 Shared: format code again 2025-02-25 13:31:06 +01:00
Paolo Tranquilli
1bcc6ddb32 Rust/Ruby/Python: apply clippy lints 2025-02-25 13:21:28 +01:00
Paolo Tranquilli
6089a75262 Rust/Ruby/Python: format code 2025-02-25 13:19:03 +01:00
Paolo Tranquilli
eff87d24fa Rust/Ruby/Python: update rustc and edition 2025-02-25 13:15:19 +01:00
Paolo Tranquilli
e1f92b466f Merge pull request #18608 from github/aibaars/tracing
Rust: use tracing/tracing-subscriber for logging
2025-02-14 10:36:54 +01:00
Tom Hvitved
02fd23e53a Rust extractors: Normalize drive letter paths with a trailing / 2025-02-13 14:02:39 +01:00
Arthur Baars
5621eecc86 Rust: config: replace verbose with verbosity 2025-02-12 10:27:33 +01:00
Arthur Baars
c602e82ac4 Rust: use tracing-subscriber 2025-02-12 10:27:29 +01:00
Arthur Baars
a8fbb37569 TreeSitter extractors: log fewer lines
Printing a line for every extracted file is too verbose and for large projects makes it impossible to view the log in the Actions UI.
2025-02-07 12:28:17 +01:00
Paolo Tranquilli
d2c7decd02 Rust/Ruby: upgrade all cargo dependencies excluding rust-analyzer
The rust-analyzer update will need more work as it seems to break rust
analysis on windows.

This was carried out using `cargo upgrade` from `cargo-edit`:
* getting exclusions options for rust-analyzer with
   ```bash
   cargo upgrade -i --dry-run | grep -o 'ra_ap_\S\+' | sort -u | sed 's/^/--exclude=/' > /tmp/exclude
   ```
* running
   ```bash
   cargo upgrade -i $(cat /tmp/exclude)
   misc/bazel/3rdparty/update_cargo_deps.sh
   ```
2025-01-08 09:57:11 +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
Cornelius Riemenschneider
e8aa5db07a Rust: Update cargo dependencies.
There was a recent round of tree-sitter-* package releases,
so the latest code is now a) released and b) available on crates.io.

Therefore, move away from the (super slow on CI) git dependencies to released crates instead.
This also includes a run of `cargo update`, so there's a bunch of more changes to the lockfile.
2024-11-11 12:13:14 +01:00
Paolo Tranquilli
cb53911224 Merge branch 'main' into redsun82/rust-cli-flags 2024-09-16 09:36:06 +02:00
Paolo Tranquilli
b4b680775c Rust: integrate into standard files+location library 2024-09-12 13:17:10 +02:00
Paolo Tranquilli
0a8c0f5ab4 Rust: fix bazel build 2024-09-12 08:46:50 +02:00
Paolo Tranquilli
f8c9d96882 Bazel: remove non-working fake tree-sitter-extractor workaround
The `.cargo/config.toml` override based workaround wasn't really
working, as while `cargo build|check` was reading that, `cargo metadata`
wasn't, ending up in a completely broken IDE experience.

For the moment, we just use a unified workspace `Cargo.toml` for all
extractors using the shared tree-sitter code, which has the downside of
making bazel pull in dependencies for all of them, and not being able to
do sparse checkouts for them. We should investigate and rivist this in
the future.
2024-09-11 08:17:11 +02:00
Paolo Tranquilli
6f36ea9188 Merge branch 'main' into rust-experiment
Conflicts:
  shared/tree-sitter-extractor/src/trap.rs
2024-09-09 14:15:34 +02:00
Paolo Tranquilli
2c472dd5b8 Tree-sitter: fix formatting 2024-09-09 11:59:17 +02:00
Paolo Tranquilli
4454566d8d Tree-sitter: allow multiple sources per trap file
This generalizes the location cache to allow multiple sources to be
extracted in the same trap file, by adding `file_label` to `Location`,
and therefore to location cache keys. This will be used by the Rust
extractor.
2024-09-09 09:17:45 +02:00
Paolo Tranquilli
b23e482ed2 Merge branch 'main' into rust-experiment 2024-09-05 12:29:29 +02:00
Tom Hvitved
eb1b2a5594 Bump tree-sitter to 0.23.0 2024-09-04 09:47:59 +02:00
Paolo Tranquilli
7e1290aa74 Rust: reuse shared rust trap library 2024-08-30 16:08:37 +02:00
Tom Hvitved
beeae69845 Tree-sitter: Verbosity fixes 2024-05-31 20:10:19 +02:00
Tom Hvitved
d6a3765597 Tree-sitter: Allow for multiple file lists in simple extractor 2024-05-31 11:15:21 +02:00
Tom Hvitved
94d2e9591d Tree-sitter: Emit empty_location relation to avoid scan 2024-05-27 10:39:21 +02:00
Cornelius Riemenschneider
8c46b61e85 Ruby: Change how we pull in shared/tree-sitter-extractor dependency
Previously, we pulled in the shared tree-sitter extractor via a `git`
dependency in `Cargo.toml` to address a `rules_rust` limitation (no `path`
dependencies outside of the cargo workspace)). This was a problem,
as that means we're cloning `github/codeql` _again_ for the build, which is
quite slow.

I found another way that is faster, and still produces correct builds
for both `cargo`` and `rules_rust`:
* Cargo depends on a fake crate that has the same dependencies as the real crate (thanks to `sync-files.py`). Therefore, cargo pulls in the right dependencies into the lockfile, which bazel targets
* For local builds, we override the path to that dependency in a cargo config, so we're pulling in the correct code
* rules_rust only uses `path` dependencies for collecting transitive dependencies, it never pulls in the code from there. So far that, we manually provide a `BUILD.bazel` file for the shared extractor, and depend on that.
2024-05-24 15:37:35 +02:00
Tom Hvitved
e4cd9d86f6 Tree-sitter: Respect verbosity defined in CODEQL_VERBOSITY 2024-05-23 13:38:35 +02:00
Tom Hvitved
a523be4d0a Tree-sitter: Add set_tracing_level to shared extractor module 2024-05-23 12:58:53 +02:00
Tom Hvitved
bf2ae9890f Tree-sitter: Bump to 0.22.6 2024-05-21 11:14:06 +02:00