Skip to content

Commit cebf44e

Browse files
author
Adam Cozzette
committed
Merge branch 'main' into patch-1
2 parents 3abbbad + f98575e commit cebf44e

File tree

1,418 files changed

+118155
-67927
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,418 files changed

+118155
-67927
lines changed

.bazelignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
# These are fetched as external repositories.
2-
third_party/abseil-cpp
3-
third_party/googletest
41
_build/

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
22

3+
# TODO: ErrorProne's SelfAssertions are violated in protobuf's test
4+
build --javacopt=-Xep:SelfAssertion:WARN
5+
36
build:dbg --compilation_mode=dbg
47

58
build:opt --compilation_mode=opt
@@ -22,6 +25,8 @@ build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
2225
# Workaround for the fact that Bazel links with $CC, not $CXX
2326
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
2427
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
28+
# Abseil passes nullptr to memcmp with 0 size
29+
build:ubsan --copt=-fno-sanitize=nonnull-attribute
2530

2631
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
2732
# https://github.com/protocolbuffers/protobuf/issues/14313

.bcr/metadata.template.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"homepage": "https://github.com/protocolbuffers/protobuf",
33
"maintainers": [
4+
{
5+
"email": "protobuf-packages@google.com",
6+
"github": "protobuf-team-bot",
7+
"name": "Protobuf Team"
8+
},
49
{
510
"email": "sandyzhang@google.com",
611
"github": "zhangskz",
@@ -15,6 +20,78 @@
1520
"email": "gberg@google.com",
1621
"github": "googleberg",
1722
"name": "Jerry Berg"
23+
},
24+
{
25+
"email": "acozette@google.com",
26+
"github": "acozette",
27+
"name": "Adam Cozette",
28+
"do_not_notify": true
29+
},
30+
{
31+
"email": "deannagarcia@google.com",
32+
"github": "deannagarcia",
33+
"name": "Deanna Garcia",
34+
"do_not_notify": true
35+
},
36+
{
37+
"email": "esrauch@google.com",
38+
"github": "esrauchg",
39+
"name": "Em Rauch",
40+
"do_not_notify": true
41+
},
42+
{
43+
"email": "haberman@google.com",
44+
"github": "haberman",
45+
"name": "Josh Haberman",
46+
"do_not_notify": true
47+
},
48+
{
49+
"email": "hongshin@google.com",
50+
"github": "honglooker",
51+
"name": "Hong Shin",
52+
"do_not_notify": true
53+
},
54+
{
55+
"email": "jatl@google.com",
56+
"github": "JasonLunn",
57+
"name": "Jason Lunn",
58+
"do_not_notify": true
59+
},
60+
{
61+
"email": "jieluo@google.com",
62+
"github": "anandolee",
63+
"name": "Jie Luo",
64+
"do_not_notify": true
65+
},
66+
{
67+
"email": "salo@google.com",
68+
"github": "salo",
69+
"name": "Eric Salo",
70+
"do_not_notify": true
71+
},
72+
{
73+
"email": "sbenza@google.com",
74+
"github": "sbenza",
75+
"name": "Samuel Benzaquen",
76+
"do_not_notify": true
77+
},
78+
{
79+
"email": "shaod@google.com",
80+
"github": "shaod2",
81+
"name": "Dennis Shao",
82+
"do_not_notify": true
83+
},
84+
{
85+
"email": "theodorerose@google.com",
86+
"github": "theodorerose",
87+
"name": "Theodore Rose",
88+
"do_not_notify": true
89+
},
90+
{
91+
"email": "tonyliaoss@google.com",
92+
"github": "tonyliaoss",
93+
"name": "Tony Liao",
94+
"do_not_notify": true
1895
}
1996
],
2097
"repository": ["github:protocolbuffers/protobuf"],

.bcr/presubmit.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
matrix:
22
platform: ["debian10", "macos", "ubuntu2004", "windows"]
3-
bazel: [6.x, 7.x]
3+
bazel: [7.x]
44

55
tasks:
66
verify_targets:
77
name: "Verify build targets"
88
platform: ${{ platform }}
99
bazel: ${{ bazel }}
1010
build_flags:
11-
- '--host_cxxopt=-std=c++14'
12-
- '--cxxopt=-std=c++14'
11+
- '--host_cxxopt=-std=c++17'
12+
- '--cxxopt=-std=c++17'
1313
build_targets:
1414
- '@protobuf//:protobuf'
1515
- '@protobuf//:protobuf_lite'
16+
- '@protobuf//:protobuf_python'
17+
- '@protobuf//:protobuf_java'
1618
- '@protobuf//:protoc'
1719
- '@protobuf//:test_messages_proto2_cc_proto'
1820
- '@protobuf//:test_messages_proto3_cc_proto'
1921

2022
bcr_test_module:
2123
module_path: "examples"
2224
matrix:
23-
2425
platform: ["debian10", "macos", "ubuntu2004", "windows"]
25-
bazel: [6.x, 7.x]
26+
bazel: [7.x]
2627
tasks:
2728
run_test_module:
2829
name: "Run test module"
2930
platform: ${{ platform }}
3031
bazel: ${{ bazel }}
3132
build_flags:
32-
- '--host_cxxopt=-std=c++14'
33-
- '--cxxopt=-std=c++14'
33+
- '--host_cxxopt=-std=c++17'
34+
- '--cxxopt=-std=c++17'
3435
build_targets:
3536
- "//..."

.github/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This information is extracted from the MacOS runner specs located at:
2-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
2+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
33
#
44
# When updating, also ensure the "xcode_destination" entries in
55
# `.github/workflows/test_objectivec.yml` are supported for the given versions

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
# Allow up to 3 opened pull requests for github-actions versions
8-
open-pull-requests-limit: 3
7+
# Don't allow non-security PRs to be opened.
8+
open-pull-requests-limit: 0

.github/scripts/validate_yaml.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
"""Validate the YAML files for GitHub Actions workflows.
2+
3+
TODO: b/359303016 - convert to use unittest
4+
"""
5+
6+
import os
7+
import re
8+
9+
import yaml
10+
11+
# Ensure every job is in the list of blocking jobs.
12+
with open(
13+
os.path.join(os.path.dirname(__file__), '../workflows/test_runner.yml'), 'r'
14+
) as f:
15+
data = yaml.safe_load(f)
16+
17+
# List of all YAML files that are used by jobs in the test_runner.yml file.
18+
yaml_files = []
19+
20+
# Get a list of all jobs in the test_runner, except for the blocking job and
21+
# the tag removal job, which is not always run.
22+
all_jobs = list(data['jobs'].keys())
23+
all_jobs.remove('all-blocking-tests')
24+
all_jobs.remove('remove-tag')
25+
26+
passed = True
27+
blocking_jobs = data['jobs']['all-blocking-tests']['needs']
28+
29+
for job in all_jobs:
30+
if 'uses' in data['jobs'][job]:
31+
yaml_files.append(
32+
os.path.join(
33+
os.path.dirname(__file__),
34+
'../workflows',
35+
os.path.basename(data['jobs'][job]['uses']),
36+
)
37+
)
38+
if job not in blocking_jobs:
39+
passed = False
40+
raise ValueError('Job %s is not in the list of blocking jobs.' % job)
41+
42+
print('PASSED: All jobs are in the list of blocking jobs.')
43+
44+
# Ensure every job with a continuous prefix conditions every step on whether we
45+
# are in a continuous run.
46+
for file in yaml_files:
47+
with open(file, 'r') as f:
48+
data = yaml.safe_load(f)
49+
jobs = data['jobs']
50+
for job in jobs:
51+
if 'steps' not in jobs[job]:
52+
continue
53+
continuous_condition = 'inputs.continuous-prefix' in jobs[job]['name']
54+
steps = jobs[job]['steps']
55+
for step in steps:
56+
if 'name' in step:
57+
name = step['name']
58+
elif 'with' in step and 'name' in step['with']:
59+
name = step['with']['name']
60+
else:
61+
raise ValueError(
62+
'Step in job %s from file %s does not have a name.' % (job, file)
63+
)
64+
if continuous_condition and 'continuous-run' not in step.get('if', ''):
65+
raise ValueError(
66+
'Step %s in job %s from file %s does not check the continuous-run'
67+
' condition' % (name, job, file)
68+
)
69+
if not continuous_condition and 'continuous-run' in step.get('if', ''):
70+
raise ValueError(
71+
'Step %s in job %s from file %s checks the continuous-run'
72+
' condition but the job does not contain the continuous-prefix'
73+
% (name, job, file)
74+
)
75+
print('PASSED: All steps in all jobs check the continuous-run condition.')
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
source googletest.sh || exit 1
4+
5+
script=${TEST_SRCDIR}/google3/third_party/protobuf/github/validate_yaml
6+
7+
$script || die "Failed to execute $script"
8+
9+
echo "PASS"

.github/workflows/janitor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
4646
4747
This issue is labeled `inactive` because the last activity was over
48-
90 days ago.
48+
90 days ago. This issue will be closed and archived after 14
49+
additional days without activity.
4950
close-issue-message: >
5051
We triage inactive PRs and issues in order to make it easier to find
5152
active work. If this issue should remain active or becomes active

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4848
# format to the repository Actions tab.
4949
- name: "Upload artifact"
50-
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
50+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
5151
with:
5252
name: SARIF file
5353
path: results.sarif

0 commit comments

Comments
 (0)