Home / Companies / Aspect Build / Blog / Post Details
Content Deep Dive

Device management: tools on your developers PATH

Blog post from Aspect Build

Post Details
Company
Date Published
Author
Alex Eagle
Word Count
876
Language
English
Hacker News Points
-
Summary

The text discusses the challenges and solutions involved in distributing a "canonical developer environment" on work computers, specifically through the use of Bazel and direnv. Initially, the author explored using Bazel to install tools locally, but this required developers to adjust their usual command inputs, which proved difficult. An alternative solution, created by Fabian Meumertzheim, involves using the bazel_env.bzl tool to place tools directly on the system PATH, thus improving usability. This method, however, requires developers to manually install and configure direnv, a command-line tool that manages environment variables when navigating directories. The process includes creating a .envrc file in the project directory to export variables or run setup scripts automatically. While this approach addresses some ergonomic issues, it introduces trade-offs, such as the need for manual setup and the requirement that all tools be downloaded, regardless of use. This updated method is now a recommended pattern for new Bazel repositories, though it requires developers to be mindful of potential issues, such as cleaning the Bazel output folders, which direnv can help manage with error reporting.