Skip to content

Commit 9659ea5

Browse files
authored
Merge pull request #944 from swiftlang/t/vendor
Switch protobuf from submodule to subtree vendoring
2 parents 11970d7 + c478b9d commit 9659ea5

File tree

4,652 files changed

+1364626
-7
lines changed

Some content is hidden

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

4,652 files changed

+1364626
-7
lines changed

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
[submodule "thirdparty/protobuf"]
2-
path = thirdparty/protobuf
3-
url = https://github.com/protocolbuffers/protobuf.git
4-
[submodule "thirdparty/swift-protobuf"]
5-
path = thirdparty/swift-protobuf
6-
url = https://github.com/apple/swift-protobuf.git

thirdparty/protobuf

Lines changed: 0 additions & 1 deletion
This file was deleted.

thirdparty/protobuf/.bazelignore

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

thirdparty/protobuf/.bazelrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
2+
3+
build:dbg --compilation_mode=dbg
4+
5+
build:opt --compilation_mode=opt
6+
7+
build:san-common --config=dbg --strip=never --copt=-O0 --copt=-fno-omit-frame-pointer
8+
9+
build:asan --config=san-common --copt=-fsanitize=address --linkopt=-fsanitize=address
10+
# ASAN hits ODR violations with shared linkage due to rules_proto.
11+
build:asan --dynamic_mode=off
12+
13+
build:msan --config=san-common --copt=-fsanitize=memory --linkopt=-fsanitize=memory
14+
build:msan --copt=-fsanitize-memory-track-origins
15+
build:msan --copt=-fsanitize-memory-use-after-dtor
16+
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
17+
18+
build:tsan --config=san-common --copt=-fsanitize=thread --linkopt=-fsanitize=thread
19+
20+
build:ubsan --config=san-common --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined
21+
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
22+
# Workaround for the fact that Bazel links with $CC, not $CXX
23+
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
24+
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
25+
26+
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
27+
# https://github.com/protocolbuffers/protobuf/issues/14313
28+
common --noenable_bzlmod
29+
30+
# Important: this flag ensures that we remain compliant with the C++ layering
31+
# check.
32+
build --features=layering_check
33+
34+
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1

thirdparty/protobuf/.bcr/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Bazel Central Registry
2+
3+
When protobuf is released, we want it to be published to the Bazel Central
4+
Registry automatically: <https://registry.bazel.build>
5+
6+
This folder contains configuration files to automate the publish step. See
7+
<https://github.com/bazel-contrib/publish-to-bcr/blob/main/templates/README.md>
8+
for authoritative documentation about these files.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"homepage": "https://github.com/protocolbuffers/protobuf",
3+
"maintainers": [
4+
{
5+
"email": "[email protected]",
6+
"github": "zhangskz",
7+
"name": "Sandy Zhang"
8+
},
9+
{
10+
"email": "[email protected]",
11+
"github": "mkruskal-google",
12+
"name": "Mike Kruskal"
13+
},
14+
{
15+
"email": "[email protected]",
16+
"github": "googleberg",
17+
"name": "Jerry Berg"
18+
}
19+
],
20+
"repository": ["github:protocolbuffers/protobuf"],
21+
"versions": [],
22+
"yanked_versions": {}
23+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
matrix:
2+
platform: ["debian10", "macos", "ubuntu2004", "windows"]
3+
bazel: [6.x, 7.x]
4+
5+
tasks:
6+
verify_targets:
7+
name: "Verify build targets"
8+
platform: ${{ platform }}
9+
bazel: ${{ bazel }}
10+
build_flags:
11+
- '--host_cxxopt=-std=c++14'
12+
- '--cxxopt=-std=c++14'
13+
build_targets:
14+
- '@protobuf//:protobuf'
15+
- '@protobuf//:protobuf_lite'
16+
- '@protobuf//:protoc'
17+
- '@protobuf//:test_messages_proto2_cc_proto'
18+
- '@protobuf//:test_messages_proto3_cc_proto'
19+
20+
bcr_test_module:
21+
module_path: "examples"
22+
matrix:
23+
24+
platform: ["debian10", "macos", "ubuntu2004", "windows"]
25+
bazel: [6.x, 7.x]
26+
tasks:
27+
run_test_module:
28+
name: "Run test module"
29+
platform: ${{ platform }}
30+
bazel: ${{ bazel }}
31+
build_flags:
32+
- '--host_cxxopt=-std=c++14'
33+
- '--cxxopt=-std=c++14'
34+
build_targets:
35+
- "//..."
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"integrity": "**leave this alone**",
3+
"strip_prefix": "{REPO}-{VERSION}",
4+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{VERSION}.zip"
5+
}

thirdparty/protobuf/.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BasedOnStyle: Google
2+
DerivePointerAlignment: false
3+
PointerAlignment: Left
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# 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
3+
#
4+
# When updating, also ensure the "xcode_destination" entries in
5+
# `.github/workflows/test_objectivec.yml` are supported for the given versions
6+
# of Xcode.
7+
xcode_version(
8+
name = "version15_2_15C500b",
9+
aliases = [
10+
"15C500b",
11+
"15.2",
12+
],
13+
default_ios_sdk_version = "17.2",
14+
default_macos_sdk_version = "14.2",
15+
default_tvos_sdk_version = "17.2",
16+
default_watchos_sdk_version = "10.2",
17+
version = "15.2.0.15C500b",
18+
)
19+
20+
xcode_version(
21+
name = "version14_2_14C18",
22+
aliases = [
23+
"14C18",
24+
"14.2",
25+
],
26+
default_ios_sdk_version = "16.2",
27+
default_macos_sdk_version = "13.1",
28+
default_tvos_sdk_version = "16.1",
29+
default_watchos_sdk_version = "9.1",
30+
version = "14.2.0.14C18",
31+
)
32+
33+
xcode_version(
34+
name = "version14_1_0_14B47b",
35+
aliases = [
36+
"14B47b",
37+
"14.1",
38+
],
39+
default_ios_sdk_version = "16.1",
40+
default_macos_sdk_version = "13.0",
41+
default_tvos_sdk_version = "16.1",
42+
default_watchos_sdk_version = "9.1",
43+
version = "14.1.0.14B47b",
44+
)
45+
46+
xcode_config(
47+
name = "host_xcodes",
48+
default = ":version14_2_14C18",
49+
versions = [
50+
":version15_2_15C500b",
51+
":version14_2_14C18",
52+
":version14_1_0_14B47b",
53+
],
54+
)

0 commit comments

Comments
 (0)