mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

— update tulsi, apple_support, rules_apple, rules_swift — bump bazel version to 5.0.0 — bump Xcode version to 13.2.1 — automatically download bazel binaries
33 lines
992 B
Python
33 lines
992 B
Python
import os
|
|
import stat
|
|
import sys
|
|
|
|
from BuildEnvironment import is_apple_silicon, resolve_executable, call_executable, BuildEnvironmentVersions
|
|
|
|
def locate_bazel(base_path):
|
|
versions = BuildEnvironmentVersions(base_path=os.getcwd())
|
|
if is_apple_silicon():
|
|
arch = 'darwin-arm64'
|
|
else:
|
|
arch = 'x86_64'
|
|
bazel_name = 'bazel-{version}-{arch}'.format(version=versions.bazel_version, arch=arch)
|
|
bazel_path = '{}/build-input/{}'.format(base_path, bazel_name)
|
|
|
|
if not os.path.isfile(bazel_path):
|
|
call_executable([
|
|
'curl',
|
|
'-L',
|
|
'https://github.com/bazelbuild/bazel/releases/download/{version}/{name}'.format(
|
|
version=versions.bazel_version,
|
|
name=bazel_name
|
|
),
|
|
'--output',
|
|
bazel_path
|
|
])
|
|
|
|
if not os.access(bazel_path, os.X_OK):
|
|
st = os.stat(bazel_path)
|
|
os.chmod(bazel_path, st.st_mode | stat.S_IEXEC)
|
|
|
|
return bazel_path
|