Hi all! Thanks for making the pants so snazzy! We'...
# general
b
Hi all! Thanks for making the pants so snazzy! We're doing some mildly cross-platform development, and have run into the following issue when working with terraform: On Linux we run
pants generate-lockfiles ::
, which generates the HCL locks.
pants check ::
passes, which includes a Terraform validation stage. Pushing this code to macOS, we start seeing lockfile mismatch errors when running
pants check
. The errors are fixed by additionally generating lockfiles on the macOS machine, which adds a single line that runs out to be the macOS-specific hash to the Terraform lockfiles. This appears to be the issue described here, and seems like it can be solved by passing all applicable platforms to Terraform's lock call. Is there a way in the pants config to pass multiple platform args into
generate-lockfiles
?
c
I'm pretty sure there isn't. There are some escape hatches for threading args or envvars in, which you might be able to use, but those seem like more trouble than just running terraform yourself. This should be straightforward to add, though.
❤️ 1
Can you tell me more about how your team uses the terraform backend? Would having one global parameter for the terraform "platforms" work for your usecase?
b
It would, the prod platforms are all Linux-based. This is purely an artifact of using pants across Linux and macOS dev machines.
👍 1