mottosso / bleeding-rez

Rez - Reproducible software environments for Windows, Linux and MacOS
GNU Lesser General Public License v3.0
72 stars 10 forks source link

Proper --c and "--" syntax with rez env #98

Open RafaelVillar opened 3 years ago

RafaelVillar commented 3 years ago

Hello!

Issue:

You can see the command issued after the rez env is stripped of quotation marks and results in an error from the Maya render command. image

Command supplied

rez env SEVEN-0.0.3 maya2018==2018.5.0 --exclude *.beta -- render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender "catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; " -rd M:/hollywood/output M:/hollywood/projects/NINE/render_file.ma

Command executed after rez env

render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; -rd M:/hollywood/output M:/hollywood/projects/NINE/render_file.ma

But if you rez env x y z and issue the command manually, it is done it works. image

This is perhaps more of an inquiry than an issue. But what is the correct syntax for a "complex" command such as this?

There is argument parsing done here but I think it is more a shell/sh/cmd issue, no?

Any advice would be appreciated on how to handle commands of this nature.

Actual production command with sensitive names omitted/replaced rez env NINE-0.0.3 maya2018==2018.5.0 --exclude *.beta --time 1606913068 --paths "M:\common\users\rafael\packages;\\hollywood.local\Main\common\tools\packages\proj;\\hollywood.local\Main\common\tools\packages\app;\\hollywood.local\Main\common\tools\packages\td;\\hollywood.local\Main\common\tools\packages\int;\\hollywood.local\Main\common\tools\packages\ext;\\hollywood.local\Main\common\tools\packages\converted" -- render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender "catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; " -preFrame "catch(preFrameHook); " -postLayer "catch(postLayerHook); " -postFrame "catch(postFrameHook); " -postRender "catch(postRenderHook); " -rd M:/hollywood/projects/NINE/tmp/maya_render/rafael/2020_1202_214812284000/output M:/hollywood/projects/NINE/tmp/maya_render/rafael/2020_1202_214812284000/chara_person_default_look_default-person_v074.ma

mottosso commented 3 years ago

These are problematic :/ The -- syntax is so complex it's hard to know where to look.

The most robust option I think would be to..

  1. Write the command after -- into a temporary command.bat or command.ps1
  2. Call rez env <your packages> -- command.bat
  3. Optionally delete it afterwards, or just keep overwriting it

The added benefit being that you can inspect the command.bat afterwards, and double-check quotation marks and newlines etc.

Next port to call would be to see whether nerdvegas/rez has a handle on this, I remember this being an issue way back when and it's possible they've got a solution that can be copy/pasted into here.

RafaelVillar commented 3 years ago

Thank you for the quick response!

Yeah, I think I will just export it to a bat/sh file for simplicity sake. Maybe it's something we can auto generate in the tmp RXT dir? Just spit balling.

On mention of nerdvegas/rez -- that repo has taken off this last year with commits. Anything you've seen worth bringing over?

mottosso commented 3 years ago

Maybe it's something we can auto generate in the tmp RXT dir? Just spit balling.

Possibly..

On mention of nerdvegas/rez -- that repo has taken off this last year with commits. Anything you've seen worth bringing over?

Not sure, I haven't been keeping up, it's been a while. It's possible they've got Windows and Python 3 support under control by now, in which case you might be able to switch altogether. They should both work interchangeably with Allzpark, for example.