Can I compile ios project by using bazel on Windows/linux machine?

90 views Asked by At

Is it possible to use Bazel or Buck to compile an iOS project in CI/CD on Windows/Linux machines? We want to avoid using a Mac machine in CI/CD due to its significantly higher cost compared to other machines. So, my question is: Can we compile and build iOS projects using alternative build systems like Bazel or Buck instead of relying on Xcode? And, if possible, does it work with Windows/Linux machines?

According to this medium page, Bazel is independent and does not rely on any other build system. It is even showcased as an alternative to Xcode for iOS development. Has anyone already tried this?

I have discovered that Bazel is capable of compiling iOS builds and it now offers support for Apple Silicon M1 with version 5.0.0. However, I haven't found clear information on whether I need to perform the build on a Mac machine.

2

There are 2 answers

0
Pavan Singh On

I was going through the Bazel Tutorial for Build an iOS App and it says bazel required Xcode and other macOS-specific tools and frameworks to build iOS applications. Therefore, to compile an iOS project, you would need to use a macOS machine running Xcode.

0
Naveen M On

No, t is not possible to compile iOS projects using Bazel on a Windows or Linux machine. Bazel, an open-source build system developed by Google, primarily targets the compilation of software projects on Linux and macOS. While Bazel does support building iOS projects, it requires macOS as the host operating system.

To compile iOS projects using Bazel, you need a machine running macOS because the build process relies on Xcode and the iOS SDK, which are only available on macOS. Xcode provides the necessary tools and compilers for iOS development, and without them, Bazel cannot properly build iOS projects.