mirror of https://github.com/grpc/grpc-web.git
Rework release workflows using Github runners (replacing Zig) (#1496)
This PR modernizes the grpc-web release workflows by migrating from make/Zig-based build systems to Bazel across all platforms, and updates GitHub Actions to use current versions. ## Main changes: - Removes Zig build system and migrates all platforms to use Bazel for building the protoc plugin - Standardizes version handling across workflows with dynamic computation from inputs or Git refs - Updates GitHub Actions versions and adds support for ARM64 runners on all platforms
This commit is contained in:
parent
56d857e3d8
commit
d0ecc7635b
14
.bazelrc
14
.bazelrc
|
@ -1,14 +1,10 @@
|
|||
build --copt=-Wno-error=deprecated-declarations --host_copt=-Wno-error=deprecated-declarations
|
||||
# Common build settings for unix-like systems
|
||||
build --copt=-Wno-error=deprecated-declarations
|
||||
build --host_copt=-Wno-error=deprecated-declarations
|
||||
|
||||
# Required until this is the default; expected in Bazel 7
|
||||
common --enable_bzlmod
|
||||
|
||||
# Load any settings specific to the current user.
|
||||
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
|
||||
# This needs to be last statement in this
|
||||
# config, as the user configuration should be able to overwrite flags from this file.
|
||||
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
|
||||
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
|
||||
# rather than user.bazelrc as suggested in the Bazel docs)
|
||||
# Per-user settings (gitignored). Keep last so local flags can override.
|
||||
# Docs: https://bazel.build/configure/best-practices#bazelrc
|
||||
try-import %workspace%/.bazelrc.user
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# This is a Windows-specific bazelrc file for use in GitHub Actions.
|
||||
# It contains settings from the main .bazelrc file that are relevant for Windows builds.
|
||||
|
||||
# Windows specific settings
|
||||
build --copt=-DABSL_HAVE_WORKING_GCC_WNO_DEPRECATED_DECLARATIONS=0
|
||||
build --host_copt=-DABSL_HAVE_WORKING_GCC_WNO_DEPRECATED_DECLARATIONS=0
|
||||
|
||||
# Required until this is the default; expected in Bazel 7
|
||||
common --enable_bzlmod
|
||||
|
||||
# Per-user settings (gitignored). Keep last so local flags can override.
|
||||
# Docs: https://bazel.build/configure/best-practices#bazelrc
|
||||
try-import %workspace%/.bazelrc.user
|
|
@ -1,42 +0,0 @@
|
|||
name: Make ARM Plugins (Windows/macOS/Linux)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_number:
|
||||
description: 'Version number'
|
||||
required: true
|
||||
default: '1.x.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
- name: Setup Zig
|
||||
run: |
|
||||
mkdir -p $HOME/.local/bin $HOME/.local/zig
|
||||
curl 'https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz' | tar xJ --strip-components=1 --directory=$HOME/.local/zig
|
||||
ln -s $HOME/.local/zig/zig $HOME/.local/bin/zig
|
||||
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
|
||||
- name: Build plugin
|
||||
env:
|
||||
VERSION: ${{ github.event.inputs.version_number }}
|
||||
run: |
|
||||
cd javascript/net/grpc/web/generator
|
||||
zig build -Drelease-fast
|
||||
- name: gen and verify sha256
|
||||
run: |
|
||||
cd javascript/net/grpc/web/generator/zig-out/bin
|
||||
for exe in $(ls)
|
||||
do
|
||||
openssl dgst -sha256 -r -out $exe'.sha256' $exe
|
||||
sha256sum -c $exe'.sha256'
|
||||
done
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: plugin
|
||||
path: javascript/net/grpc/web/generator/zig-out/bin/
|
|
@ -1,32 +1,97 @@
|
|||
name: Make Linux Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-linux.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-linux.yml
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_number:
|
||||
description: 'Version number'
|
||||
required: true
|
||||
default: '1.x.x'
|
||||
default: '2.x.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-24.04-arm]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build plugin docker image
|
||||
run: docker-compose build prereqs protoc-plugin
|
||||
- name: Copy binary from Docker image
|
||||
- uses: actions/checkout@v4
|
||||
- name: Compute VERSION_NUMBER
|
||||
run: |
|
||||
docker cp $(docker create grpcweb/protoc-plugin):/github/grpc-web/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
|
||||
./protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64
|
||||
- name: gen sha256
|
||||
INPUT_VERSION="${{ github.event.inputs.version_number }}"
|
||||
if [ -n "$INPUT_VERSION" ]; then
|
||||
VERSION="$INPUT_VERSION"
|
||||
else
|
||||
VERSION="$GITHUB_REF_NAME"
|
||||
fi
|
||||
VERSION="${VERSION//\//-}"
|
||||
echo "VERSION_NUMBER=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "Computed VERSION_NUMBER=$VERSION"
|
||||
- name: Compute ARCH suffix and artifact name
|
||||
id: meta
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64.sha256 \
|
||||
protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64
|
||||
- name: verify sha256
|
||||
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64.sha256
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
aarch64|arm64)
|
||||
ARCH_SUFFIX="aarch64"
|
||||
;;
|
||||
x86_64|amd64)
|
||||
ARCH_SUFFIX="x86_64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
ARTIFACT="protoc-gen-grpc-web-${VERSION_NUMBER}-linux-${ARCH_SUFFIX}"
|
||||
echo "ARTIFACT=$ARTIFACT" >> "$GITHUB_ENV"
|
||||
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
|
||||
echo "Will produce artifact: $ARTIFACT"
|
||||
- name: Install Bazelisk (Bazel)
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y unzip zip
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
aarch64|arm64)
|
||||
BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64"
|
||||
;;
|
||||
x86_64|amd64)
|
||||
BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture for Bazelisk: $ARCH" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "Downloading Bazelisk from $BAZELISK_URL"
|
||||
sudo curl -L -o /usr/local/bin/bazelisk "$BAZELISK_URL"
|
||||
sudo chmod +x /usr/local/bin/bazelisk
|
||||
# Also provide `bazel` symlink for tools that expect it
|
||||
sudo ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel
|
||||
bazelisk version
|
||||
- name: Build protoc-gen-grpc-web with Bazel
|
||||
run: |
|
||||
bazelisk build //javascript/net/grpc/web/generator:protoc-gen-grpc-web
|
||||
- name: Move artifact
|
||||
run: |
|
||||
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
|
||||
./${ARTIFACT}
|
||||
- name: Generate sha256
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
|
||||
${ARTIFACT}
|
||||
- name: Verify sha256
|
||||
run: sha256sum -c ${ARTIFACT}.sha256
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: plugin
|
||||
name: ${{ steps.meta.outputs.artifact }}
|
||||
path: protoc-gen-grpc-web*
|
||||
|
|
|
@ -1,48 +1,80 @@
|
|||
name: Make MacOS Plugin
|
||||
name: Make macOS Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-mac-os.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-mac-os.yml
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_number:
|
||||
description: 'Version number'
|
||||
required: true
|
||||
default: '1.x.x'
|
||||
default: '2.x.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-13, macos-14]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install build utils
|
||||
run: brew install coreutils automake
|
||||
- name: Checkout protobuf code
|
||||
run: |
|
||||
./scripts/init_submodules.sh
|
||||
# Protobuf build instructions from:
|
||||
# https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
|
||||
- name: Build protobuf (configure & make)
|
||||
run: |
|
||||
cd ./third_party/protobuf
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j$(nproc)
|
||||
make install
|
||||
- name: Remove dynamite dependencies (similar to `-static` on linux)
|
||||
run: rm /usr/local/lib/libproto*.dylib
|
||||
- name: make
|
||||
run: make clean && make plugin
|
||||
- name: move
|
||||
run: |
|
||||
mv javascript/net/grpc/web/generator/protoc-gen-grpc-web \
|
||||
./protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64
|
||||
- name: gen sha256
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64.sha256 \
|
||||
protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64
|
||||
- name: verify sha256
|
||||
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64.sha256
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: plugin
|
||||
path: protoc-gen-grpc-web*
|
||||
- uses: actions/checkout@v4
|
||||
- name: Compute VERSION_NUMBER
|
||||
run: |
|
||||
INPUT_VERSION="${{ github.event.inputs.version_number }}"
|
||||
if [ -n "$INPUT_VERSION" ]; then
|
||||
VERSION="$INPUT_VERSION"
|
||||
else
|
||||
VERSION="$GITHUB_REF_NAME"
|
||||
fi
|
||||
# Minimal sanitization: replace slashes with dashes to keep filenames valid
|
||||
VERSION="${VERSION//\//-}"
|
||||
echo "VERSION_NUMBER=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "Computed VERSION_NUMBER=$VERSION"
|
||||
- name: Compute ARCH suffix and artifact name
|
||||
id: meta
|
||||
run: |
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
arm64)
|
||||
ARCH_SUFFIX="aarch64"
|
||||
;;
|
||||
x86_64)
|
||||
ARCH_SUFFIX="x86_64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
ARTIFACT="protoc-gen-grpc-web-${VERSION_NUMBER}-darwin-${ARCH_SUFFIX}"
|
||||
echo "ARTIFACT=$ARTIFACT" >> "$GITHUB_ENV"
|
||||
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
|
||||
echo "Will produce artifact: $ARTIFACT"
|
||||
- name: Install Bazelisk (Bazel)
|
||||
run: |
|
||||
brew update
|
||||
brew install bazelisk
|
||||
bazelisk version
|
||||
- name: Build protoc-gen-grpc-web with Bazel
|
||||
run: |
|
||||
bazelisk build //javascript/net/grpc/web/generator:protoc-gen-grpc-web
|
||||
- name: Move artifact
|
||||
run: |
|
||||
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
|
||||
./${ARTIFACT}
|
||||
- name: Generate sha256
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
|
||||
${ARTIFACT}
|
||||
- name: Verify sha256
|
||||
run: shasum -a 256 -c ${ARTIFACT}.sha256
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.meta.outputs.artifact }}
|
||||
path: protoc-gen-grpc-web*
|
||||
|
|
|
@ -1,37 +1,102 @@
|
|||
name: Make Windows Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-windows.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/make-plugin-windows.yml
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_number:
|
||||
description: 'Version number'
|
||||
required: true
|
||||
default: '1.x.x'
|
||||
default: '2.x.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-2025, windows-11-arm]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Print Bazel version
|
||||
run: |
|
||||
bazel version
|
||||
- name: build
|
||||
run: bazel build javascript/net/grpc/web/generator:protoc-gen-grpc-web
|
||||
- name: move
|
||||
run: |
|
||||
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web.exe \
|
||||
./protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-windows-x86_64.exe
|
||||
shell: bash
|
||||
- name: gen sha256
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-windows-x86_64.exe.sha256 \
|
||||
protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-windows-x86_64.exe
|
||||
shell: bash
|
||||
# TODO: Check sha256 (sha256sum not available for now. )
|
||||
#- name: verify sha256
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: plugin
|
||||
path: protoc-gen-grpc-web*
|
||||
- uses: actions/checkout@v4
|
||||
- name: Compute VERSION_NUMBER
|
||||
run: |
|
||||
INPUT_VERSION="${{ github.event.inputs.version_number }}"
|
||||
if [ -n "$INPUT_VERSION" ]; then
|
||||
VERSION="$INPUT_VERSION"
|
||||
else
|
||||
VERSION="$GITHUB_REF_NAME"
|
||||
fi
|
||||
# Minimal sanitization: replace slashes with dashes to keep filenames valid
|
||||
VERSION="${VERSION//\//-}"
|
||||
echo "VERSION_NUMBER=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "Computed VERSION_NUMBER=$VERSION"
|
||||
shell: bash
|
||||
- name: Compute ARCH suffix and artifact name
|
||||
id: meta
|
||||
shell: powershell
|
||||
run: |
|
||||
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
|
||||
switch ($arch) {
|
||||
'Arm64' { $archSuffix = 'aarch64' }
|
||||
'X64' { $archSuffix = 'x86_64' }
|
||||
default { Write-Error "Unsupported architecture: $arch"; exit 1 }
|
||||
}
|
||||
$artifact = "protoc-gen-grpc-web-$($env:VERSION_NUMBER)-windows-$archSuffix.exe"
|
||||
"ARTIFACT=$artifact" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
"artifact=$artifact" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
Write-Host "Will produce artifact: $artifact"
|
||||
- name: Install Bazelisk (Bazel)
|
||||
shell: powershell
|
||||
run: |
|
||||
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
|
||||
switch ($arch) {
|
||||
'Arm64' { $suffix = 'arm64' }
|
||||
'X64' { $suffix = 'amd64' }
|
||||
default { Write-Error "Unsupported architecture: $arch"; exit 1 }
|
||||
}
|
||||
$url = "https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-windows-$suffix.exe"
|
||||
$destDir = "$env:RUNNER_TEMP"
|
||||
$dest = Join-Path $destDir 'bazelisk.exe'
|
||||
Write-Host "Downloading Bazelisk from $url to $dest"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $dest
|
||||
# Add to PATH for subsequent steps
|
||||
$destDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: Print Bazelisk version
|
||||
shell: powershell
|
||||
run: bazelisk version
|
||||
- name: Build protoc-gen-grpc-web with Bazel
|
||||
run: bazelisk --noworkspace_rc --bazelrc=.bazelrc.windows build //javascript/net/grpc/web/generator:protoc-gen-grpc-web
|
||||
shell: powershell
|
||||
- name: Move artifact
|
||||
run: |
|
||||
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web.exe "./${ARTIFACT}"
|
||||
shell: bash
|
||||
- name: Generate sha256
|
||||
run: |
|
||||
openssl dgst -sha256 -r -out "${ARTIFACT}.sha256" "${ARTIFACT}"
|
||||
shell: bash
|
||||
- name: Verify sha256
|
||||
shell: powershell
|
||||
run: |
|
||||
$shaFile = "${env:ARTIFACT}.sha256"
|
||||
if (-not (Test-Path $shaFile)) { Write-Error "SHA256 file not found: $shaFile"; exit 1 }
|
||||
$line = Get-Content -Raw $shaFile
|
||||
if (-not $line) { Write-Error "Empty sha256 file: $shaFile"; exit 1 }
|
||||
$expected = ($line -split '\s+')[0].ToLower()
|
||||
$actual = (Get-FileHash "${env:ARTIFACT}" -Algorithm SHA256).Hash.ToLower()
|
||||
if ($actual -ne $expected) {
|
||||
Write-Error "SHA256 mismatch. Expected $expected, got $actual"
|
||||
exit 1
|
||||
} else {
|
||||
Write-Host "SHA256 verified: $actual"
|
||||
}
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.meta.outputs.artifact }}
|
||||
path: protoc-gen-grpc-web*
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout
|
||||
- uses: actions/checkout@v3
|
||||
# GITHUB_REF is defined here:
|
||||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
||||
- run: git archive --format zip --prefix "grpc-web-$TAG/" --output "grpc-web-source-${TAG}.zip" "$GITHUB_REF"
|
||||
|
|
|
@ -13,3 +13,4 @@ target
|
|||
.settings
|
||||
zig-out
|
||||
zig-cache
|
||||
.zig-cache
|
||||
|
|
|
@ -1,215 +0,0 @@
|
|||
const std = @import("std");
|
||||
const CrossTarget = std.zig.CrossTarget;
|
||||
|
||||
fn format(comptime fmt: []const u8, args: anytype) []const u8 {
|
||||
return std.fmt.allocPrint(std.testing.allocator, fmt, args) catch unreachable;
|
||||
}
|
||||
|
||||
const BinaryTarget = struct {
|
||||
name: []const u8,
|
||||
arch: []const u8,
|
||||
};
|
||||
|
||||
pub fn build(b: *std.build.Builder) void {
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
|
||||
var version = if (std.os.getenv("VERSION")) |v| v else "unknown";
|
||||
|
||||
var targets = [_]BinaryTarget{
|
||||
// for now, let's only build aarch64 binaries
|
||||
// .{ .name = format("protoc-gen-grpc-web-{s}-linux-x86_64", .{version}), .arch = "x86_64-linux" },
|
||||
// .{ .name = format("protoc-gen-grpc-web-{s}-darwin-x86_64", .{version}), .arch = "x86_64-macos" },
|
||||
// .{ .name = format("protoc-gen-grpc-web-{s}-windows-x86_64", .{version}), .arch = "x86_64-windows" },
|
||||
|
||||
.{ .name = format("protoc-gen-grpc-web-{s}-linux-aarch64", .{version}), .arch = "aarch64-linux" },
|
||||
.{ .name = format("protoc-gen-grpc-web-{s}-darwin-aarch64", .{version}), .arch = "aarch64-macos" },
|
||||
.{ .name = format("protoc-gen-grpc-web-{s}-windows-aarch64", .{version}), .arch = "aarch64-windows" },
|
||||
};
|
||||
|
||||
for (targets) |target| {
|
||||
const exe = b.addExecutable(target.name, "grpc_generator.cc");
|
||||
exe.linkLibCpp();
|
||||
exe.linkSystemLibrary("pthread");
|
||||
exe.linkSystemLibrary("dl");
|
||||
exe.addIncludeDir("../../../../../third_party/protobuf/src");
|
||||
exe.defineCMacro("HAVE_PTHREAD", "1");
|
||||
exe.addCSourceFiles(&[_][]const u8{
|
||||
// libprotobuf_lite source files (copied from third_party/protobuf/cmake/libprotobuf-lite.cmake)
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/any_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/arena.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/arenastring.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/extension_set.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/generated_enum_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/generated_message_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/io_win32.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/strtod.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/map.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/message_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/parse_context.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/repeated_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/bytestream.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/common.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/int128.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/status.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/statusor.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/stringpiece.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/stringprintf.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/strutil.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/time.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/wire_format_lite.cc",
|
||||
|
||||
// libprotobuf ssource files (copied from third_party/protobuf/cmake/libprotobuf.cmake)
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/any.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/any.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/api.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/importer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/parser.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/descriptor.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/descriptor.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/descriptor_database.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/duration.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/dynamic_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/empty.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/extension_set_heavy.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/generated_message_reflection.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/gzip_stream.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/printer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/io/tokenizer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/map_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/reflection_ops.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/service.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/source_context.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/struct.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/stubs/substitute.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/text_format.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/timestamp.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/type.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/unknown_field_set.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/field_comparator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/field_mask_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/datapiece.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/error_listener.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/json_escaping.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/object_writer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/type_info.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/internal/utility.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/json_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/message_differencer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/time_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/wire_format.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/wrappers.pb.cc",
|
||||
|
||||
// libprotoc source files (copied from third_party/protobuf/cmake/libprotoc.cmake)
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/code_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_context.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_enum.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_extension.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_file.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_service.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/js/js_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/php/php_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/python/python_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
|
||||
"../../../../../third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
|
||||
}, &[_][]const u8{
|
||||
"-pthread",
|
||||
});
|
||||
|
||||
exe.setTarget(CrossTarget.parse(.{ .arch_os_abi = target.arch }) catch unreachable);
|
||||
exe.setBuildMode(mode);
|
||||
exe.strip = true;
|
||||
exe.install();
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# TODO: Migrate to be using bazel build.
|
||||
FROM grpcweb/prereqs
|
||||
|
||||
ARG MAKEFLAGS=-j8
|
||||
|
|
Loading…
Reference in New Issue