Closed jpeach closed 3 years ago
This one's a bit weird, but it's surprisingly hard to get Bazel to pass environment variables through to the build sandbox.
The Go modules changes are mainly due to me running go mod tidy
after pulling in the homedir module.
Nice, thanks! I had pondered trying to use llamacc
inside of a bazel build, but never actually tried it. I would be super curious to hear if you get it working. It definitely feels a bit at odds with what bazel wants you to be doing, but hey, if it works :)
On May 30, 2021, at 2:19 PM, Nelson Elhage @.***> wrote:
Nice, thanks! I had pondered trying to use llamacc inside of a bazel build, but never actually tried it. I would be super curious to hear if you get it working.
I’m still poking at a few things (building envoy), so probably a few more small patches coming. It definitely feels a bit at odds with what bazel wants you to be doing, but hey, if it works :)
I don’t know if I’ll ever get access to a reasonable bazel remote build service, but I do have AWS :)
In a Bazel build environment, $HOME is not set by default and it can be hard to get Basel to set it in all circumstances. To avoid the need for a wrapper script, break the dependency on $HOME by using the go-homedir package, which will file the home directory correctly even when $HOME isn't set.
The AWS session setup also depends on $HOME, but we can work around that by presetting the environment variables to the default shared configuration paths.