package MlFront_Exec

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module ShellImportGH2.CmdlineSource

A command line.

The command line that gets run is native_cmdline and may use absolute paths (on Windows an absolute path is required if the path exceeds 260 characters).

The command line that gets displayed is portable_cmdline, and should use relative paths.

The separation between native_cmdline and portable_cmdline is for two reasons:

  1. In cram tests which are done in uniquely named Dune sandboxes, we want repeatable results across platforms and even across different language implementations.
  2. Most importantly, we want the end-user to repeat the results in their own directories. What good are security tools like attestations if you can't repeat the results on your own?
Sourcetype t = {
  1. native_cmdline : string;
  2. portable_cmdline : string;
}
Sourceval create : ?stdout:string -> ?executable_maybe_rel:MlFront_Core.FilePath.t -> ?args_maybe_rel:string list -> executable:MlFront_Core.FilePath.t -> string list -> t

create ?stdout ?executable_maybe_rel ?args_maybe_rel ~executable args creates a command line.

  • ?stdout: if present, redirect standard output to this file path.
  • ?executable_maybe_rel: if present, this file path (which should be a relative path) is used for display in the portable command line.
  • ?args_maybe_rel: if present, these arguments (which should be relative path arguments) are used for display in the portable command line.
  • ~executable: the absolute or relative file path of the executable to run.
  • args: the absolute or relative path arguments to pass to the executable.