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

rctx.download custom headers coming to Bazel 7.1

Blog post from Aspect Build

Post Details
Company
Date Published
Author
Şahin Yort
Word Count
886
Language
English
Hacker News Points
-
Summary

Bazel, an open-source build and test tool, is primarily used for fetching files from the internet, often employing the repository_ctx#download API. While Bazel's downloader is efficient due to its caching capabilities, certain scenarios, such as fetching Docker container images or Alpine packages, require the ability to set specific HTTP headers, which Bazel initially couldn't handle, leading to workarounds like reverting to curl. This limitation was addressed through community collaboration, resulting in an update that allows setting arbitrary HTTP headers, enhancing Bazel's functionality for tasks such as managing Docker manifests and handling Alpine packages. This new feature not only resolves previous issues but also opens up possibilities for more advanced download strategies, such as parallel downloading of large archives to improve efficiency.