Controlling ENV variables for plug-ins PDF Print E-mail
Monday, 07 August 2006

Web-CAT grading plug-ins are executed as separate processes. In the past, they simply inherited the environment variable settings from the Web-CAT server process. I've modified the plug-in launching code so that the server now has direct control over the environment variables visible to plug-ins when they are executed.

I made this change as part of the modifications necessary to encapsulate some external dependencies into self-installing Web-CAT subsystems. If we want to encapsulate ANT, for example, separate processes that use ANT will need to have both the ANT_HOME and PATH environment variables tweaked so they can "see" the encapsulated resource. To do this, Web-CAT has to be able to modify ENV variables visible to its subprocesses.

I modified the calls to Runtime.exec() used to launch grading plug-ins so that Web-CAT could control the environment variables passed to subprocesses. I also modifed the subsystem manager to collect the current system's environment bindings, and allow subsystems a chance to add to or override any environment variables, including the command search path. This modification was designed to support subsystems that are going to export environment settings to grading plug-ins.