Skip to Content
marmot
Commands

Build the program in a temporary directory and run it with the arguments that follow the package or the .go files. Its exit status is marmot's.

Usage
marmot run package|files... [arguments] [flags]

Examples

marmot run main.go
marmot run ./cmd/app -port 8080

The program is built in a temporary directory with the same flags as marmot build, then run with the arguments that follow the package or the files. Build errors are shown the same way as for marmot build.

A panic in the program is reported in the same three modes as build errors: on a terminal the report lists the program's frames with their source lines and folds library frames; in JSON mode it is one panic object (code M0020). See Runtime errors.

Flags

Flags take one dash or two: -release and --release are the same.

FlagMeaning
-O stringoptimization level: 0, 1, 2, 3, s, z (default 2, 3 with -release)
-allocsreport the allocation sites of the main module: heap or stack, and why (rebuilds without the object cache)
-allocs-alllike -allocs, for every package
-color stringcolor in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
-dialect stringMLIR dialect level: llvm or go (default: go with -release, llvm otherwise; $MARMOT_DIALECT overrides)
-emit stringoutput kind: mlir, llvm, obj, exe (default "exe")
-gc stringgarbage collector: precise or none (default "precise")
-jsonmachine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
-nocachedo not use the object cache
-o stringoutput file
-pgo stringprofile guided optimization with this indexed profile (llvm-profdata merge -o FILE *.profraw)
-pgo-genbuild an instrumented binary that writes marmot-.profraw next to itself
-releaserelease build: whole program optimization, -O3, all specializations (default from $MARMOT_RELEASE=1)
-somit the pc table (tracebacks without file:line)
-tags stringcomma separated build tags
-target stringtarget triple (default: host)
-trace stringtraceback detail of -release builds: full keeps the inlined frames of each call site apart (as dev builds do)
-vprint progress and timing
-workprint and keep the temporary work directory
-xprint the commands run

Full help

marmot run --help
Build the program in a temporary directory and run it with the arguments that follow the package or the .go files. Its exit status is marmot's.

Usage:
  marmot run package|files... [arguments] [flags]

Examples:
marmot run main.go
marmot run ./cmd/app -port 8080

Flags:
      --O string         optimization level: 0, 1, 2, 3, s, z (default 2, 3 with -release)
      --allocs           report the allocation sites of the main module: heap or stack, and why (rebuilds without the object cache)
      --allocs-all       like -allocs, for every package
      --color string     color in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
      --dialect string   MLIR dialect level: llvm or go (default: go with -release, llvm otherwise; $MARMOT_DIALECT overrides)
      --emit string      output kind: mlir, llvm, obj, exe (default "exe")
      --gc string        garbage collector: precise or none (default "precise")
  -h, --help             help for run
      --json             machine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
      --nocache          do not use the object cache
      --o string         output file
      --pgo string       profile guided optimization with this indexed profile (llvm-profdata merge -o FILE *.profraw)
      --pgo-gen          build an instrumented binary that writes marmot-<id>.profraw next to itself
      --release          release build: whole program optimization, -O3, all specializations (default from $MARMOT_RELEASE=1)
      --s                omit the pc table (tracebacks without file:line)
      --tags string      comma separated build tags
      --target string    target triple (default: host)
      --trace string     traceback detail of -release builds: full keeps the inlined frames of each call site apart (as dev builds do)
      --v                print progress and timing
      --work             print and keep the temporary work directory
      --x                print the commands run

On this page

Was this page helpful?

Report an issueOpen issues