Skip to content

Commit b8d9bd2

Browse files
committed
Merge upstream main into the BDE value wrapper models
2 parents d563e9c + 2445840 commit b8d9bd2

1,469 files changed

Lines changed: 36206 additions & 28337 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/skills/bazel/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: bazel
3-
description: Conventions for editing Bazel files in the github/codeql repository: the shared `misc/bazel` helpers, `codeql_platform_select` and the `{CODEQL_PLATFORM}` packaging placeholder, adding `MODULE.bazel` dependencies, and the `semmle_code` stub that keeps the standalone build working. Use when editing any `BUILD.bazel`, `*.bzl`, `MODULE.bazel` or `.bazelrc` here, and before validating such an edit.
3+
description: 'Conventions for editing Bazel files in the github/codeql repository: the shared `misc/bazel` helpers, `codeql_platform_select` and the `{CODEQL_PLATFORM}` packaging placeholder, adding `MODULE.bazel` dependencies, and the `semmle_code` stub that keeps the standalone build working. Use when editing any `BUILD.bazel`, `*.bzl`, `MODULE.bazel` or `.bazelrc` here, and before validating such an edit.'
44
---
55

66
# Bazel in the codeql repository

‎.github/workflows/cpp-bmn.yml‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@ permissions:
2424
contents: read
2525

2626
jobs:
27-
cargo:
28-
runs-on: ubuntu-latest
29-
defaults:
30-
run:
31-
working-directory: cpp/extractor/bmn
32-
steps:
33-
- uses: actions/checkout@v5
34-
- name: Check formatting
35-
run: cargo fmt --check
36-
- name: Check
37-
run: cargo check
38-
- name: Clippy
39-
run: cargo clippy --all-targets --no-deps -- -D warnings
40-
- name: Test
41-
run: cargo test
42-
4327
bazel:
4428
runs-on: ubuntu-latest
4529
steps:

‎.github/workflows/ql-for-ql-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
path: |
3838
ql/extractor-pack/
3939
target/release/buramu
40-
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}-${{ hashFiles('shared/tree-sitter-extractor') }}-${{ hashFiles('ql/**/*.rs') }}
40+
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}-${{ hashFiles('shared/tree-sitter-extractor') }}-${{ hashFiles('shared/extractor-common/**/*.rs') }}-${{ hashFiles('ql/**/*.rs') }}
4141
- name: Cache cargo
4242
if: steps.cache-extractor.outputs.cache-hit != 'true'
4343
uses: actions/cache@v3

‎.github/workflows/ql-for-ql-tests.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
~/.cargo/git
4040
target
4141
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}
42-
- name: Check formatting
43-
run: cd ql; cargo fmt -p codeql-extractor-ql -p buramu -p tree-sitter-blame -- --check
4442
- name: Build extractor
4543
run: |
4644
cd ql;

‎.github/workflows/rust-checks.yml‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Rust checks
2+
3+
# Run on every PR; package selection below skips checks for unrelated changes.
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
- rc/*
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
# Cancel superseded PR checks; each push gets its own group so GitHub cannot
16+
# replace an already-pending push run with a newer one.
17+
group: rust-checks-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
18+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19+
20+
jobs:
21+
rust-checks:
22+
runs-on: ubuntu-latest
23+
env:
24+
CARGO_TERM_COLOR: always
25+
steps:
26+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
27+
with:
28+
# PRs compare the merge commit with its first parent; pushes need full
29+
# history to compare the event's before SHA across multi-commit pushes.
30+
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
31+
- name: Select affected packages
32+
id: select
33+
env:
34+
# Use the PR merge base's actual first parent, or the push's before SHA.
35+
BASE: ${{ github.event_name == 'pull_request' && 'HEAD^1' || github.event.before }}
36+
run: |
37+
packages=$(python3 misc/scripts/rust-checks/rust_checks.py select --base "$BASE")
38+
echo "packages=$packages" >> "$GITHUB_OUTPUT"
39+
echo "Selected packages: $packages" | tee -a "$GITHUB_STEP_SUMMARY"
40+
- name: Restore Cargo cache
41+
id: cache
42+
if: steps.select.outputs.packages != '[]'
43+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
44+
with:
45+
path: |
46+
~/.cargo/registry
47+
~/.cargo/git
48+
target
49+
key: rust-checks-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}-${{ github.sha }}
50+
restore-keys: |
51+
rust-checks-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}-
52+
- name: Show stable toolchain and cache
53+
if: steps.select.outputs.packages != '[]'
54+
env:
55+
CACHE_HIT: ${{ steps.cache.outputs.cache-hit }}
56+
run: |
57+
rustup show active-toolchain
58+
cargo clippy --version
59+
echo "Exact cache hit: ${CACHE_HIT:-false}" | tee -a "$GITHUB_STEP_SUMMARY"
60+
- name: Inject ast-generator sources
61+
if: contains(fromJSON(steps.select.outputs.packages), 'ast-generator')
62+
run: bazel run //rust/ast-generator:inject-sources
63+
- name: Check formatting
64+
if: steps.select.outputs.packages != '[]'
65+
env:
66+
PACKAGES: ${{ steps.select.outputs.packages }}
67+
run: python3 misc/scripts/rust-checks/rust_checks.py format "$PACKAGES"
68+
- name: Run Clippy
69+
if: steps.select.outputs.packages != '[]'
70+
env:
71+
PACKAGES: ${{ steps.select.outputs.packages }}
72+
# For the unified extractor: skip linking the native Swift shim and
73+
# only check Rust code.
74+
SWIFT_SYNTAX_RS_CHECK_ONLY: "1"
75+
run: python3 misc/scripts/rust-checks/rust_checks.py lint "$PACKAGES"
76+
- name: Run tests
77+
if: steps.select.outputs.packages != '[]'
78+
env:
79+
PACKAGES: ${{ steps.select.outputs.packages }}
80+
# Skips the unified extractor crates, whose tests need a Swift toolchain,
81+
# and ast-generator, which has no tests of its own.
82+
run: python3 misc/scripts/rust-checks/rust_checks.py test "$PACKAGES"

‎.github/workflows/rust.yml‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,6 @@ permissions:
2929
contents: read
3030

3131
jobs:
32-
rust-ast-generator:
33-
runs-on: ubuntu-latest
34-
defaults:
35-
run:
36-
working-directory: rust/ast-generator
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v5
40-
- name: Inject sources
41-
shell: bash
42-
run: |
43-
bazel run //rust/ast-generator:inject-sources
44-
- name: Format
45-
shell: bash
46-
run: |
47-
cargo fmt --check
48-
- name: Compilation
49-
shell: bash
50-
run: cargo check
51-
- name: Clippy
52-
shell: bash
53-
run: |
54-
cargo clippy --no-deps -- -D warnings
55-
rust-code:
56-
runs-on: ubuntu-latest
57-
defaults:
58-
run:
59-
working-directory: rust/extractor
60-
steps:
61-
- name: Checkout
62-
uses: actions/checkout@v5
63-
- name: Format
64-
shell: bash
65-
run: |
66-
cargo fmt --check
67-
- name: Compilation
68-
shell: bash
69-
run: cargo check
70-
- name: Clippy
71-
shell: bash
72-
run: |
73-
cargo clippy --no-deps -- -D warnings
7432
rust-codegen:
7533
runs-on: ubuntu-latest
7634
steps:

‎.github/workflows/tree-sitter-extractor-test.yml‎

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)