Xar rules for Bazel

A few years ago Meta opensourced xar, I think it’s a cool piece of software.

Recently I had the need to integrate it with bazel so that I could produce versions of stacky packaged as a xar archive.

I haven’t found anything to do it already so I wrote my own rules for bazel to use xar: rules_xar. It’s currently limited but it does the job.

To produce xar binary you just need to do the following:

  name = "mybinary.xar",
  main = ":binary_py"

This is assuming that you already have a py_binary target that already produce a python binary.

If you find it useful don’t hesitate to tell me or buy me some coffee.