Allow specifying executable prefix explicitly
Currently, we build the executable command simply by using the selected model's executable
as the first argument:
/path/to/some/model/executable /path/to/run_cfg.yml
This works because:
- The
executable
is marked as an executable file (on UNIX:x
flag set) - The OS knows (e.g. via the shebang) how to run it
However, on Windows, that does not work, as @tgaskin realised (see support-windows-platform
branch); the workaround there is to prefix sys.executable
to the run command.
Problem is: This is not a universal solution, because it assumes (i) that the model can be run via Python, (ii) that, even if it would run in Python, the current Python executable is the one that should be used.
The only way I see to get around this is to allow explicitly specifying on the project- and/or model-level, what should be prefixed to the run command. As we can already do project- and/or model-specific updates to the meta-configuration, we would only need to: define a new meta-config parameter that allows modifying the run command, specifically: adding arguments in front of it. This could look like this:
executable_control:
# If not None, will add these elements before the model executable if running on a Windows platform
windows_prefix:
- /path/to/python.exe
… and would only require some minor (internal) changes in the multiverse
module.