Open jazzdan opened 4 years ago
I think it's pretty clear allowing load() in an if
block was a bug in Starlark-Go.
Starlark-Java doesn't allow this, and in fact, can't allow this, because it would break the ability to determine what files are loaded at parse-time (i.e., without executing the code)
We probably have to move forward with https://github.com/tilt-dev/tilt/issues/3433 to resolve this, and recommend include() as the execution-time way to load code
@jazzdan do you have a sense of how urgent this is? a short-term fix is to fork starlark-go, rollback the fix for now, and then have a plan to move forward with a workaround
@nicks I don't have a sense yet, no. Following up with the user.
@nicks it's not blocking, they can work around it.
Via k8s slack DM:
I traced it to this issue and resulting commit from Starlark where they recently disallowed
load
s inside if statements and for statements.There's at least one Tiltfile out there that depends on this behavior, and probably more. In fact our own Tiltfiles used to depend on this behavior when we had our internal services in microrepos with one Tilt repo to manage them. The Tiltfile would check to see which microrepos are cloned locally, and only if it was present in the expected location on disk would it then load that microrepo's Tiltfile. In fact: we still recommend this setup. We've since moved to a monorepo, but if any customers are using a similar set up their Tiltfiles would now be broken.