Telegram IOS app unable to build with XCode 12.4

Viewed 451

I am trying to build the latest Telegram IOS app for my Simulator but I am getting a python error.I have followed all the steps mentioned below and have installed Bazel and yasm https://github.com/TelegramMessenger/Telegram-iOS

I have tried it with Telegram 7.6 and 7.8 and behaviour is same. Can someone please help?

bazel --version
bazel 4.1.0-homebrew

yasm --version
yasm 1.3.0

When i try to generate the XCode project,

python3 build-system/Make/Make.py \
    --bazel="$HOME/bazel-dist/bazel" \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration" \
    --disableExtensions \
    --disableProvisioningProfiles

I am seeing this error

Traceback (most recent call last):
  File "build-system/Make/Make.py", line 560, in <module>
    generate_project(arguments=args)
  File "build-system/Make/Make.py", line 339, in generate_project
    bazel_command_line = BazelCommandLine(
  File "build-system/Make/Make.py", line 16, in __init__
    self.build_environment = BuildEnvironment(
  File "/Users/srcomp1/Downloads/Telegram-iOS-release-7.6/build-system/Make/BuildEnvironment.py", line 123, in __init__
    actual_bazel_version = get_bazel_version(self.bazel_path)
  File "/Users/srcomp1/Downloads/Telegram-iOS-release-7.6/build-system/Make/BuildEnvironment.py", line 66, in get_bazel_version
    command_result = run_executable_with_output(bazel_path, ['--version']).strip('\n')
  File "/Users/srcomp1/Downloads/Telegram-iOS-release-7.6/build-system/Make/BuildEnvironment.py", line 36, in run_executable_with_output
    process = subprocess.Popen(
  File "/Users/srcomp1/Downloads/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/srcomp1/Downloads/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/Users/srcomp1/bazel-dist/bazel'
1 Answers

The issue was because system wasn't able to link the Bazel downloaded to build the submodules.The bazel downloaded as per ReadMe instructions didn't work with my python version in XCode.

Reinstalling the bazel from this link below helped

https://docs.bazel.build/versions/4.1.0/install-os-x.html

Related