Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Breadbox Manual

Breadbox packages Rust desktop applications from a Cargo project. It builds the binary with Cargo, then writes one or more artifacts to dist/.

This manual covers Breadbox 0.0.1-alpha.1. Breadbox 0.0.x is alpha software. The CLI and config format can change between releases. --format is required for build and doctor.

Start here

License

This manual uses the same MIT license as Breadbox.

Getting started

This chapter adds Breadbox to an existing Rust project. You will create a config and build a first raw artifact. By the end you have breadbox.toml and a file in dist/.

Breadbox 0.0.x is alpha software. The CLI and config format can change between releases.

Requirements

RequirementNotes
Rust 1.88 or newerInstall with rustup. Cargo comes with Rust.
Installed Breadbox CLIInstall it with Cargo in the next step. It must be on your PATH.
One buildable binaryIf your package has several buildable binaries, set package.default-run in your Cargo.toml. See breadbox info.
No extra tools for rawcargo is enough for the first artifact. Other formats need host tools.

Install Breadbox

cargo install breadbox --version 0.0.1-alpha.1 --locked

Check that the command is available:

breadbox --version

If your shell cannot find breadbox, add Cargo's bin directory to your PATH. Shell completions are optional. See breadbox completions.

Create the config

Run init from your project root:

breadbox init

init creates breadbox.toml when none exists and records the installed CLI version. Existing files are left alone and reported as skipped. Use --force-config to replace an existing file. Keep the generated version line when you edit the config. See Root keys.

Build a raw artifact

--format is required for build and doctor. Run these commands from the project root:

breadbox info
breadbox doctor --format raw
breadbox build --format raw --dry-run
breadbox build --format raw

info prints resolved app data and paths. doctor checks host tools for the selected formats. build --dry-run resolves and validates the project, prints the summary and exits without building. The final command compiles the app with the release profile and writes the artifact.

Check the result

On an x86_64 Unix host, you should see a file like this:

dist/
└── myapp_0.1.0_x86_64

The exact name follows your package name, version and architecture. On Windows, the artifact ends in .exe. At this point your setup works:

my-app/
├── breadbox.toml
├── dist/
│   └── myapp_0.1.0_x86_64
├── Cargo.toml
└── src/
    └── main.rs

If breadbox is not found, check that cargo install finished and that Cargo's bin directory is on your PATH. If doctor says cargo is missing, check the PATH in the shell where you run Breadbox.

Next steps

Linux packages need more settings in breadbox.toml and Cargo.toml. Start with the worked example, Root keys and Linux settings.

Worked example

This chapter builds a small Linux app for all five formats on a Linux host. By the end, dist/ contains one artifact per format.

This chapter uses the installed CLI from Getting started.

Project layout

After you add Breadbox and write the config, your project looks like this:

my-app/
├── assets/
│   └── myapp.svg
├── src/
│   └── main.rs
├── breadbox.toml
├── Cargo.toml
├── LICENSE
└── README.md

Cargo.toml

[package]
name = "myapp"
version = "0.1.0"
edition = "2024"
description = "Example desktop application"
license = "MIT"
authors = ["Example Dev <dev@example.com>"]
repository = "https://example.com/myapp"

All three package formats need a convertible package name and pkg needs a convertible version. The description and first author are needed for deb. pkg also needs a license and rpm needs a description and license. Because the package has one binary, you do not need package.default-run.

breadbox.toml

Install Breadbox as shown in Getting started, then run init from the project root. Keep the generated version line and add the settings below:

breadbox-version = "0.0.1-alpha.1"
app-name = "My App"

[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application with a small settings window"
categories = "Utility"

[components.license]
license-file = "LICENSE"

[linux.icons]
scalable = "assets/myapp.svg"

[install.linux.files.readme]
source = "README.md"
destination = "/usr/share/doc/myapp/README.md"
role = "doc"
mode = "0644"
formats = ["deb", "rpm", "pkg"]

[formats.deb]
extra-depends = ["ca-certificates"]

[formats.rpm]
extra-requires = ["ca-certificates"]

[formats.pkg]
extra-depends = ["ca-certificates"]

The icon is needed by appimage. With the default desktop file, it also gives deb, pkg and rpm a non-empty Icon= value. The license is placed where each format expects it and the README is installed only for the three package formats. Use --force-config if you need to overwrite an existing config.

Check, inspect and build

Formats must be selected explicitly:

breadbox doctor --format raw,deb,pkg,rpm,appimage
breadbox info
breadbox build --format raw,deb,pkg,rpm,appimage --dry-run
breadbox build --format raw,deb,pkg,rpm,appimage

doctor checks the tools listed in the format overview. --dry-run resolves and validates the project, prints the summary and exits. The final build compiles the binary and writes an artifact for each format that succeeds.

Resulting dist/

On an x86_64 Linux host, names look like this:

dist/
├── myapp_0.1.0_x86_64
├── myapp_0.1.0_x86_64.AppImage
├── myapp_0.1.0_amd64.deb
├── myapp-0.1.0-1-x86_64.pkg.tar.zst
└── myapp-0.1.0-1.<dist>.x86_64.rpm

rpmbuild chooses the RPM filename, so the .<dist>. part depends on the build host and can be empty. Exact naming rules are in the format guides.

Next steps

CLI reference

breadbox [OPTIONS] <COMMAND>
breadbox help [COMMAND]
CommandDescription
buildBuild the app for selected formats.
doctorCheck host tools for selected formats.
infoPrint resolved project metadata and paths.
initCreate breadbox.toml.
completionsGenerate shell completion scripts.

Use -h/--help for command help, -V/--version for the version and help [COMMAND] for help with a specific command.

Global options work with every command. See Global options.

Exit behavior

Runtime errors print error: <message> and exit with status 1. Usage errors exit with status 2. If you interrupt a build with Ctrl+C, Breadbox prints an interrupted summary and exits with status 130.

Global options

These options work before or after the command:

breadbox --project-root .. build
breadbox build --project-root ..
OptionDefaultDescription
-p, --project-root <PATH>Current directoryYour project root.
--manifest-path <PATH>Cargo.toml in the project rootYour Cargo.toml.
--config <PATH>breadbox.toml in the project root if it existsBreadbox config. When absent, defaults are used.

Path resolution

PathResolution
Project root--project-root or the current directory. Resolved to a full path.
Cargo manifest--manifest-path or Cargo.toml in the project root. Relative paths use the project root. Resolved to a full path.
Config--config or breadbox.toml in the project root if that file exists. Relative paths use the project root. Resolved to a full path.

An explicit --config path must exist. If you pass no config option and breadbox.toml is absent, breadbox uses built-in defaults.

breadbox build

breadbox build [OPTIONS]

Builds the app for the selected formats and writes artifacts to --out-dir, which defaults to <project-root>/dist.

Options

OptionDefaultDescription
-f, --format <FORMAT>...RequiredFormats to build. Repeatable or comma-separated.
--out-dir <PATH><project-root>/distOutput directory.
--profile <NAME>releaseCargo profile used for the application binary.
--no-lockedOffBuild without --locked.
--tests <MODE>From config, otherwise offOverride the test gate: off, warn or block.
--keep-tempOffKeep the temporary build directory.
--dry-runOffPrint the resolved summary without building.

Global options work with this command. See Global options.

Format selection

At least one format is required. -f and --format accept comma-separated values, several values after one flag or repeated flags. Repeated names are used once. Unsupported formats are an error.

breadbox build --format raw,deb
breadbox build -f raw -f rpm

Breadbox supports raw, deb, pkg, rpm and appimage. See Format guides.

Tests

By default, build does not run tests. Add [tests] to breadbox.toml to run cargo test before the binary build. off skips tests, warn continues after a test failure and block stops the build. --tests overrides the configured mode. See Root keys.

Summary

Before a build, Breadbox prints the resolved summary:

My App build config
  formats    raw deb
  root       /home/me/projects/my-app
  out-dir    /home/me/projects/my-app/dist
  version    0.1.0
  profile    release
  locked     yes
  tests      off
  keep-temp  no

--dry-run resolves and validates the project, prints this summary and exits. It does not check format-specific tools, run Cargo or build packages.

Failures

Breadbox exits with 0 on success, 1 after a runtime error and 130 if you interrupt a running build. Usage errors exit with 2. Omitting --format exits with status 1. If one format fails, Breadbox continues with the rest. It lists each failed format as <format>: <error> with the underlying cause at the end. Missing host dependencies tell you to run breadbox doctor --format <formats> with the same selected formats.

Temporary files are removed after a clean build. They are kept after a format failure or after any build when you pass --keep-temp.

breadbox doctor

breadbox doctor [OPTIONS]

Checks whether cargo and the host tools for the selected formats are available. --format is required and works the same way as it does for build.

breadbox doctor --format raw
breadbox doctor --format deb,rpm
breadbox doctor -f appimage

What is checked

doctor checks cargo and the tools listed in the format overview. It loads the selected [formats] config, so options such as [formats.deb] shlibdeps can change the tool list. It does not validate your Cargo.toml or other config sections.

Output

breadbox dependency check
  ok         cargo
  ok         dpkg-shlibdeps
  ok         dpkg-deb
  missing    rpmbuild (Install rpmbuild (usually provided by rpm-build/rpm-tools))
error: missing host dependencies

Exit codes

doctor exits with 0 when all required tools are present and 1 when any are missing. Usage errors exit with 2.

breadbox info

breadbox info [--profile <NAME>] [OPTIONS]

Prints the resolved project metadata and paths. --profile defaults to release and only affects the binary path it shows. It does not build anything.

breadbox info
breadbox info --profile dev

Fields

FieldMeaning
appapp-name from config or the package name.
packagePackage name from your Cargo.toml.
versionPackage version.
binSelected binary target name.
sourcePath to the binary's source file.
runpackage.default-run or <none>.
featuresEnabled default features or <none>.
requiresBinary required-features or <none>.
archDetected architecture: x86, x86_64, arm or aarch64.
profileValue of --profile.
formatsFormats supported by this host, sorted.
rootAbsolute project root.
manifestAbsolute path to your Cargo.toml.
configAbsolute config path or <none>.
workspaceCargo workspace root.
outOutput directory.
targetCargo target directory.
exeResolved binary path for the chosen profile.

The output starts with the header breadbox project info. Empty optional values and empty lists appear as <none>.

Binary selection

Breadbox reads your Cargo.toml and picks a buildable binary. Candidate binaries are bin targets whose required-features are covered by the enabled default features.

  • One candidate is selected automatically.
  • If there are no candidates, breadbox reports no buildable binary target found in Cargo.toml.
  • Several candidates require package.default-run in your Cargo.toml.
  • A package.default-run value that does not name a buildable binary is an error.

breadbox init

breadbox init [OPTIONS]

Creates breadbox.toml in the project root when none exists. The new file records the installed CLI version:

breadbox-version = "0.0.1-alpha.1"
OptionDescription
--force-configReplace an existing config file.

Without --force-config, an existing file is left alone and reported as skipped. Add the settings your formats need before building. See Root keys and the worked example.

breadbox completions

breadbox completions <SHELL> [OPTIONS]

Prints a completion script to stdout or writes it to a user location with --install.

ShellValue--install
BashbashUnix
ZshzshUnix
FishfishUnix
PowerShellpowershellWindows
ElvishelvishUse --path
OptionDescription
--installWrite the script instead of printing it.
--path <PATH>Use a custom location. Requires --install.
--forceOverwrite an existing script. Requires --install.
--dry-runShow the target and action without writing. Requires --install.

Install locations

ShellStandard location
Bash$XDG_DATA_HOME/bash-completion/completions/breadbox, otherwise ~/.local/share/bash-completion/completions/breadbox
Zsh$XDG_DATA_HOME/zsh/site-functions/_breadbox, otherwise ~/.local/share/zsh/site-functions/_breadbox
Fish$XDG_CONFIG_HOME/fish/completions/breadbox.fish, otherwise ~/.config/fish/completions/breadbox.fish
Windows PowerShell%USERPROFILE%\Documents\PowerShell\completions\breadbox.ps1
breadbox completions bash --install
breadbox completions zsh --install --path ~/.zfunc/_breadbox

--install does not edit shell startup files. Breadbox prints any extra setup you need.

  • Bash: enable bash-completion, then restart Bash or source your completion setup.
  • Zsh: add the printed fpath line to ~/.zshrc before compinit.
  • Fish: Fish loads this file automatically.
  • PowerShell on Windows: add the printed dot-source line to your $PROFILE.

Use breadbox completions <SHELL> without --install to print the script, including for Elvish. Re-run the install command after upgrading Breadbox.

Configuration reference

Breadbox configuration is optional. If <project-root>/breadbox.toml does not exist and you do not pass --config, Breadbox uses defaults. init creates a config that pins breadbox-version to the installed CLI.

The file is TOML. Use the keys shown in the reference. Unsupported keys are errors. [linux.desktop] accepts your own entry keys and [linux.desktop.actions] adds desktop actions. [linux.icons] uses size keys that you choose. Strings can contain ${namespace:key} tokens. See Interpolation.

Which keys you need depends on the formats you select. A raw-only build needs no extra config. Linux package formats need shared fields in [linux] and, for some formats, fields in Cargo.toml.

Path rules

Absolute paths are used as written. Relative paths are joined to the absolute project root, even when the config file is elsewhere. Install destinations are absolute virtual paths inside the package. Breadbox removes the leading / when it places files.

Chapters

Root keys

Most root keys in breadbox.toml are optional. Linux package formats (deb, pkg, rpm and appimage) need identifier, description-long and categories in the [linux] table. See Linux settings.

KeyTypeDefaultRequiredDescription
breadbox-versionstringNoneNoCLI version recorded by init.
app-namestringPackage nameNoApplication name in the desktop file, summaries and info output.
componentstableEmptyNoOptional components. See Components.
linuxtableEmptyFor Linux package formatsShared fields, icons, desktop entries and actions. See Linux settings.
installtableEmptyNoExtra files. See Install files.
formatstableEmptyNoPer-format options. See Format sections.
teststableNoneNoCargo test gate. See Tests.

breadbox-version

init records the installed CLI version. An older recorded version prints a warning. A newer one stops with an error. Versions are three-part semantic versions. A final release sorts after its prereleases, so a config written by breadbox 0.0.1-alpha.1 prints a compatibility warning with breadbox 0.0.1. Build metadata after + is ignored. A missing or blank value prints a compatibility warning. Malformed versions stop with an error. Keep the generated line unless you intend to change that behavior.

app-name

app-name overrides the package name from Cargo.toml in user-facing output. A blank value counts as unset.

Linux fields

The shared Linux fields live in [linux]:

[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application with a small settings window"
categories = "Utility;Development;"
  • identifier becomes the .desktop filename and icon basename. Use one safe filename component: ASCII letters, digits, ., _ or -, not . or ...
  • description-long is used by deb and rpm.
  • categories is the default Categories= value in generated desktop files.

Tests

By default, build does not run tests. Add [tests] to run cargo test before the binary build:

[tests]
mode = "warn"
ModeBehavior
offDo not run tests.
warnRun tests and continue after a failure.
blockRun tests and stop the build on failure.

With no [tests] table, the mode is off. With [tests] but no mode, the mode is warn. Use breadbox build --tests <MODE> to override the config for one build.

Minimal example

app-name = "Example App"

[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application"
categories = "Utility"

This is enough for deb, pkg and rpm, as long as your Cargo.toml contains the fields those formats need. appimage also needs at least one icon and a non-empty Icon= value in the final desktop entry.

Components

Components are optional extras configured in breadbox.toml.

License component

[components.license] adds a license file to Linux packages.

KeyTypeDefaultDescription
license-filestringNonePath to a license file. Setting it enables the component.
[components.license]
license-file = "LICENSE"

When you select a Linux package format, the path must be non-blank and name an existing file. Relative paths use the project root. Absolute paths are used as written. Breadbox places the license at:

FormatDestination
rpmusr/share/licenses/<package-name>/<filename>
appimage<filename> at the AppDir root
debusr/share/doc/<deb-package-name>/copyright
pkgusr/share/licenses/<pkg-package-name>/<filename>

raw builds do not include the license component.

Browser registration component

[components.browser-registration] registers the app as an HTTP/HTTPS handler in the generated desktop entry.

KeyTypeDefaultDescription
enabledboolfalseRegisters the app as an HTTP/HTTPS handler in the desktop entry.
[components.browser-registration]
enabled = true

When enabled, Breadbox adds these desktop values:

EntryValue
Exec<binary-name> %u
MimeType["x-scheme-handler/http", "x-scheme-handler/https"]

Component entries are applied first. A string under [linux.desktop] replaces a component value. An array appends to it and removes duplicates. Keep %u when you replace Exec. Include the HTTP/HTTPS scheme handlers yourself when you replace MimeType with a string. See Linux settings.

Linux settings

The [linux] table holds the shared fields and files used by Linux package formats. Breadbox checks them when you select deb, pkg, rpm or appimage.

Shared fields

KeyDescription
identifierSafe filename component used for the desktop file and icon names.
description-longLong description used by deb and rpm.
categoriesDefault desktop Categories value.

See Root keys.

[linux.icons]

Keys are icon sizes and values are file paths.

KeyValue
scalablePath to an .svg file.
WxHPath to a .png or .xpm file, with numeric width and height.

Each path must name an existing file. Relative paths use the project root. Absolute paths are used as written. Icons are installed under usr/share/icons/hicolor/<size>/apps/<identifier>.<ext>.

[linux.icons]
scalable = "icons/app.svg"
64x64 = "icons/app-64.png"
128x128 = "icons/app-128.png"

Breadbox adds Icon=<identifier> when you configure at least one icon. appimage needs at least one icon and a non-empty Icon value in the final desktop entry. If no scalable icon is set, Breadbox uses the largest configured icon.

[linux.desktop]

Write desktop entry keys directly under [linux.desktop]. Strings replace generated or component values. Arrays append to generated or component lists and remove duplicates. Use a string to replace a list completely. For the full set of keys and value rules, see the Desktop Entry Specification.

[linux.desktop]
StartupWMClass = "myapp"
Comment = "Example desktop application"
Categories = ["Utility", "Development"]
MimeType = ["x-scheme-handler/http", "x-scheme-handler/https"]
Icon = "myapp"

template is not supported. Using it is an error. Write keys directly under [linux.desktop], or add a desktop file with install files.

Keys accept ASCII letters, digits and -. Locale suffixes accept ASCII letters, digits, _, -, @ and ., as in "Name[fr]" = "Nom". Write arrays as semicolon-terminated lists. Escape ;, \, newline, carriage return and tab. Empty arrays and empty list items are errors.

A final desktop entry needs Type = "Application", Name and Exec. Exec can be omitted only when the entry sets DBusActivatable to the string "true". Other Type values are errors.

Breadbox writes these defaults when you do not override them:

KeyValue
Nameapp-name or the package name.
ExecBinary name.
TypeApplication.
Categorieslinux.categories.
CommentPackage description.
StartupWMClassBinary name.
Iconlinux.identifier, when icons are configured.

Component entries are applied first. See Browser registration.

Desktop actions

List action IDs in Actions and configure each ID under [linux.desktop.actions.<id>]:

[linux.desktop]
Actions = ["open", "settings"]

[linux.desktop.actions.open]
Name = "Open"
Exec = "myapp --open"

[linux.desktop.actions.settings]
Name = "Settings"
Exec = "myapp --settings"

Actions also accepts a semicolon-terminated string such as "open;settings;", but arrays are recommended. Action IDs accept ASCII letters, digits and -. Each ID needs a matching action table. Unlisted tables are errors. Each action needs Name and Exec. Exec can be omitted when the main entry sets DBusActivatable = "true". Action tables accept the same key, value, locale and escaping rules as the main entry.

Install files

Add extra files under [install.linux.files.<id>], where <id> is any identifier you choose.

KeyTypeDefaultDescription
sourcestringRequiredFile or directory to copy. Relative paths use the project root.
destinationstringRequiredAbsolute virtual package path. Cannot contain ...
recursiveboolfalseCopy a directory recursively. Directory sources are always recursive.
roleenumdatadata, license, copyright, doc or config.
modestringNoneOctal mode with an optional 0o prefix, up to 0o7777. Files only.
formatsarray of stringsAll applicableRestrict the file to the listed formats.

Breadbox removes the leading / from destination when it places the file in the package:

destination = "/usr/share/myapp/data.txt"  ->  usr/share/myapp/data.txt

Roles

RoleEffect
dataOrdinary installed file.
license%license in rpm. Ordinary file elsewhere.
copyright%license in rpm. Ordinary file elsewhere.
doc%doc in rpm. Ordinary file elsewhere.
configDEBIAN/conffiles for deb, %config(noreplace) for rpm, backup=() for pkg.

In rpm, data files installed below /usr/share/licenses/ are also written as %license.

Examples

[install.linux.files.manual]
source = "docs/manual.pdf"
destination = "/usr/share/doc/myapp/manual.pdf"
role = "doc"
mode = "0644"
formats = ["deb", "rpm"]

[install.linux.files.resources]
source = "assets/resources"
destination = "/usr/share/myapp/resources"
recursive = true

When you omit formats, Breadbox includes the file in every selected format that supports Linux install files. When you set it, only the listed formats receive the file.

Extra desktop files

Breadbox generates one main desktop entry at /usr/share/applications/<linux.identifier>.desktop for Linux package formats. Use install files to add other .desktop files:

[install.linux.files.settings_desktop]
source = "assets/myapp-settings.desktop"
destination = "/usr/share/applications/myapp-settings.desktop"

Install files are staged after the generated entry, so an install file with the same destination replaces it. Breadbox does not validate desktop files supplied this way. For AppImage builds, Breadbox passes that path to linuxdeploy. If you replace the generated entry, keep its Icon value aligned with [linux.desktop].

Format sections

Per-format options live under [formats.<name>]. Use only the options documented in the individual format guide. Empty sections are valid.

FormatGuide
rawNo options.
debDebian options.
pkgArch package options.
rpmRPM options.
appimageNo options.
[formats.raw]
[formats.appimage]

See the format guides for host tools, project requirements and artifact names.

Interpolation

String values in breadbox.toml can contain ${namespace:key} tokens. Arrays and tables are searched too. Tokens are expanded before Breadbox applies the config, so you can avoid repeating values from Cargo or from the config itself.

NamespaceSource
configA dotted path into the original config.
manifestFields from your Cargo.toml and selected binary.
buildResolved project and build paths.

${config:...}

Use a dotted path into the config. Referenced values must be strings or scalar values that can be written as text.

[linux]
categories = "Utility;Development;"
description-long = "${config:linux.categories} application"

${manifest:...}

FieldDescription
package-namePackage name.
versionPackage version.
descriptionPackage description. Error if unset.
repositoryRepository URL. Error if unset.
licenseSPDX license. Error if unset.
authorsAll authors, joined with ", ".
binary-nameSelected binary target name.
binary-sourceSelected binary source path.
binary-required-featuresBinary required-features, joined with ", ".
default-runpackage.default-run. Error if unset.
default-featuresEnabled default features, joined with ", ".
workspace-rootCargo workspace root.
target-directoryCargo target directory.

List fields accept a .N suffix for one element, for example ${manifest:authors.0}.

app-name = "${manifest:package-name} (${manifest:version})"

[linux]
identifier = "com.example.${manifest:package-name}"
description-long = "${manifest:description}"

${build:...}

FieldDescription
archx86, x86_64, arm or aarch64.
profileCargo profile supplied to build or info.
project-rootAbsolute project root.
out-dirResolved output directory.
binary-pathResolved application binary path.
[install.linux.files.icon]
source = "${build:project-root}/assets/${manifest:package-name}.svg"
destination = "/usr/share/icons/hicolor/scalable/apps/${manifest:package-name}.svg"

Format guides

Breadbox supports raw, deb, pkg, rpm and appimage. raw works on any host. The other four require Linux.

FormatHostHost toolsConfig section
rawAnycargoNone
debLinuxdpkg-shlibdeps, dpkg-deb[formats.deb]
pkgLinuxmakepkg, fakeroot[formats.pkg]
rpmLinuxrpmbuild[formats.rpm]
appimageLinuxwget, sha256sumNone

Package names vary by distribution. Install the equivalent packages if a hint does not apply.

Select formats

--format is required for build and doctor. It accepts comma-separated values, several values after one flag or repeated flags.

breadbox build --format raw
breadbox build -f deb,rpm
breadbox doctor -f appimage

Requesting a format your host does not support is an error.

Host tool hints

FormatInstall hint
rawInstall Rust with rustup.
debUsually dpkg-dev and dpkg on dpkg-based systems.
pkgUsually base-devel on Arch-based systems.
rpmUsually rpm-build or rpm-tools.
appimageUsually wget and coreutils.

dpkg-shlibdeps is not needed when [formats.deb] shlibdeps = false. See Format sections.

Architecture mapping

Breadboxrawdebpkgrpmappimage
x86x86i386i686i686i386
x86_64x86_64amd64x86_64x86_64x86_64
armarmarmhfarmv7harmv7hlarmhf
aarch64aarch64arm64aarch64aarch64aarch64

Shared config

Linux package formats share the settings in Root keys, Linux settings, Install files and Components. Each guide below covers only what is unique to that format.

Output files

Artifact names are deterministic. A build silently replaces an existing file with the same name in --out-dir. Move or rename earlier artifacts if you need to keep them.

raw

raw copies your built binary into the output directory. It works on any host and has no options.

breadbox build --format raw

Requirements

  • One buildable binary or package.default-run in your Cargo.toml.
  • No format-specific config. A generated breadbox.toml only pins breadbox-version.

Output

The artifact is named:

<package-name>_<version>_<arch>

On Windows, the name gains a .exe suffix. On Unix, Breadbox sets the copied file permissions to 0755.

myapp_0.1.0_x86_64
myapp_0.1.0_aarch64.exe

raw does not add desktop files, icons, components or install files. See breadbox build for --out-dir.

deb

deb builds a Debian package. It is available only on Linux and needs dpkg-deb. By default it also uses dpkg-shlibdeps to find dependencies. See the format overview for tools and architecture names.

Cargo.toml requirements

FieldRequirement
package.nameConverts to a Debian package name. Use letters, digits, ., + and -. _ becomes -. The first character is a letter or digit. The name needs at least two characters.
package.descriptionRequired and single-line.
package.authors[0]Required. Used as maintainer.
package.repositoryOptional single-line homepage.

Config

Set the shared Linux fields in [linux] as shown in Linux settings, then add options under [formats.deb].

OptionDefaultDescription
extra-depends[]Extra Depends: clauses. Entries are added after the results from dpkg-shlibdeps. Keep entries on one line.
shlibdepstrueRun dpkg-shlibdeps. Set false to supply all dependencies yourself. This also removes the tool from breadbox doctor.
[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application"
categories = "Utility"

[formats.deb]
extra-depends = ["ca-certificates", "libc6 (>= 2.34)"]

Install files with role = "config" are listed in DEBIAN/conffiles. See Install files.

Output

Breadbox converts - in the Cargo version to ~ for Debian. The artifact is named:

<deb-package-name>_<debian-version>_<deb-arch>.deb

pkg

pkg builds an Arch Linux package with makepkg and needs fakeroot. It is available only on Linux. Breadbox runs makepkg --skipinteg --nodeps. It skips integrity checks for the generated PKGBUILD and does not resolve dependencies. Declare runtime dependencies with extra-depends. See the format overview for tools and architecture names.

Cargo.toml requirements

FieldRequirement
package.nameConverts to an Arch package name. Use letters, digits, @, ., + and -. _ becomes -. The first character is a letter or digit.
package.versionUse ASCII letters, digits, ., _, - and +. - and + become _. The first character is a letter or digit.
package.descriptionRequired and single-line.
package.licenseRequired and single-line.
package.authors[0]Required and single-line.
package.repositoryOptional and single-line.

Config

Set the shared Linux fields in [linux] as shown in Linux settings, then add options under [formats.pkg].

OptionDefaultDescription
extra-depends[]Extra package dependencies. Keep entries on one line and use only ASCII letters, digits and @ . _ + - < = > :.
[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application"
categories = "Utility"

[formats.pkg]
extra-depends = ["glibc", "bash"]

Install files with role = "config" are added to the package backup list. See Install files.

Output

<name>-<version>-1-<pkg-arch>.pkg.tar.zst

rpm

rpm builds an RPM package with rpmbuild. It is available only on Linux. See the format overview for tools and architecture names.

Cargo.toml requirements

FieldRequirement
package.nameASCII letters are lowercased. _ becomes -. Use letters, digits, ., + and -. The first character is a letter or digit.
package.descriptionRequired and single-line. Used as Summary:.
package.licenseRequired and single-line.
package.authors[0]Optional. Used as Vendor:.
package.repositoryOptional. Used as URL:.

Config

Set the shared Linux fields in [linux] as shown in Linux settings, then add options under [formats.rpm].

OptionDefaultDescription
extra-requires[]Extra Requires: lines. Keep entries on one line.
[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application"
categories = "Utility"

[formats.rpm]
extra-requires = ["bash", "ca-certificates"]

Install-file roles control the generated file list. See Install files.

Version and output

The Cargo version becomes the RPM version. A suffix after the first - becomes the release: 0.1.0-beta.1 produces version 0.1.0 and release 0.beta.1. Without a suffix, the release is 1. rpmbuild chooses the exact filename, including any .<dist>. part:

myapp-0.1.0-1.<dist>.x86_64.rpm

appimage

appimage builds an AppImage for Linux. It requires at least one icon and uses wget and sha256sum to fetch a pinned linuxdeploy helper. Breadbox verifies the helper's SHA-256 digest and caches it in the platform cache directory. The first build needs network access unless the helper is cached. See the format overview for tools and architecture names.

Cargo.toml requirements

  • One buildable binary or package.default-run in your Cargo.toml.

Config

Set the shared Linux fields and at least one icon. [formats.appimage] has no options.

[linux]
identifier = "com.example.myapp"
description-long = "Example desktop application"
categories = "Utility"

[linux.icons]
scalable = "icons/myapp.svg"
64x64 = "icons/myapp-64.png"

The final desktop entry must have a non-empty Icon value. With the default desktop file, adding an icon is enough. If you set Icon yourself, put it under [linux.desktop]. See Linux settings.

Install files and the configured license are included in the AppImage. See Install files and Components.

Output

<package-name>_<version>_<appimage-arch>.AppImage