Provides environment isolation and optional resource limits via Windows Job Objects. Environment isolation creates a sanitized set of environment variables with clean HOME, TMPDIR, TMP, TEMP pointing to a private temp directory, and an empty R_LIBS_USER.
Value
A list with elements:
- wrapper
Always
NULLon Windows (no wrapper script)- profile_path
Always
NULLon Windows- env
A named character vector of sanitized environment variables
- sandbox_tmp
Path to the private temp directory
- apply_limits
A function taking a PID to apply Job Object limits, or
NULLif no supported limits were requested
Details
When resource limits are provided (cpu, memory, nproc), a PowerShell script using C# P/Invoke is generated to create a Job Object with the specified constraints and assign the child process to it. Limits that have no Job Object equivalent (fsize, nofile, stack) emit a warning and are skipped.