Request for help - issues with Rez and Houdini scripts

155 views
Skip to first unread message

simon smith

unread,
Mar 28, 2019, 4:22:44 PM3/28/19
to rez-config
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.

Allan Johns

unread,
Apr 18, 2019, 11:29:25 PM4/18/19
to rez-c...@googlegroups.com
Hi Simon,

Have you gotten anywhere with this? Unfortunately it would be very difficult for me to help given how old the rez version here is - I think this is a 1.x version, and 2.x is an almost total rewrite.

The output you're getting from the rez-run call is indeed odd. There may be some form of non-fork-friendly issue going on with the rez-run command, however I couldn't tell you what that might be.

I would start simplifying the repro where possible - for example, running /bin/true rather than maketx, seeing if you still get that odd output, and going from there.

In rez-2, the command is the same, except you run 'rez-env' rather than 'rez-run'.

Thx
A




--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/rez-config.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages