Hi folks.
I have this piece of software that I'd like to use in a bazel build rule, which I think may be far too complex to try and make a hermetic version of. That option is not off the table yet, but at least in principle what I'd want to attempt instead seems like it may be faster to do.
To avoid having to figure out how to have bazel pull it in as an external repository. It's a Python program that pulls in a gigabyte of dependencies, and a clean installation on any given system is a headache as is. I thought, I might avoid repeated installation pains if I managed to package it in a container, then have a build rule executing the said program inside an appropriately configured container.
I tried to do the above, and got to a point where I can invoke the build rule; but the build rule fails to run because all the files that Bazel makes available to it are symlinks to paths which are not mounted inside of the container. I didn't see an easy way for me to know what paths these would be ahead of time so that possibly I could mount them into the container as it starts.
This left me puzzled a bit, and at this point I figured better ask: is this even a viable option? If not, what alternatives do I have?
I am aware that it is possible to run bazel completely inside a container. Though, the utility of that approach is under question since all bazel-* symlinks are invalid once container exits, which could be a drag on productivity.
I am also aware that it is possible to have bazel run docker sandboxes. Which, I suppose, could allow me to extend the docker image to contain my binaries and then invoke my program non-hermetically inside a container. IIUC my use case is not the intended use case, but might just work.
Advice? Anything I missed?
Thanks,
F