Start reducing our reliance on autotools (#9824)

Start reducing our reliance on autotools

This commit updates a few of our CI scripts to build protoc using Bazel
instead of autotools. I also updated the setuptools and Rake build
configs to look for protoc under bazel-bin/ so that they will
preferentially use a Bazel-built protoc binary. The goal is to start
chipping away at our use of autotools in preparation for eventually
dropping autotools support.
pull/9871/head
Adam Cozzette 3 years ago committed by GitHub
parent d2b669a4dd
commit 9c8c3dea30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      kokoro/release/python/macos/config.sh
  2. 9
      kokoro/release/ruby/linux/ruby/ruby_build.sh
  3. 8
      kokoro/release/ruby/macos/ruby/ruby_build.sh
  4. 8
      ruby/Rakefile

@ -25,12 +25,13 @@ function pre_build {
# Runs in the root directory of this repository.
pushd protobuf
# Build protoc
./autogen.sh
./configure
CXXFLAGS="-std=c++14 -fPIC -g -O2" ./configure
make -j8
# Build protoc and protobuf libraries
use_bazel.sh 5.1.1
bazel build //:protoc
export PROTOC=$PWD/bazel-bin/protoc
mkdir src/.libs
ln -s $PWD/bazel-bin/libprotobuf.a src/.libs/libprotobuf.a
ln -s $PWD/bazel-bin/libprotobuf_lite.a src/.libs/libprotobuf-lite.a
# Generate python dependencies.
pushd python

@ -3,11 +3,10 @@
set -ex
# Build protoc
if test ! -e src/protoc; then
./autogen.sh
./configure
make -j4
fi
use_bazel.sh 5.1.1
bazel build //:protoc
cp bazel-bin/protoc src/protoc
export PROTOC=$PWD/src/protoc
umask 0022
pushd ruby

@ -3,11 +3,9 @@
set -ex
# Build protoc
if test ! -e src/protoc; then
./autogen.sh
./configure
make -j4
fi
use_bazel.sh 5.1.1
bazel build //:protoc
export PROTOC=$PWD/bazel-bin/protoc
umask 0022
pushd ruby

@ -37,10 +37,12 @@ proto2_protos = %w[
google/protobuf/compiler/plugin.proto
]
if system('../src/protoc --version')
protoc_command = '../src/protoc'
if !ENV['PROTOC'].nil?
protoc_command = ENV['PROTOC']
elsif system('../src/protoc --version')
protoc_command = '../src/protoc'
else
protoc_command = 'protoc'
protoc_command = 'protoc'
end
genproto_output = []

Loading…
Cancel
Save