I have an issue and I'm curious if any of you have any solutions. I've set some environment variables via a package located in a custom directory set via HOUDINI_PACAGE_DIR. When I run Houdini the variable load find and there are no issues. However, for purposes of publishing on a pipeline, I am using subprocess within a python script to copy, open, and execute some rops within a hip files. The strange thing is, the values of the env vars I've set within that package are doubled or a copy of that values is appended. MYENV1 would normally have a values of "C:/Users/me/some/path". When accessed from within a Houdini hip file opened via subprocess it has a value of "C:/Users/me/some/path;C:/Users/me/some/path". Additionally, this behavior does not happen if I set the environment variables via houdini.env.
I'm not sure how to prevent this from happening. Any thoughts?
It theoretically makes sense, if you are spawning a subprocess in an environment that already has that variable, packages prepend paths by default so you may end up with duplicate path
Maybe try using "method" : "replace"
Or there is also "load_package_once" : true Which I don't know if would work for nested calls but worth a try
Thanks for the link tamte. I've been using the info on that page for all along. I'm beginning to wonder if this is a bug. If I remove the houdini_os expression I no longer get a duplication of my env var values. Either this is a bug or I'm still not getting the syntax correct in my package.
Try setting HOUDINI_PACKAGE_SKIP=1 before launching your process, this will disable the package processing and will prevent the subprocess to duplicate the env vars.