News

Nix-Ninja Brings Incremental Compilation to Nix Using Dynamic Derivations
The open-source Nix ecosystem is witnessing an exciting development with nix-ninja, a tool that promises to revolutionize compilation workflows by leveraging Nix's experimental dynamic derivations feature. This innovation has sparked significant interest in the developer community, particularly among those working with complex build systems.Dynamic Derivations: The Path to Stable ReleaseOne of the most discussed aspects in the community is the timeline for stabilizing dynamic derivations in Nix. Currently, nix-ninja depends on experimental features from an unreleased version of Nix, which raises questions about when these features might become officially supported.A core Nix developer involved with dynamic derivations has provided some clarity on the roadmap, explaining that dynamic derivations depend on content-addressing derivations, which has been in experimental-feature limbo for some time. However, with focused effort and scope management, stabilization could be achievable in the near future. The developer characterized the remaining work as not actually a huge amount despite being a series of yak shaves - a term referring to a chain of seemingly unrelated tasks that must be completed before addressing the main goal.Performance Potential for Complex BuildsThe performance implications of nix-ninja are particularly promising. The tool aims to enable truly incremental compilation, where changing a single C/C++ file anywhere in a build graph would require recompiling only that file and relinking just the affected executables or shared libraries.While still in development, early testing shows that Nix's sandboxing overhead is negligible for incremental compilation tasks. However, some features are still missing, such as proper handling of targets that depend on generated source files (like Nix's bison parser), which is currently being tracked as an open issue.A long term end goal is that if you don't change headers and only change is single C/C++, anywhere in the build graph for your entire system you should get a quick recompile of just that file + relink just the executables/shared libraries the output object file is built in.Key Features of nix-ninjaParses ninja.build files and generates a derivation per compilation unitStores build inputs & outputs in content-addressed derivations for granular incrementalityCompatible CLI for ninja (can be used as a drop-in replacement)Supports running locally or inside a Nix derivationRequirementsNix with experimental features enabled:nix-commanddynamic-derivationsca-derivationsrecursive-nixDevelopment Milestones0.1.0: First release focusing on correctness0.2.0: Major performance features to make incremental builds productiveStrategic Focus on Ninja Build FilesThe developers chose to target Ninja build files specifically, which has proven to be a strategic decision. By supporting Ninja as the build graph representation, nix-ninja can work with numerous popular build systems like CMake, meson, premake, and gn that output Ninja files.This approach is particularly relevant for the Nix community since Nix itself uses meson and outputs Ninja files. The choice allows for an incremental, crowd-sourceable approach to improving build performance across the ecosystem, starting with large projects like LLVM and Chromium that would benefit most from incremental compilation.As nix-ninja continues to develop toward its 0.1.0 milestone focused on correctness and the subsequent 0.2.0 release targeting performance features, the project represents a promising step toward making Nix builds more efficient without requiring massive rewrites of existing build systems. For developers working with complex codebases, this tool could significantly improve productivity by reducing compilation times and providing more granular incrementality through Nix's content-addressed derivations.Reference: nix-ninja
3 hours ago
InitWare Emerges as Portable, Modular Alternative to systemd
Startups
3 hours ago

Bill Gates Celebrates Microsoft's 50th Anniversary by Releasing Original BASIC Source Code
Microsoft
3 hours ago

ChatGPT Revenue Soars to $415 Million Monthly as Subscribers Flock to Premium Features
4 hours ago

Apple Turns 49: How Its Innovation Extends to iPhone Battery Management
Apple
5 hours ago

Anthropic Launches Claude for Education to Transform AI's Role in Higher Learning
AI
5 hours ago

Google Pixel 10 Pro Fold Rumors: Same Design, Lower Price, But Camera Concerns Remain
Phone
6 hours ago

Samsung Galaxy Ring 2 May Feature Revolutionary Solid-State Battery Technology in 2025
Wearable devices
9 hours ago

Google Strengthens Chrome Security with New HTTPS Requirements and Brings Desktop-Style Extensions to Android
Security
10 hours ago

Samsung Galaxy M56 Spotted with Exynos 1480: Potential Downgrade from M55?
Phone
12 hours ago

Mithril.js: The Lightweight Framework That Stands the Test of Time
14 hours ago

Python's Textcase Library Solves Case Conversion Challenges with Zero Dependencies
14 hours ago

Headscale Gains Traction Among Self-Hosters Despite Security Concerns
Security
15 hours ago

Age LAN Server Preserves Multiplayer Functionality for Age of Empires Definitive Editions
Computer Game
15 hours ago

Printer Tracking Dots: Hidden Surveillance in Your Color Printouts and How to Counter It
Security
21 hours ago

Google NotebookLM Gets Web Source Discovery Feature, But Users Still Want More
AI
Yesterday

Google's Find My Device UWB Precision Tracking Update Nears Completion
Apps
Yesterday

Meta's Hypernova Smart Glasses Coming This Year with Built-in Display, Priced Over $1,000
Wearable devices
Yesterday

Sony Unveils 2025 Bravia TV Lineup: New QD-OLED Flagship Promises 50% Brightness Boost
Yesterday

RTX 5080 Becomes First Nvidia 50-Series GPU to Appear in Steam Hardware Survey
GPU
Yesterday
