Skip to content

Commit 65cc9cd

Browse files
committed
grpc-native: Build cache within repository
Signed-off-by: Johannes Zottele <[email protected]>
1 parent 7c3e364 commit 65cc9cd

File tree

106 files changed

+300
-6239
lines changed

Some content is hidden

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

106 files changed

+300
-6239
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Verify gRPC CLib Checksum is Up-to-Date
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
verify-platforms-table:
11+
name: Run Verification
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Sources
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v4
20+
- name: Run gRPC Checksum Generation
21+
run: ./gradlew grpc:grpc-core:computeSha256AllTargetsForCLibGrpc_fat --info --stacktrace
22+
- name: Check if prebuilt gRPC library checksum is up-to-date
23+
run: |
24+
if [[ -n "$(git status --porcelain | grep cinterop-c/prebuilt-deps/grpc_fat/)" ]]; then
25+
echo "Prebuilt gRPC library checksum is not up to date. Please run './gradlew grpc:grpc-core:computeSha256AllTargetsForCLibGrpc_fat' and commit changes"
26+
exit 1
27+
fi

cinterop-c/BUILD.bazel

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
22
load("@rules_cc//cc:defs.bzl", "cc_library")
33

4-
cc_static_library(
5-
name = "kgrpc_fat",
6-
deps = [
7-
":kgrpc",
8-
"//grpc_dep:grpc_core_prebuilt",
9-
],
10-
)
11-
124
cc_library(
135
name = "kgrpc",
146
srcs = ["src/kgrpc.cpp"],
@@ -17,7 +9,7 @@ cc_library(
179
includes = ["include"],
1810
visibility = ["//visibility:public"],
1911
deps = [
20-
"//grpc_dep:grpc_core_prebuilt",
12+
"//prebuilt-deps/grpc_fat:grpc_core_prebuilt",
2113
],
2214
)
2315

@@ -39,10 +31,3 @@ cc_library(
3931
"@com_github_protobuffers_protobuf//:protobuf_lite",
4032
],
4133
)
42-
43-
cc_binary(
44-
name = "grpc_flat",
45-
deps = [
46-
"//grpc_dep:grpc_core_prebuilt",
47-
],
48-
)

cinterop-c/MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ bazel_dep(
4040

4141
## gRPC pre-built
4242

43+
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
44+
45+
local_repository(
46+
name = "prebuilt_deps",
47+
path = "prebuilt-deps",
48+
)
49+
4350
http_file(
4451
name = "grpc_ios_arm64",
4552
sha256 = "7bc13a15c59850048e77b5719ea262a6fcc22884ab42c9f14f38859200faac9b",

cinterop-c/build_and_publish_dep.sh

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

cinterop-c/extract_include_dir.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
4+
#
5+
6+
set -Eeuo pipefail
7+
trap 'echo "ERROR: Build failed at ${BASH_SOURCE}:${LINENO}" >&2' ERR
8+
9+
# Builds a static library for a specific platform (os/arch).
10+
#
11+
# Usage:
12+
# ./build_target.sh //path:libtarget out_dir <platform> <short> <os>
13+
# Example:
14+
# ./build_target.sh :protowire_static out @build_bazel_apple_support//platforms:ios_arm64 ios_arm64 ios
15+
#
16+
# The example will produce ./out/libprotowire_static.ios_arm64.a
17+
18+
LABEL="${1:?need bazel target label}"
19+
DST="${2:?need output destination}"
20+
21+
CONFIG=release
22+
23+
mkdir -p $(dirname "$DST")
24+
25+
bazel build "$LABEL" >/dev/null
26+
27+
# Ask Bazel what file(s) this target produced
28+
out="$(bazel cquery "$LABEL" --output=files | head -n1)"
29+
[[ -n "$out/include" ]] || { echo "No output for $LABEL"; exit 1; }
30+
31+
rm -rf "$DST/include"
32+
cp -rLf "$out/include" "$DST/include"
33+
chmod -R u+w "$DST"

cinterop-c/grpc_dep/include/grpc/census.h

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

0 commit comments

Comments
 (0)