mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
To facilitate early development and testing of the new language runtime we're introducing a temporary mechanism to opt in to using the new codepaths based on an environment variable. This environment variable is effective only for experiment-enabled builds of OpenTofu, and so it will be completely ignored by official releases of OpenTofu. This commit just deals with the "wiring" of this new mechanism, without actually connecting it with the new language runtime yet. The goal here is to disturb existing codepaths as little as possible to minimize both the risk of making this change and the burden this causes for ongoing maintenance unrelated to work on the new language runtime. This strategy of switching at the local backend layer means that we will have some duplicated logic in the experimental functions compared to the non-experimental functions, which is an intentional tradeoff to allow us to isolate what we're doing so we don't churn existing code while we're still in this early exploration phase. In a later phase of the language runtime project we may pivot to a different approach which switches at a deeper point in the call stack, but for now we're keeping this broad to give us flexibility. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>