How are people handling environment variables for tools that may have different paths on different machines?
Is it just defining the variable like PYTHONPATH: {"linux": ["foo", "bar", "baz"]}?
Would this need to have every possible configuration listed for how people may have tools installed on their machines? I know you can define roots, but this feels like it’s bigger than that. We have all our software installed centrally, but people not working on our network do not have access to the tools and they may not be installed in the same place with the same structure (if that makes sense). We’re thinking of using ayon for vendors and off-site artists, and I don’t really want to be keeping a list of all possible combinations of environment variables. Would be good is these could be defined in a place like the Roots tab, on a per-machine basis.
Hello,
In short yes, you can use it as you mentioned whenever defining environment variables in settings. here’s an additional example
"standard": {
"windows": ["win-path-1", "win-path-2"],
"darwin": "mac-path",
"linux": "linux-path"
}
In AYON we are using Acre to handle environment variables resolution.
check the this question on help center to find more examples.
Additionally, you can define global env for your studios in core addon settings ayon+settings://core/environments and use them in env vars.
and use it like this in your tool
"standard": "{STUDIO_CONFIGS}/my-path"
Another approach that allows full flexibility would be to create a custom prelaunch hook which would just tack on whatever you’d like to self.launch_context.env but it’d require you to take control.
For roots there’s also per-site overrides which I believe should apply before trying to use such a root in the app envs, so you could have a pipeline tools root perhaps and see if you can get by with using that as part of the other path values.
thanks for the replies. I just know that because we have everything installed centrally and inconsistently (I’m not in charge of installs), it’s probably going to affect all the tools we list in the applications addon.
Would love to hear how you’d like to tackle your case from a management perspective instead.
