Added dependencies locally
This commit is contained in:
67
deps/protobuf/kokoro/release/python/macos/build_artifacts.sh
vendored
Normal file
67
deps/protobuf/kokoro/release/python/macos/build_artifacts.sh
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Remove any pre-existing protobuf installation.
|
||||
brew uninstall -f protobuf
|
||||
|
||||
# change to repo root
|
||||
pushd $(dirname $0)/../../../..
|
||||
|
||||
# Create stage dir
|
||||
ORIGINAL_DIR=`pwd`
|
||||
pushd ..
|
||||
cp -R $ORIGINAL_DIR stage
|
||||
export STAGE_DIR="`pwd`/stage"
|
||||
popd
|
||||
|
||||
export REPO_DIR=protobuf
|
||||
export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"`
|
||||
export BUILD_COMMIT=`git rev-parse HEAD`
|
||||
export PLAT=x86_64
|
||||
export UNICODE_WIDTH=32
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
export TRAVIS_OS_NAME="osx"
|
||||
|
||||
rm -rf artifacts/
|
||||
rm -rf multibuild/
|
||||
mkdir artifacts
|
||||
export ARTIFACT_DIR=$(pwd)/artifacts
|
||||
|
||||
git clone https://github.com/matthew-brett/multibuild.git
|
||||
# Pin multibuild scripts at a known commit to avoid potentially unwanted future changes from
|
||||
# silently creeping in (see https://github.com/protocolbuffers/protobuf/issues/9180).
|
||||
# IMPORTANT: always pin multibuild at the same commit for:
|
||||
# - linux/build_artifacts.sh
|
||||
# - linux/build_artifacts.sh
|
||||
# - windows/build_artifacts.bat
|
||||
(cd multibuild; git checkout b89bb903e94308be79abefa4f436bf123ebb1313)
|
||||
cp kokoro/release/python/macos/config.sh config.sh
|
||||
|
||||
OLD_PATH=$PATH
|
||||
|
||||
build_artifact_version() {
|
||||
MB_PYTHON_VERSION=$1
|
||||
|
||||
# Clean up env
|
||||
rm -rf venv
|
||||
sudo rm -rf $REPO_DIR
|
||||
cp -R $STAGE_DIR $REPO_DIR
|
||||
export PATH=$OLD_PATH
|
||||
|
||||
source multibuild/common_utils.sh
|
||||
source multibuild/travis_steps.sh
|
||||
before_install
|
||||
|
||||
clean_code $REPO_DIR $BUILD_COMMIT
|
||||
|
||||
build_wheel $REPO_DIR/python $PLAT
|
||||
|
||||
mv wheelhouse/* $ARTIFACT_DIR
|
||||
}
|
||||
|
||||
export MB_PYTHON_OSX_VER=10.9
|
||||
build_artifact_version 3.7
|
||||
build_artifact_version 3.8
|
||||
build_artifact_version 3.9
|
||||
build_artifact_version 3.10
|
67
deps/protobuf/kokoro/release/python/macos/config.sh
vendored
Normal file
67
deps/protobuf/kokoro/release/python/macos/config.sh
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
# Define custom utilities
|
||||
# Test for OSX with [ -n "$IS_OSX" ]
|
||||
|
||||
function remove_travis_ve_pip {
|
||||
# Removing the system virtualenv or pip can be very problematic for
|
||||
# macOS on Kokoro, so just leave them be.
|
||||
:;
|
||||
}
|
||||
|
||||
function install_pip {
|
||||
check_python
|
||||
PIP_CMD="sudo $PYTHON_EXE -m pip${pip_args:+ $pip_args}"
|
||||
$PIP_CMD install --upgrade pip
|
||||
}
|
||||
|
||||
function install_virtualenv {
|
||||
check_python
|
||||
check_pip
|
||||
$PIP_CMD install --upgrade virtualenv
|
||||
VIRTUALENV_CMD="$PYTHON_EXE -m virtualenv"
|
||||
}
|
||||
|
||||
function pre_build {
|
||||
# Any stuff that you need to do before you start building the wheels
|
||||
# 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
|
||||
|
||||
# Generate python dependencies.
|
||||
pushd python
|
||||
python setup.py build_py
|
||||
popd
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
function bdist_wheel_cmd {
|
||||
# Builds wheel with bdist_wheel, puts into wheelhouse
|
||||
#
|
||||
# It may sometimes be useful to use bdist_wheel for the wheel building
|
||||
# process. For example, versioneer has problems with versions which are
|
||||
# fixed with bdist_wheel:
|
||||
# https://github.com/warner/python-versioneer/issues/121
|
||||
local abs_wheelhouse=$1
|
||||
|
||||
# Modify build version
|
||||
pwd
|
||||
ls
|
||||
python setup.py bdist_wheel --cpp_implementation --compile_static_extension
|
||||
cp dist/*.whl $abs_wheelhouse
|
||||
}
|
||||
|
||||
function build_wheel {
|
||||
build_wheel_cmd "bdist_wheel_cmd" $@
|
||||
}
|
||||
|
||||
function run_tests {
|
||||
# Runs tests on installed distribution from an empty directory
|
||||
python --version
|
||||
python -c "from google.protobuf.pyext import _message;"
|
||||
}
|
8
deps/protobuf/kokoro/release/python/macos/continuous.cfg
vendored
Normal file
8
deps/protobuf/kokoro/release/python/macos/continuous.cfg
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
deps/protobuf/kokoro/release/python/macos/presubmit.cfg
vendored
Normal file
8
deps/protobuf/kokoro/release/python/macos/presubmit.cfg
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
deps/protobuf/kokoro/release/python/macos/release.cfg
vendored
Normal file
8
deps/protobuf/kokoro/release/python/macos/release.cfg
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user