Skip to content

Commit b45df32

Browse files
authored
Merge branch 'master' into master
2 parents 4220ae0 + bfaadb3 commit b45df32

File tree

1,855 files changed

+56101
-10331
lines changed

Some content is hidden

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

1,855 files changed

+56101
-10331
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
name: 'Check Base OS Consistency'
18+
19+
on:
20+
pull_request:
21+
paths:
22+
- 'projects/**'
23+
24+
jobs:
25+
check-consistency:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0 # Fetch all history to compare with main
32+
33+
- name: Get changed project directories
34+
id: changed-projects
35+
run: |
36+
# Get the list of changed files compared to the target branch
37+
# and filter for unique directories under 'projects/'.
38+
CHANGED_DIRS=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | \
39+
grep '^projects/' | \
40+
xargs -n 1 dirname | \
41+
sort -u)
42+
echo "changed_dirs=${CHANGED_DIRS}" >> $GITHUB_OUTPUT
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.x'
48+
49+
- name: Install dependencies
50+
run: pip install PyYAML
51+
52+
- name: Check each modified project
53+
if: steps.changed-projects.outputs.changed_dirs != ''
54+
run: |
55+
EXIT_CODE=0
56+
for project_dir in ${{ steps.changed-projects.outputs.changed_dirs }};
57+
do
58+
echo "--- Checking ${project_dir} ---"
59+
python3 infra/ci/check_base_os.py "${project_dir}" || EXIT_CODE=$?
60+
done
61+
exit $EXIT_CODE

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
# Initializes the CodeQL tools for scanning.
2929
- name: Initialize CodeQL
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: indexer tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- 'infra/base-images/base-builder/indexer/**'
10+
- '.github/workflows/index_build_tests.yml'
11+
12+
jobs:
13+
'indexer':
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: write
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
steps:
21+
- uses: actions/checkout@v4
22+
with: # Needed for git diff to work. (get_changed_files)
23+
fetch-depth: 0
24+
- run: |
25+
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
26+
27+
- name: Setup python environment
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.11
31+
32+
- name: Get latest indexer binary
33+
run: curl -O https://clusterfuzz-builds.storage.googleapis.com/oss-fuzz-artifacts/indexer && chmod +x indexer
34+
working-directory: 'infra/base-images/base-builder/indexer'
35+
36+
- name: Run indexer tests
37+
run: sudo env "PATH=$PATH" INDEX_BUILD_TESTS=1 python -m unittest index_build_test
38+
working-directory: 'infra/base-images/base-builder/indexer'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: indexer build tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- 'infra/indexer/**'
10+
- '.github/workflows/indexer_build.yml'
11+
12+
jobs:
13+
indexer:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: write
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
steps:
21+
- uses: actions/checkout@v4
22+
with: # Needed for git diff to work. (get_changed_files)
23+
fetch-depth: 0
24+
- run: |
25+
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
26+
27+
- name: Build indexer
28+
run: docker build -t indexer .
29+
working-directory: 'infra/indexer'

.github/workflows/infra_tests.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ jobs:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with: # Needed for git diff to work. (get_changed_files)
2323
fetch-depth: 0
2424
- run: |
2525
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
2626
2727
- name: Setup python environment
28-
uses: actions/setup-python@v3
28+
uses: actions/setup-python@v5
2929
with:
30-
python-version: 3.8
30+
python-version: 3.11
31+
32+
# For gcloud emulators.
33+
- name: Setup Java environment
34+
uses: actions/setup-java@v4
35+
with:
36+
java-version: '21'
37+
distribution: 'temurin'
3138

3239
- name: Install dependencies
3340
run: |
@@ -36,9 +43,9 @@ jobs:
3643
sudo env "PATH=$PATH" pip install -r infra/build/functions/requirements.txt
3744
sudo env "PATH=$PATH" pip install -r infra/cifuzz/requirements.txt
3845
39-
- uses: google-github-actions/setup-gcloud@v0
46+
- uses: google-github-actions/setup-gcloud@v2
4047
with:
41-
version: '298.0.0'
48+
version: '523.0.0'
4249
- run: |
4350
sudo env "PATH=$PATH" gcloud components install beta cloud-datastore-emulator
4451

.github/workflows/pr_helper.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
pull-requests: write
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Setup python environment
21-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: 3.8
23+
python-version: 3.11
2424
cache: pip
2525
cache-dependency-path: |
2626
infra/ci/requirements.txt
@@ -31,7 +31,7 @@ jobs:
3131
pip install -r infra/ci/requirements.txt
3232
3333
- name: setup go environment
34-
uses: actions/setup-go@v4
34+
uses: actions/setup-go@v5
3535
with:
3636
go-version: 'stable'
3737
- run: go install github.com/ossf/criticality_score/cmd/criticality_score@latest
@@ -46,25 +46,25 @@ jobs:
4646

4747
- name: Leave comments
4848
if: env.IS_INTERNAL == 'FALSE'
49-
uses: actions/github-script@v6
49+
uses: actions/github-script@v7
5050
with:
5151
github-token: ${{secrets.GITHUB_TOKEN}}
5252
script: |
5353
github.rest.issues.createComment({
5454
issue_number: context.issue.number,
5555
owner: context.repo.owner,
5656
repo: context.repo.repo,
57-
body: '${{env.MESSAGE}}'
57+
body: process.env.MESSAGE
5858
})
5959
6060
- name: Add labels for valid PR
6161
if: env.IS_READY_FOR_MERGE == 'True'
62-
uses: actions/github-script@v6
62+
uses: actions/github-script@v7
6363
with:
6464
script: |
6565
github.rest.issues.addLabels({
6666
issue_number: context.issue.number,
6767
owner: context.repo.owner,
6868
repo: context.repo.repo,
6969
labels: ['Ready to merge']
70-
})
70+
})

.github/workflows/presubmit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ jobs:
1818
cancel-in-progress: true
1919
steps:
2020

21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with: # Needed for git diff to work. (get_changed_files)
2323
fetch-depth: 0
2424
- run: |
2525
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
2626
2727
- name: Setup python environment
28-
uses: actions/setup-python@v3
28+
uses: actions/setup-python@v5
2929
with:
30-
python-version: 3.8
30+
python-version: 3.11
3131
cache: pip
3232
cache-dependency-path: |
3333
infra/ci/requirements.txt

.github/workflows/project_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
ARCHITECTURE: ${{ matrix.architecture }}
5757

5858
steps:
59-
- uses: actions/checkout@v3
59+
- uses: actions/checkout@v4
6060
with: # Needed for git diff to work. (get_changed_files)
6161
fetch-depth: 0
6262
- run: |
@@ -68,15 +68,15 @@ jobs:
6868
sudo swapoff -a
6969
sudo rm -f /swapfile
7070
sudo apt clean
71-
docker rmi $(docker images -a -q)
71+
docker rmi $(docker images -a -q) || true
7272
df -h
7373
echo "Remove large unused folders, inspired by https://github.com/apache/flink/blame/master/tools/azure-pipelines/free_disk_space.sh"
7474
sudo bash -c '(ionice -c 3 nice -n 19 rm -rf /usr/share/dotnet/ /usr/local/graalvm/ /usr/local/.ghcup/ /usr/local/share/powershell /usr/local/share/chromium /usr/local/lib/android /usr/local/lib/node_modules)&'
7575
7676
- name: Setup python environment
77-
uses: actions/setup-python@v3
77+
uses: actions/setup-python@v5
7878
with:
79-
python-version: 3.8
79+
python-version: 3.11
8080
cache: pip
8181
cache-dependency-path: |
8282
infra/ci/requirements.txt
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
name: 'Ubuntu Version Sync'
18+
19+
on:
20+
pull_request:
21+
types: [opened, synchronize, reopened]
22+
23+
jobs:
24+
check-sync:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: 'Checkout code'
28+
uses: actions/checkout@v4
29+
with:
30+
# Fetch all history so we can diff against the base branch.
31+
fetch-depth: 0
32+
33+
- name: 'Run sync check'
34+
run: |
35+
set -e
36+
37+
MODIFIED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }})
38+
echo "Checking for synchronized file changes..."
39+
echo "Modified files in this PR:"
40+
echo "$MODIFIED_FILES"
41+
42+
ERRORS=""
43+
44+
# Define the mapping of legacy files to their versioned counterparts.
45+
# Format: "legacy_file;versioned_file_pattern"
46+
# The pattern uses {version} which will be replaced with "ubuntu-20-04" and "ubuntu-24-04".
47+
# For Dockerfiles, the pattern is different from scripts.
48+
declare -A LEGACY_DOCKERFILES
49+
LEGACY_DOCKERFILES["infra/base-images/base-builder-fuzzbench/Dockerfile"]="infra/base-images/base-builder-fuzzbench/{version}.Dockerfile"
50+
LEGACY_DOCKERFILES["infra/base-images/base-builder-swift/Dockerfile"]="infra/base-images/base-builder-swift/{version}.Dockerfile"
51+
LEGACY_DOCKERFILES["infra/base-images/base-builder/Dockerfile"]="infra/base-images/base-builder/{version}.Dockerfile"
52+
LEGACY_DOCKERFILES["infra/base-images/base-clang/Dockerfile"]="infra/base-images/base-clang/{version}.Dockerfile"
53+
LEGACY_DOCKERFILES["infra/base-images/base-runner/Dockerfile"]="infra/base-images/base-runner/{version}.Dockerfile"
54+
55+
declare -A LEGACY_SCRIPTS
56+
LEGACY_SCRIPTS["infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies"]="infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies_{version}"
57+
LEGACY_SCRIPTS["infra/base-images/base-builder/install_deps.sh"]="infra/base-images/base-builder/install_deps_{version}.sh"
58+
LEGACY_SCRIPTS["infra/base-images/base-builder/install_swift.sh"]="infra/base-images/base-builder/install_swift_{version}.sh"
59+
LEGACY_SCRIPTS["infra/base-images/base-builder/precompile_honggfuzz"]="infra/base-images/base-builder/precompile_honggfuzz_{version}"
60+
LEGACY_SCRIPTS["infra/base-images/base-clang/checkout_build_install_llvm.sh"]="infra/base-images/base-clang/checkout_build_install_llvm_{version}.sh"
61+
LEGACY_SCRIPTS["infra/base-images/base-runner/install_deps.sh"]="infra/base-images/base-runner/install_deps_{version}.sh"
62+
63+
VERSIONS=("ubuntu-20-04" "ubuntu-24-04")
64+
65+
# Check Dockerfiles
66+
for legacy_file in "${{!LEGACY_DOCKERFILES[@]}}"; do
67+
if echo "$MODIFIED_FILES" | grep -q "^${legacy_file}$"; then
68+
echo "Legacy file changed: $legacy_file. Verifying counterparts..."
69+
for version in "${{VERSIONS[@]}}"; do
70+
pattern=${{LEGACY_DOCKERFILES[$legacy_file]}}
71+
versioned_file="${{pattern/{{version}}/$version}}"
72+
if ! echo "$MODIFIED_FILES" | grep -q "^${{versioned_file}}$"; then
73+
ERRORS+="\n- Legacy file '${legacy_file}' was changed, but its counterpart '${versioned_file}' was not."
74+
fi
75+
done
76+
fi
77+
done
78+
79+
# Check Scripts
80+
for legacy_file in "${{!LEGACY_SCRIPTS[@]}}"; do
81+
if echo "$MODIFIED_FILES" | grep -q "^${legacy_file}$"; then
82+
echo "Legacy script changed: $legacy_file. Verifying counterparts..."
83+
for version in "${{VERSIONS[@]}}"; do
84+
pattern=${{LEGACY_SCRIPTS[$legacy_file]}}
85+
versioned_file="${{pattern/{{version}}/$version}}"
86+
if ! echo "$MODIFIED_FILES" | grep -q "^${{versioned_file}}$"; then
87+
ERRORS+="\n- Legacy script '${legacy_file}' was changed, but its counterpart '${versioned_file}' was not."
88+
fi
89+
done
90+
fi
91+
done
92+
93+
if [ -n "$ERRORS" ]; then
94+
echo -e "\n\e[31mError: Found synchronization issues between legacy and versioned files.\e[0m"
95+
echo -e "Please update the following files to match their legacy counterparts or ensure they are included in this PR:$ERRORS"
96+
exit 1
97+
else
98+
echo -e "\n\e[32mSuccess: All modified legacy files are synchronized with their versioned counterparts.\e[0m"
99+
fi

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
.DS_Store
66
*.swp
77
.venv
8-
.gdb_history
8+
.gdb_history
9+
infra/base-images/base-builder/indexer/indexer
10+
infra/base-images/base-builder/indexer/fuzzing_engine.a
11+
12+
# IntelliJ IDEA
13+
/.idea
14+
**/*.iml

0 commit comments

Comments
 (0)