Commit Graph

249 Commits

Author SHA1 Message Date
Paolo Tranquilli
cd95cc8f94 Rust: update rust-analyzer to 0.0.257 2025-01-09 15:34:07 +01:00
Paolo Tranquilli
53b0a3464d Merge branch 'main' into redsun82/rust-ast-generator-mustache 2025-01-08 17:09:39 +01:00
Paolo Tranquilli
c7a9889606 Rust: update rust-analyzer 2025-01-08 11:14:08 +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
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
73a5a3f7ee Rust: support paths and paths-ignore from the code scanning configuration file
This is done by simply adding the autobuilder from the shared
tree-sitter extractor library.
2024-12-19 17:37:56 +01:00
Paolo Tranquilli
c4a7abda0a Bazel: resync 3rd party dependencies and skip buildifier on them 2024-12-18 17:33:39 +01:00
Paolo Tranquilli
d6b8d42936 Bazel: fix 3rdparty update script 2024-12-18 17:20:05 +01:00
Paolo Tranquilli
290a1043b1 Rust: fetch ungram and rust-analyzer code instead of checking it in
* The ungram file is now taken from the rust-analyzer dependencies
  pulled in by bazel
* the grammar parsing code is not published, so it must be taken
  directly from rust-analyzer code. That part should be less prone to be
  updated than the ungram file, so it does not necessarily need to be
  in sync with the rust-analyzer version is used elsewhere.
* both need some patches. The former is patched during build, the latter
  during loading in `MODULE.bazel`.
2024-12-18 16:37:24 +01:00
Arthur Baars
93972fcb2e Run: misc/bazel/3rdparty/update_cargo_deps.sh 2024-12-17 14:05:51 +01:00
Paolo Tranquilli
54ba14d181 Merge pull request #18276 from github/redsun82/bazel-installer-as-test
Bazel: add a test wrapper around installation scripts
2024-12-16 15:07:19 +01:00
Paolo Tranquilli
a75f5fac15 Swift: remove linux from standard pack
This still defines a pack with linux included for development.
`//swift:install` will still also include linux.
2024-12-13 17:01:22 +01:00
Paolo Tranquilli
173d11d544 Bazel: add a test wrapper around installation scripts
This hack is meant to be an optimization when using install for tests,
where the install step is skipped if nothing changed. If the
installation directory is somehow messed up, `bazel run` can be used to
force install.

This is added as a `<name>-installer-as-test` target, which we can now
use in our internal pytest integration to skip the installation step if
nothing changed on the CLI + language packs side.
2024-12-12 13:08:58 +01:00
Paolo Tranquilli
5ca89eaede Merge branch 'main' into redsun82/swift-6 2024-12-12 12:28:47 +01:00
Cornelius Riemenschneider
53ca5083a9 Upgrade bazel to 8.0.0.
Previously, we were using 8.0.0rc1.
In particular, this upgrade means we need to explicitly
import more rules, as they've been moved out of the core bazel repo.
2024-12-10 12:05:37 +01:00
Paolo Tranquilli
4ac602ccd7 Merge branch 'main' into redsun82/swift-6 2024-12-06 12:31:40 +01:00
Michael Nebel
4a0875f78d Merge pull request #18091 from michaelnebel/csharp/net9-3
C#: Bazel build should target .NET9 framework.
2024-12-04 14:41:38 +01:00
Michael Nebel
1aa6056bd8 C#: Bazel build should target .NET9 framework. 2024-12-04 09:56:09 +01:00
Paolo Tranquilli
c0e55a06e7 Merge branch 'main' into redsun82/rust-perf-measures 2024-12-02 15:20:42 +01:00
Paolo Tranquilli
488903280f Rust: tentative windows fix 2024-11-29 17:23:30 +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
Paolo Tranquilli
918b0bfc53 Bazel: add experimental to codeql_pack 2024-11-19 12:48:36 +01:00
Paolo Tranquilli
e8677b46d5 Bazel: rename shortcut to install 2024-11-19 10:34:40 +01:00
Paolo Tranquilli
6e33f979c7 Bazel: add an installer shortcut to codeql_pack
This makes the first `codeql_pack` in a package add an `installer` target
aliasing the `<name>-installer` one. This makes it so that one can for
example do `bazel run //rust:installer` instead of the stuttering
`bazel run //rust:rust-installer`. If a bazel package defines multiple
`codeql_pack` targets, the first one only will get the `installer` alias.
2024-11-19 10:25:31 +01:00
Paolo Tranquilli
e077bf0732 Rust: update vendored dependencies 2024-11-18 16:06:27 +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
91f683d94c Merge branch 'main' into redsun82/swift-6 2024-10-30 12:27:24 +01:00
Paolo Tranquilli
d3fb2543d2 Swift: try out new builds 2024-10-30 12:26:34 +01:00
Cornelius Riemenschneider
f900060e7f Bazel: Upgrade to bazel 8. 2024-10-24 13:30:57 +02:00
Paolo Tranquilli
8f451515e0 Bazel: print workaround for git_lfs_probe.py failing 2024-10-16 10:16:38 +02:00
Paolo Tranquilli
fd31e6d813 Bazel: skip git lfs endpoints presenting malformed data 2024-10-16 10:01:19 +02:00
Cornelius Riemenschneider
396bf93ac0 Merge pull request #17716 from github/criemen/rules-kotlin-2.0.0
Upgrade rules_kotlin to 2.0.0.
2024-10-10 15:07:50 +02:00
Cornelius Riemenschneider
4de0fefe86 Upgrade rules_kotlin to 2.0.0.
This is required for the bazel 8 upgrade, as one of the
incompatible-flag flips breaks 1.9.4.
2024-10-09 16:04:16 +02:00
Cornelius Riemenschneider
4c21444dd5 Bazel: Flip --incompatible_use_plus_in_repo_names.
We've hardcoded the tilde in a lot of places :(
This improves performance on Windows and gets us ready for Bazel 8.

We need an upgrade of rules_rust for this to work.
2024-10-09 14:04:05 +02:00
Paolo Tranquilli
7c80b33a63 Bazel: add forgotten files 2024-09-05 08:26:41 +02:00
Paolo Tranquilli
913a9263d2 Bazel: stub internal repo parts needed for building rust binaries
This is another shot at https://github.com/github/codeql/pull/17382,
using a different and more lightweight approach.

This allows building the ruby and python (and in the future also rust)
packs from within the codeql repository. This will:
* skip defining the glibc symbols checking, which only makes sense when
  building the release from the internal repository
* stub out our `universal_binary` rule, which we only need when building
  the release.
2024-09-05 08:16:28 +02:00
Paolo Tranquilli
0738e01e7e Bazel: fix logging bug in git_lfs_probe.py
The case of an `HTTPError` was printed to stdout (and therefore globbed
by bazel).

While I'm at it, I also introduced a timeout to `urlopen` and improved
the `no endpoints found` error message.
2024-08-27 09:12:37 +02:00
Cornelius Riemenschneider
3ac8108c4a Address review. 2024-08-23 17:26:05 +02:00
Cornelius Riemenschneider
f9bc97b2a1 crate_universe: Enable modext isolation.
This should allow us to build our python and ruby
code independently - in particular, we can now do shallow
checkouts of one without the other.
Previously, the modext introduced cross-dependency.
This also reduces the amount of work we do in the
crate universe processing for the other language, even
though it's unused.

This does need renaming the module, as otherwise
the generated paths from rules_rust get too long
for Windows :(
2024-08-18 21:00:30 +02:00
Paolo Tranquilli
e451f2b343 Bazel: fix typo 2024-08-07 20:54:40 +02:00
Paolo Tranquilli
58088b62df Bazel: make git_lfs_probe.py a bit more backward compatible 2024-08-07 16:46:31 +02:00
Paolo Tranquilli
c576a116f5 Bazel: make git_lfs_probe.py try all available endpoints 2024-08-07 12:38:43 +02:00
Paolo Tranquilli
b63bd2ad14 Bazel: format git_lfs_probe.py 2024-08-07 11:57:35 +02:00
Cornelius Riemenschneider
de47838c36 Remove unused exception class. 2024-07-31 11:31:11 +02:00
Cornelius Riemenschneider
1ce15ae2fd Fix exit code when ripunzip isn't called. 2024-07-31 08:09:53 +02:00
Cornelius Riemenschneider
fa6d61809e Fix hang for targets without ripunzip. 2024-07-31 00:38:50 +02:00
Cornelius Riemenschneider
674a5bb9b4 Bazel installer: Retry ripunzip step.
Ripunzip is great, but occasionally bugs out due to a parallelism issue.
As we don't want this to fail CI, retry the entire ripunzip/installation step
up to 3 times.
We need to clean up the working directory as ripunzip doesn't support overwriting
files. I've not been able to test this with the original issue (it doesn't seem
to reproduce locally for me), but I injected another error and got 3 retries
of installation.
2024-07-30 18:20:19 +02:00
Cornelius Riemenschneider
afb6e412f0 pkg.bzl: Disable remote caching of zipmerge steps. 2024-07-18 08:52:04 +02:00
Cornelius Riemenschneider
16660ab1df address review 2024-07-08 17:37:33 +02:00
Cornelius Riemenschneider
8df2e4952c address review 2024-07-08 17:27:17 +02:00