Tools
fb build
Compiles a program into an executable.
fb build [options] [file.fb | package folder]fb build compiles a program and links it into one executable. With no file or folder, it works on
the package the current folder is in: the nearest folder, from the current one up, with a
project.toml.
Without -o, a package’s main file builds to build/<package> in the package’s folder, and
another of its files to build/<file>. A file outside any package builds beside it, named
after it.
- A debug build, the default, panics on integer overflow and on shifts out of range, at the
line where they happen, and has full debug info for a debugger: DWARF on Linux and macOS, and
CodeView on Windows, in a
.pdbbeside the executable. - A release build,
--release, is optimized, lets integer overflow wrap, and keeps line tables, so its stack traces still name lines.
Both have fb’s table of where each call is, so a panic prints a stack trace with FutureBlitz’s names, files, and lines, with no debug files shipped.
The runtime, and the C libraries the standard library uses, link in statically. When a program
uses one of those libraries, fb names it, with its license, and the file of notices to ship
with the program. A dependency that’s link = "beside" in project.toml, or a native library
that’s dynamic, goes beside the executable, and fb lists each file the program needs.
Options
| Option | |
|---|---|
-o, --output <path> | Where to write the executable |
--release | Optimizes, and lets integer overflow wrap instead of panicking |
--show <stages> | Prints what the compiler made at each stage: tokens, ast, types, mir, llvm, or all |
--offline | Uses only the registry packages in the cache |
--color <when> | Colors the output: auto, always, or never |
On Windows, fb adds .exe to the output’s name when it has no extension.
Examples
fb build # build/<package>, in debug
fb build --release # optimized
fb build -o dist/report # where -o says
fb build tools/report.fb # build/report, in a packageShipping a program says what a program needs where it runs.
Report an issue with this page or with FutureBlitz on GitHub.