Skip to content

BazelCon 2019 Day 2: Make local development (with Bazel) great again!

Itai

Blue TeamThe Linux Foundation42 minOpen on YouTube ↗

Evaluates bazelCon 2019 Day 2: Make local development (with Bazel) great again and evaluates key implications for security practitioners.

Summary

### Overview At BazelCon 2019, Itai, a backend engineering manager at Wix, addressed the severe developer friction encountered when transitioning to Bazel for local development. While Bazel provided substantial value and speed improvements on CI, Wix developers experienced major regressions in their local workflows—spending significant time manually managing fine-grained build files, resolving missing dependencies, and waiting on IDE syncs. Wix set out to restore a fluent local development experience in IntelliJ IDEA by designing custom developer tooling to automate dependency management, background synchronization, target creation, and build file hygiene.

### Key Topics - **The Local Developer Pain**: Wix migrated from Maven to Bazel across approximately 300 backend developers, 1,300 microservices, and fine-grained targets (averaging 10–15 Bazel packages per previous Maven module), primarily in Scala and Java. While CI builds excelled, developers frequently complained about broken refactoring workflows and hours lost editing BUILD files. - **Synchronization Latency**: In the Bazel IntelliJ plugin, adding external dependencies, creating new tests, or renaming files traditionally required full or incremental syncs. This blocked developers as Bazel built target metadata and IntelliJ re-indexed source roots. - **Automating Dependency Resolution**: Developers struggled to determine exact Bazel labels for imported classes, especially with non-standard directory layouts, package cycles, and fine-grained sub-targets. - **Refactoring & Package Generation**: Moving classes broke target boundaries, requiring manual label adjustments. Creating new packages or test suites also forced developers to write boilerplate target definitions manually. - **Build File Hygiene**: Enforcing strict and unused dependencies is critical to prevent slow builds and remote cache thrashing, but interrupting engineers with compilation errors while they code damages developer velocity.

### Technical Details - **Autosync**: Building on prior work by IntelliJ Bazel plugin lead Brendan, Wix introduced Autosync for Java and Scala. Instead of forcing manual incremental syncs, Autosync detects file additions or renames and triggers non-blocking partial syncs in the background scoped solely to the affected target. - **DepFixer**: A CLI and IntelliJ-integrated tool inspired by Twitter Pants workflows. When compilation fails, DepFixer scrapes compiler errors for fully qualified class names (FQNs), queries local disk/Git-based indexes and a global indexing service, maps FQNs to Bazel labels, updates the BUILD file, and retries the build iteratively. - **Autodep**: An IntelliJ listener that operates in real time as code is typed. When an import statement is added, Autodep immediately queries the index and inserts the appropriate dependency directly into the BUILD file before the developer even runs tests, avoiding DepFixer wait times. - **Smart Autocomplete & LabelDEX**: A global indexing architecture backed by a Build Event Service (BES) and Kafka. Following builds, the service inspects targets and outputs, downloads generated JARs, parses bytecode, and indexes FQNs mapped to Bazel labels into Elasticsearch. This powers IDE autocomplete popups and token-based searches across the entire codebase. - **Semantic Templates & Refactoring Integration**: Custom IDE actions create standardized Bazel test targets and packages (handling globs and `testonly` flags) using semantic templates, hooking directly into shortcut actions like IntelliJ's `Create New Test`.

### Takeaways Local developer experience cannot be sacrificed for CI build performance. By shifting dependency discovery and BUILD file synchronization to automatic, background-driven IDE tooling, Wix significantly reduced developer cognitive overhead. Wix committed to open-sourcing major components of this ecosystem (including DepFixer, Autodep, and LabelDEX) and called for community collaboration to standardize ergonomic local development across the Bazel ecosystem.

Related talks