<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bharat Dev Burman]]></title><description><![CDATA[Bharat Dev Burman]]></description><link>https://blog.crazo7924.is-a.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 21:18:24 GMT</lastBuildDate><atom:link href="https://blog.crazo7924.is-a.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Revolutionizing the Android Build: An In-Depth Look at the Soong Build System]]></title><description><![CDATA[The Android Open Source Project (AOSP) is a massive undertaking, comprising millions of lines of code across various languages. Building such a complex system efficiently and reliably is a monumental task. For years, the Android build relied heavily ...]]></description><link>https://blog.crazo7924.is-a.dev/revolutionizing-the-android-build-an-in-depth-look-at-the-soong-build-system</link><guid isPermaLink="true">https://blog.crazo7924.is-a.dev/revolutionizing-the-android-build-an-in-depth-look-at-the-soong-build-system</guid><category><![CDATA[Android]]></category><category><![CDATA[aosp]]></category><category><![CDATA[buildsystem]]></category><category><![CDATA[Build tool]]></category><category><![CDATA[review]]></category><dc:creator><![CDATA[Bharat Dev Burman]]></dc:creator><pubDate>Thu, 05 Jun 2025 06:32:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/8Gg2Ne_uTcM/upload/1a1ddec675991af7a84a5460de3b9c80.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Android Open Source Project (AOSP) is a massive undertaking, comprising millions of lines of code across various languages. Building such a complex system efficiently and reliably is a monumental task. For years, the Android build relied heavily on GNU Make, but with the increasing complexity and scale of the platform, a more modern, robust, and performant solution was needed. This led to the introduction of the Android Soong build system, a significant leap forward in how Android is compiled.</p>
<h2 id="heading-from-make-to-soong-the-evolution-of-android-builds">From Make to Soong: The Evolution of Android Builds</h2>
<p>Prior to Android 7.0 (Nougat), the build process was primarily orchestrated by Android.mk files, which leveraged GNU Make. While Make was a staple for many years, its limitations became apparent as Android grew. Makefiles can become intricate and difficult to maintain, especially with conditional logic and complex dependencies. Incremental builds, crucial for developer productivity, were often unreliable, frequently necessitating a full rebuild to ensure correctness.</p>
<p>Soong was introduced to address these challenges, aiming to provide a faster, more declarative, and maintainable build experience. It doesn't entirely replace all existing tools but rather integrates with them to create a streamlined workflow. At its core, Soong leverages the Kati GNU Make clone tool (for legacy Android.mk files during the transition) and the highly efficient Ninja build system as its backend.</p>
<h2 id="heading-the-heart-of-soong-androidbp-files">The Heart of Soong: Android.bp Files</h2>
<p>The most visible change with Soong is the shift from Android.mk files to Android.bp files. These Android.bp files are declarative descriptions of "modules" to be built, similar in syntax and semantics to Bazel BUILD files. This declarative nature is a key advantage, making build configurations more readable and less prone to errors compared to the imperative style of Makefiles.</p>
<p>Here's what defines an Android.bp file:</p>
<ul>
<li><p>Modules: The basic unit of building in Soong is a module. Each module starts with a module type (e.g., cc_binary, java_library, android_app) followed by a set of properties in a name: value format. Every module must have a unique name property.</p>
</li>
<li><p>Declarative Syntax: Android.bp files focus on what needs to be built and its dependencies, rather than how it should be built. The build logic itself is implemented in Go within Soong's internal components.</p>
</li>
<li><p>No Explicit If-Statements (mostly): Unlike Android.mk files that allowed complex conditional logic using ifeq, Android.bp files primarily rely on pre-defined distinctions like processor architecture or debug/release builds. Custom case distinctions are handled by the Go-based Soong modules themselves, promoting a cleaner and more structured build graph.</p>
</li>
</ul>
<ul>
<li><p>Globs and Variables: Android.bp supports glob patterns for file lists (e.g., src/**/*.java) and allows for top-level variable assignments, enhancing flexibility and reducing redundancy.</p>
</li>
<li><p>Comments: Both C-style /* */ and C++ style // comments are supported for better readability.</p>
</li>
</ul>
<h2 id="heading-how-soong-works-under-the-hood">How Soong Works Under the Hood</h2>
<p>The Soong build system operates in a multi-stage process:</p>
<ul>
<li><p>Parsing Android.bp Files: Soong parses all Android.bp files across the AOSP tree. This involves reading the declarative module definitions and their properties.</p>
</li>
<li><p>Generating Ninja Build Files: Based on the parsed Android.bp files and the internal build logic (written in Go), Soong generates a highly optimized build.ninja file. Ninja is designed for speed and efficiency, particularly for incremental builds, by creating a precise dependency graph and executing build commands in parallel.</p>
</li>
<li><p>Kati for Legacy Android.mk: During the transition period, Kati acts as an intermediary, processing Android.mk files and generating additional .ninja files that integrate with the overall Ninja build graph. This allows for a gradual migration without requiring a complete rewrite of the entire AOSP at once.</p>
</li>
<li><p>Ninja Execution: Finally, the Ninja build system takes the generated .ninja files and executes the actual build commands, compiling source code, linking libraries, and creating the final Android images and artifacts.</p>
</li>
<li><p>soong_ui as the Orchestrator: The soong_ui script acts as the primary driver for the entire build process, orchestrating the different stages and managing auxiliary tools.</p>
</li>
</ul>
<h2 id="heading-advantages-of-the-soong-build-system">Advantages of the Soong Build System</h2>
<p>The shift to Soong brings several significant advantages to Android platform development:</p>
<ul>
<li><p>Improved Build Performance: By leveraging Ninja, Soong significantly speeds up build times, especially for incremental builds. This is crucial for developers who frequently make small changes and need quick feedback.</p>
</li>
<li><p>Enhanced Reliability of Incremental Builds: Soong's precise dependency tracking and Ninja's efficient execution minimize the need for full rebuilds, making incremental builds more reliable and consistent.</p>
</li>
<li><p>Declarative and Readable Configuration: Android.bp files offer a cleaner, more understandable syntax compared to complex Makefiles, reducing the learning curve for new developers and improving maintainability.</p>
</li>
<li><p>Stronger Type Checking: Soong's Go-based implementation allows for stronger type checking of variables and properties, catching errors earlier in the development cycle.</p>
</li>
<li><p>Better Scalability: The modular and declarative nature of Soong, combined with Ninja's parallelism, makes the build system more scalable to the ever-growing size and complexity of Android.</p>
</li>
<li><p>Pathway to Bazel: The Android.bp file format is intentionally similar to Bazel's BUILD files, indicating a potential future direction for the Android build system to fully embrace Bazel, a highly scalable and reliable build system used by Google.</p>
</li>
</ul>
<h2 id="heading-challenges-and-the-road-ahead">Challenges and the Road Ahead</h2>
<p>While Soong offers substantial improvements, the transition from Make has not been without its challenges. The migration of a massive codebase from one build system to another is a complex undertaking. Developers have had to adapt to the new Android.bp syntax and understand the underlying principles of Soong.</p>
<p>Furthermore, dependencies between legacy Android.mk modules and new Android.bp modules can sometimes be intricate. While Android.mk modules can depend on Android.bp modules, the reverse is not always straightforward.</p>
<p>Looking ahead, Google is actively exploring the integration of Bazel as the ultimate build system for AOSP. Soong serves as a crucial stepping stone in this evolution, providing a modern foundation that is more compatible with a Bazel-like philosophy.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The Android Soong build system represents a pivotal advancement in Android platform development. By moving away from the limitations of Make and embracing a more declarative, performant, and scalable approach with Android.bp files and Ninja, Soong has significantly improved the efficiency and reliability of building the world's most popular mobile operating system. As Android continues to grow and evolve, Soong lays the groundwork for even more sophisticated build capabilities, ultimately contributing to a faster and more seamless development experience for the entire Android ecosystem.</p>
]]></content:encoded></item><item><title><![CDATA[Try this instead of pip for your python projects]]></title><description><![CDATA[I discovered this shiny new tool called uv while trying to have my python dependencies managed better just like yarn for node projects.
It is not just fast but blazing fast.
This tool made me work much faster and spent less time staring at the screen...]]></description><link>https://blog.crazo7924.is-a.dev/try-this-instead-of-pip-for-your-python-projects</link><guid isPermaLink="true">https://blog.crazo7924.is-a.dev/try-this-instead-of-pip-for-your-python-projects</guid><category><![CDATA[Python]]></category><category><![CDATA[UV ]]></category><category><![CDATA[dependency management]]></category><dc:creator><![CDATA[Bharat Dev Burman]]></dc:creator><pubDate>Thu, 06 Mar 2025 17:11:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Nl-GCtizDHg/upload/9c4c9dde37f0d630ae07666eb03ee99a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I discovered this shiny new tool called <code>uv</code> while trying to have my python dependencies managed better just like <code>yarn</code> for node projects.</p>
<p>It is not just fast but <em>blazing</em> fast.</p>
<p>This tool made me work much faster and spent less time staring at the screen.</p>
<p><a target="_blank" href="https://x.com/charliermarsh/status/1758216803275149389">Checkout the post on X</a></p>
]]></content:encoded></item><item><title><![CDATA[My Journey with Android]]></title><description><![CDATA[My journey began with getting my first smartphone back in 2015. It was a Xiaomi Redmi 2 and had its bootloader already unlocked. This was very enticing as it opened some doors for me to experiment with that device.
Then I found XDA developers – a for...]]></description><link>https://blog.crazo7924.is-a.dev/my-journey-with-android</link><guid isPermaLink="true">https://blog.crazo7924.is-a.dev/my-journey-with-android</guid><category><![CDATA[journey]]></category><category><![CDATA[Android]]></category><category><![CDATA[aosp]]></category><category><![CDATA[learning]]></category><dc:creator><![CDATA[Bharat Dev Burman]]></dc:creator><pubDate>Fri, 11 Oct 2024 10:33:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/R5S4OQpG0lE/upload/c60f5eeb3badc549e07cf2c6acf68b08.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>My journey began with getting my first smartphone back in 2015. It was a Xiaomi Redmi 2 and had its bootloader already unlocked. This was very enticing as it opened some doors for me to experiment with that device.</p>
<p>Then I found <a target="_blank" href="https://xdaforums.com/">XDA developers</a> – a forum dedicated to share and collaborate aftermarket operating system development based on AOSP. I quickly learnt that it was the base of all the Android powered smart devices.</p>
<p>After that, I came across the Linux kernel and how Android is based on it. On visiting the <a target="_blank" href="https://source.android.com">AOSP's website</a>, I was mesmerized with the size and complexity of the code base and how the entirety of it is built. I also discovered something called as the Team Win Recovery Project, TWRP for short.</p>
<p>After getting my second smartphone, the Redmi note 4(x), I experimented further and I got addicted. Now this was bad as it took away my free time meddling with my phone. But it didn't stop me and went ahead with my next smartphone: Samsung Galaxy A30.</p>
<p>I wanted to get a headstart on the development so I voided it's warranty and unlocked the bootloader. Samsung is a different league altogether as it they also use to their own chipset (Exynos) and security measures (Knox) which was a hindrance. I nevertheless managed to port LineageOS. I felt great and then I joined a public Telegram group chat dedicated to this device and exchange knowledge. I eventually got fed up of this distraction and swapped my phone with my Moms’ – a Lenovo mobile. She was happy to get an upgrade in performance.</p>
<p>That Lenovo mobile was actually more irritating as it was older than the Galaxy A30 and had a mediatek chipset. I started to understand why Qualcomm Snapdragon is way better. It unfortunately broke and I used an even older Sony Xperia as having a phone became a necessity.</p>
<p>Time for another device – this time a Realme phone. I created and maintained a forum for this device. I also officially maintained the TWRP recovery for this device. The <a target="_blank" href="https://t.me/Realme85G_Narzo305G_Official">chat still exists</a> till date with 700+ odd members. I handed over the responsibility to someone else to focus on college.</p>
<p>All of this might have taken away my precious time on something I do for free but I'm proud of my achievements.</p>
<p>That's what matters – to think about the good stuff and not crib about what one couldn't do.</p>
]]></content:encoded></item><item><title><![CDATA[Make mistakes; It's fine]]></title><description><![CDATA[It's alright to make mistakes. Everyone does. But it's very important to learn from them and change your approach on how you solve problems.
Programmatically, writing Unit Tests is a must. It helps you prevent overlooking certain edge cases and somet...]]></description><link>https://blog.crazo7924.is-a.dev/make-mistakes-its-fine</link><guid isPermaLink="true">https://blog.crazo7924.is-a.dev/make-mistakes-its-fine</guid><category><![CDATA[mistakes]]></category><category><![CDATA[learning]]></category><dc:creator><![CDATA[Bharat Dev Burman]]></dc:creator><pubDate>Fri, 19 Apr 2024 13:50:48 GMT</pubDate><content:encoded><![CDATA[<p>It's alright to make mistakes. Everyone does. But it's very important to learn from them and change your approach on how you solve problems.</p>
<p>Programmatically, writing Unit Tests is a must. It helps you prevent overlooking certain edge cases and sometimes the obvious like nullity.</p>
]]></content:encoded></item><item><title><![CDATA[Hello, World!]]></title><description><![CDATA[Hello, World!
I am, at the time of writing, a student pursuing Masters degree in Computer Science, and an origami artist. This art was the actual reason for getting interested with the field of Mathematics and over the course of time.
I have publishe...]]></description><link>https://blog.crazo7924.is-a.dev/hello-world</link><guid isPermaLink="true">https://blog.crazo7924.is-a.dev/hello-world</guid><category><![CDATA[self-introduction]]></category><category><![CDATA[First Blog]]></category><dc:creator><![CDATA[Bharat Dev Burman]]></dc:creator><pubDate>Mon, 18 Mar 2024 02:31:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/y5_mFlLMwJk/upload/c5851f91b6840a384c25af8016d5d8a0.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello, World!</p>
<p>I am, at the time of writing, a student pursuing Masters degree in Computer Science, and an origami artist. This art was the actual reason for getting interested with the field of Mathematics and over the course of time.</p>
<p>I have published a research paper in the IEEE journal, an amazing feat to achieve when I was just 20 years old.</p>
]]></content:encoded></item></channel></rss>