Search code examples
bazelbazel-rules

What's the difference between http_file and http_archive Bazel rules?


I've been working with several bazel rules recently, but I would like to know whether http_file and http_archive can be used interchangeably or if they complement each other as for example native.local_repository, native.new_local_repository, and new_local_repository are complementary.


Solution

  • http_archive expects an archive and extracts it, whereas http_file does not perform an "extract" operation. Furthermore, http_file creates a file group, and http_archive "embeds" an external workspace. That are two completely different things.