Hi,
I'm having trouble with Rez (for a client) and I will put my hand up and say I don't understand enough about the innards to know what's going on so though I'd ask here for some advice.
OK, so basically my client uses Rez to run helper scripts from Houdini. It looks like it's an old version of Rez as the command rez-run is used and I believe that has been retired in favour of using the rez-env --cmd instead.
The short version is that we have a python plugin for Houdini (which includes bindings into a C shared library) that when used will fork the running process (Houdini) via our shared library so to start up our own separate child process - ie, it spawns a new process on the users machine that Houdini will communicate with through our python plugin.
Rez works just fine until our software is involved - or more specifically before we fork the Houdini process, the rez-run commands work just fine, but afterwards it fails to run.
The Rez-run command is startup up in Houdini via some python as follows:
import subprocess
rez_cmd = "rez-run openimageio -- maketx --oiio /usr/home/simon/text.exr -o /usr/home/simon/test.tx"
print "RESULT:", subprocess.check_output(rez_cmd, shell=True)
print "FILE:", subprocess.check_output("ls -l /usr/home/simon/text.tx", shell=True)
Before our plugin performs the fork is will correctly output the following:
RESULT:
FILE: -rw-rw-r-- 1 simon user 7553363 Mar 28 09:57 /usr/home/simon/test.tx
But if we run this same script after our plugin performs the fork, we get the following error (ensuring the generated test.tx file has been deleted):
Warning: Did not close where command correctly.
Warning: Did not close where command correctly.
RESULT: openimageio
_REZ_ENV_OPT_STDIN='True'
_REZ_ENV_OPT_NO_LOCAL='False'
_REZ_ENV_OPT_NO_OS='False'
_REZ_ENV_OPT_PROMPT='>'
_REZ_ENV_OPT_NO_CACHE='False'
_REZ_ENV_OPT_TIME='0'
_REZ_ENV_OPT_ADD_STRICT='False'
_REZ_ENV_OPT_CMD=''
_REZ_ENV_OPT_QUIET='False'
_REZ_ENV_OPT_IGNORE_BLACKLIST='False'
_REZ_ENV_OPT_RCFILE=''
_REZ_ENV_OPT_IGNORE_ARCHIVING='False'
_REZ_ENV_OPT_MODE='latest'
_REZ_ENV_OPT_PROP_RCFILE='False'
_REZ_ENV_OPT_VIEW_FAIL='-1'
_REZ_ENV_OPT_NO_ASSUME_DT='False'
_REZ_ENV_OPT_ADD_LOOSE='False'
_REZ_ENV_OPT_TMPDIR=''
_REZ_ENV_OPT_BUILD='False'
ls: cannot access /usr/home/simon/test.tx: No such file or directory
FILE:
Does anyone have any ideas as to why rez-run would fail in such a way and what the error might be telling me?
The "did not close where command correctly" looks like the start of the issue, and I assume the _REZ_ENV stuff is more of a dump of the state of the system.
Now I am making one massive assumption here in that the fork that we are doing is directly related to the problem, but otherwise we are just running regular python code inside a Houdini OTL.
Any help, pointers, suggestions etc would be greatly appreciated here as I'm at a bit of a loss as to how to help trouble-shoot this.
If I was to test running this via the Rez-Cmd --cmd call, how would I construct that?
Best Regards,
Simon C. Smith.
Co-Founder Lightmap LTD.