muon(1)
πΈ NAME πΈ
muon(1) is the manual page for muon, and bestie, muon is a meson-compatible build system. That's the whole vibe. π
β¨ SYNOPSIS β¨
muon [-vh] [-C <chdir>] <command> [<args>]
muon setup [-D[subproject:]option=value...] build
cd build
<invoke backend build tool>
muon test [options]
muon install [options]
π DESCRIPTION π
Okay so muon interprets source files written in the meson dsl and produces buildfiles for a backend. That's the main-character job. β¨
When you're building meson projects with muon, you typically first start by running the setup command in the project root. This will create buildfiles for the backend in the build dir you specify. Then you invoke the backend, e.g.
ninja -C <build dir>
If the project defines tests, you may run them with the test subcommand, and finally install the project with the install subcommand. π«Ά
π OPTIONS π
-vβ enable verbose output-qβ silence logging except for errors-C <path>β chdir to path before executing a command-hβ print a help message
π COMMANDS π
π¨ muon requires a command.
All commands accept a -h option which prints a brief summary of their usage. iykyk π«
π§ analyze
muon analyze [-l] [-m <mode>] [-q] [-O <path>] [-W [no-]<diagnostic|list|error>] [command]
Run a static analyzer on the current project. πβ¨
π― OPTIONS
-lβ optimize output for editor linter plugins. For example, a diagnostic is added for thesubdir()callsite, so that the editor can highlight subdirs with errors in them.-m <mode>β set the language mode-qβ only report errors-O <path>β read project file with matching path from stdin. This is useful for editor linter plugins that run as you type on files that aren't saved to disk.-W [no-]<diagnostic>β enable or disable a particular diagnostic, e.g.unused-variable.-W listβ list available diagnostics.-W errorβ turn all warnings into errors.
πΉ COMMANDS
traceβ print a tree of all meson source files that are evaluatedlspβ run the analyzer as a language serverroot-for <path>β given the path to a file, try to determine the project's rootfile <path>β run the analyzer in single file mode. Implies-m module, but-m scriptcan be passed to analyze a file in script mode. This is useful for catching bugs in scripts that will be evaluated withmuon internal eval, or script modules.
π¦ fmt
muon fmt [-i] [-q] [-l] [-c <muon_fmt.ini>] <file>[ <file>[...]]
Format a source file. π
π― OPTIONS
-qβ exit with 1 if files would be modified bymuon fmt-lβ like-qbut also print failing filenames-iβ format files in-place-c <muon_fmt.ini>β read configuration frommuon_fmt.ini-eβ try to read configuration from.editorconfig. Only indentation related settings are recognized.
π CONFIGURATION OPTIONS π
okay bestie, these are the configuration options β every key, its type, its default, and what it does. no skipping, no vibes-only summaries. β¨
max_line_lenβ int, default80β the maximum length of lines before they get split. line-length vibe check, basically. πindent_styleβspace|tab, defaultspaceβ whether to use spaces or tabs for indentation. pick your fighter. πindent_sizeβ int, default4β whenindent_style=space, this is the number of spaces to indent by per level. slay, consistent nesting. β¨insert_final_newlineβ bool, defaulttrueβ whether or not to insert a trailing newline at the end of the file. yes, the file gets a little goodbye newline. π«Άend_of_lineβlf|crlf|cr, default<unset>β the type of line ending to use. if this value is not set, then the line ending of the first line in the source file will be used. iykyk. πΈspace_arrayβ bool, defaultfalseβ whether to include spaces around array elements (ex.[1]vs[ 1 ]). tiny spacing drama, honestly. πkwargs_force_multilineβ bool, defaultfalseβ make every dictionary literal and function call with kwargs expand into multiple lines. no compact little guys allowed. πwide_colonβ bool, defaultfalseβ whether to put a space before the colon operator (ex.key : val). wide colon rights. πno_single_comma_functionβ bool, defaultfalseβ don't add a trailing comma to multi-line function calls with only one argument. one-arg calls get to breathe. π¦sort_filesβ bool, defaulttrueβ whether to sort the arguments offiles(). alphabetize the friend group. πgroup_arg_valueβ bool, defaulttrueβ whether to group strings in array literals such that command line arguments that take a value remain on the same line as the value. the heuristic used is that if a string starts with-and the next string does not, put both strings on the same line. keep the flag and its value together, bestie. π₯simplify_string_literalsβ bool, defaultfalseβ whether to automatically convert multiline string literals without newlines, as well as f-strings without formatting, into single-quoted string literals. glow-down the quotes. β¨indent_before_commentsβ str, default' 'β the indent to put before trailing comments. tiny space, big personality. πsticky_parensβ bool, defaultfalseβ controls whether parenthesis used for grouping are stuck to what they enclose or are exploded out to be on their own lines. sticky or exploded, pick a lane. πcontinuation_indentβ bool, defaultfalseβ controls whether a multiline conditional in
β¦and lastly, when a block gets wrapped in an if statement, it gets an extra indent. Cute, consistent, done. π
πΎ install
muon install [-n]
Installs the project. Fr fr, that's the whole vibe. And bestie, it respects the DESTDIR environment variable β if it's set, it gets slapped as a prefix onto all the installation directories. No cap.
OPTIONS:
-nβ dry run. Look but don't touch, iykyk.-d <destdir>β set destdir yourself.
π§ internal
muon internal <command> [<args>]
Okay so internal is the backstage area π β it holds a bunch of subcommands that muon itself uses. These commands are subject to change at any time and should not be relied upon. Like, at all. Also not every internal command is even documented, so don't come for me about the ones that aren't. π
COMMANDS:
evalβ evaluate a source fileexeβ execute a commandreplβ start a meson dsl repldump_funcsβ output all supported functions and arguments
π©Ί internal check
muon internal check [-p|-d] [-m <mode>] <filename>
Checks if filename parses. That's it, that's the job. β¨
OPTIONS:
-pβ print the parsed ast-dβ print the dissasembly-m <mode>β set the compilation mode-fβ parse in formatting mode
π§ͺ internal eval
muon internal eval [-e] [-s] -c <command> | <filename> [<args>]
Evaluate a source file. Heads up though β the interpreter environment here is substantially different from the typical environment during setup. Build related functions are unavailable, plus a whole bunch of other functions including subdir. π And one more thing: the variable argv is defined as an array containing the commandline starting at <filename>. Iconic of it honestly.
OPTIONS:
-eβ lookup<filename>as an embedded script-sβ disable functions that are unsafe to be called at random, particularlyrun_command(). The motivation for this flag is so that automated fuzz testing can be used without accidentally executing something likerun_command('rm', '-rf', '/'). π yeah. That one. Respect the flag bestie.-c <command>β evaluate the string command rather than reading from a file
β‘ internal exe
muon internal exe [-f <input file>] [-c <output file>] [-e <env.dat>] [-a <args.dat>] [-R <file>] [-- <cmd> [<args>]]
Execute <cmd> with arguments <args>. Very demure, very "just run the thing". π«Ά
OPTIONS:
-f <input file>β pass input file as stdin to<cmd>-c <output file>β capture stdout of<cmd>and write it to output file-e <env.dat>β read and set environment variables from env.dat-a <args.dat>β read and set command from args.dat-R <file>β remove file if it exists before executing the command
π internal repl
muon internal repl
Start a meson dsl repl. The functions available are limited, same as with internal eval. So like, cozy little repl. π
π internal summary
muon internal summary
Print a previously configured project's summary. Slay.
π internal dump_funcs
muon internal dump_funcs
Print all supported functions, methods, and module functions β with their arguments, argument types, and return types β to stdout. This subcommand is mainly useful for generating https://muon.build/status.html. Look at her go. π
π meson
[muon] meson ...
A compatibility layer that attempts to translate all flags and operands from meson cli syntax to muon cli syntax. So you can bring your meson habits and muon will try to make it make sense. π
For example, these two commands:
muon meson setup build --werror --prefix=/
muon meson test -C build --list
Would be translated into the following two muon versions respectively:
muon setup -Dwerror=true -Dprefix=/ build
muon -C build test -l
See? Translated. π
This compatibility layer is also enabled when muon's executable is named meson. Sneaky but useful.
For a more detailed usage information you can use the following two commands:
muon meson -h
muon meson <subcommand> -h
NOTE: This is a best-effort translation and does not guarantee or imply full cli compatibility. Many unimplemented flags are ignored, and attempting to use an unsupported subcommands will result in an error. So likeβ¦ it's giving "we tried our best", not "certified 1:1". π
ποΈ options
muon options [-a] [-m]
Lists available project options and defaults. This command may either be run from the project root or from a build directory. And the highlighting is the fun part β¨ β running it from a build directory highlights configured option values in the output, whereas running it from the project root highlights the default value for each option. Location-based aesthetics, we love to see it.
OPTIONS:
-aβ Include builtin global and per-project options in the output.-mβ Only display option values that have been modified.
π₯· samu
muon samu [<args>]
Executes an embedded copy of samu(1). This command requires that muon was compiled with samu enabled β so if it's not there, that's a build thing, not a you thing. π«Ά
ποΈ setup
muon setup [-D[subproject:]option=value...] [-#] <build dir>
Interpret all source files and generate buildfiles in build dir. The main character command, honestly. π
OPTIONS:
-D [subproject:]option=valueβ Set build options. Options are either built in or project-defined. Subproject options can be specified by prepending the subproject's name and a colon to the option. This option may be specified multiple times.-#β Display a progress bar during setup. Can be combined withmuon -qto only display a progress bar. Progress bar + quiet mode = the combo meal. π
π§© subprojects
muon subprojects
Run various commands over all subprojects. Only subprojects with .wrap files are supported. Most commands accept a list of projects as trailing arguments.
OPTIONS:
-d <directory>β manually specify subprojects directory. By default muon will evaluate the current project'sproject()call to determine the value forsubproject_dir.
COMMANDS:
check-wrapβ check if a wrap file is validupdateβ update subprojects with.wrapfileslistβ list subprojects with.wrapfiles and their statuscleanβ clean wrap-git subprojects
π§ͺ test
muon test [-a] [-b] [-d <display mode>] [-o <output>] [-e <setup>] [-f] [-j <jobs>] [-l] [-R] [-s <suite>] [-S] [-v [-v]] [<test> [<test>[...]]
Execute tests defined in source files. The default is to execute all tests, but you can also specify which tests to execute on the command line. Choose your fighter. βοΈ
<test> should consist of an optional project name, followed by a colon and then a test name. Either may be omitted. For example:
"test name"and":test name"will match all tests named'test name'in any project."proj:test name"will match all tests named'test name'in the project'proj'."proj:"will match all tests in the project'proj'.
Additionally, the test name may be a glob expression. For example:
"proj:long*"will match all tests with names starting with'long'in the project'proj'.
Glob matching ate, no crumbs. π₯
OPTIONS:
-aβ include all tests from all projects-bβ run benchmarks instead of tests-d <display mode>β Control test progress output. display mode can be one ofauto,dots, orbar.dotsprints a.for success andEfor error,barprints a progress bar with an error count. The default mode,auto, selectsbarif the output device is a terminal ordotsotherwise.-o <output mode>β Control test results output.termprints failures and output to the terminal,htmlgenerates a single-page html report, andjsonoutputs test information to a json file.-e <setup>β Use test setup setup.-fβ Fail fast. exit after first test failure is encountered.-jβ Set the number of jobs used when running tests.-lβ List tests that would be run with the current setup, suites, etc. The format of the output is<project name>:<list of suites> - <test_name>.-Rβ No rebuild. Disable automatic build system invocation prior to running tests.-s <suite>β Only run tests in suite suite. This option may be specified multiple times.-Sβ print a summary of test results, including the duration of each test-vβ Increase verbosity. When passed once, print test results as they are completed. When passed twice, the stdout/stderr of tests is not captured.
π·οΈ version
muon version
Print out version information as well as enabled features. Short, sweet, and honestly kind of a flex. π
β¨ EXTENSIONS β¨
muon provides some extra functions that may be called within source files. They are documented below. Bonus content, bestie!! π¦
dbg()β Begin an interactive debugger.p(value)β Print any value's internal representation. For example,p('hello')prints'hello'.
π SEE ALSO π
meson.build(5) meson-reference(3) meson(1)
π AUTHORS π
Maintained by Stone Tickle <lattis@mochiro.moe>, who is assisted by other open source contributors. For more information about muon development, see https://sr.ht/~lattis/muon.
okay that's the whole page bestie, you're officially fluent in muon π this one's muon(1), dated 2025-10-17 β go forth and build something iconic. periodt. πΈ
π¦ where this page comes from
- alpine 3.23: muon-doc 0.5.0-r0 Β· GPL-3.0-only AND Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms