1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00
Files
bootc/Cargo.toml

113 lines
3.6 KiB
TOML
Raw Permalink Normal View History

[workspace]
members = [
"cli",
cli: add `system-reinstall-bootc` binary # Background The current usage instructions for bootc involve a long podman invocation. # Issue It's hard to remember and type the long podman invocation, making the usage of bootc difficult for users. See https://issues.redhat.com/browse/BIFROST-610 and https://issues.redhat.com/browse/BIFROST-611 (Epic https://issues.redhat.com/browse/BIFROST-594) # Solution We want to make the usage of bootc easier by providing a new Fedora/RHEL subpackage that includes a new binary `system-reinstall-bootc`. This binary will simplify the usage of bootc by providing a simple command line interface (configured either through CLI flags or a configuration file) with an interactive prompt that allows users to reinstall the current system using bootc. The commandline will handle helping the user choose SSH keys / users, warn the user about the destructive nature of the operation, and eventually report issues they might run into in the various clouds (e.g. missing cloud agent on the target image) # Implementation Added new system-reinstall-bootc crate that outputs the new system-reinstall-bootc binary. This new crate depends on the existing utils crate. Refactored the tracing initialization from the bootc binary into the utils crate so that it can be reused by the new crate. The new CLI can either be configured through commandline flags or through a configuration file in a path set by the environment variable `BOOTC_REINSTALL_CONFIG`. The configuration file is a YAML file. # Limitations Only root SSH keys are supported. The multi user selection TUI is implemented, but if you choose anything other than root you will get an error. # TODO Missing docs, missing functionality. Everything is in alpha stage. User choice / SSH keys / prompt disabling should also eventually be supported to be configured through commandline arguments or the configuration file. Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-01-25 14:20:22 +01:00
"system-reinstall-bootc",
"lib",
"mount",
"ostree-ext",
"utils",
"blockdev",
"xtask",
"tests-integration",
"tmpfiles",
"sysusers",
]
resolver = "2"
[profile.dev]
opt-level = 1 # No optimizations are too slow for us.
[profile.release]
lto = "thin"
# We use FFI so this is safest
panic = "abort"
# We assume we're being delivered via e.g. RPM which supports split debuginfo
debug = true
[profile.thin]
# drop bootc size when split debuginfo is not available and go a step
# further in size optimization (when tested from 140mb, to 12mb without
# symbols/debuginfo, to 5.8mb with extra optimizations)
# https://github.com/johnthagen/min-sized-rust
# cargo build --profile=thin
inherits = "release"
debug = false # Re-strip debug symbols
strip = true # Strip symbols from binary
lto = true # Use full lto to remove dead code
opt-level = 's' # Optimize for size with vector vectorization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
[profile.releaselto]
codegen-units = 1
inherits = "release"
lto = "yes"
[workspace.dependencies]
anstream = "0.6"
anyhow = "1.0.82"
camino = "1.1.6"
canon-json = "0.2.1"
cap-std-ext = "4.0.3"
chrono = { version = "0.4.38", default-features = false }
clap = "4.5.4"
clap_mangen = { version = "0.2.20" }
hex = "0.4.3"
indoc = "2.0.5"
indicatif = "0.17.0"
fn-error-context = "0.2.1"
libc = "0.2.154"
2025-04-07 15:49:34 -04:00
openssl = "0.10.72"
owo-colors = { version = "4" }
rustix = { "version" = "1", features = ["thread", "net", "fs", "system", "process", "mount"] }
serde = "1.0.199"
serde_json = "1.0.116"
similar-asserts = "1.5.0"
static_assertions = "1.1.0"
tempfile = "3.10.1"
tracing = "0.1.40"
thiserror = "2.0.11"
tokio = ">= 1.37.0"
tokio-util = { features = ["io-util"], version = "0.7.10" }
# See https://github.com/coreos/cargo-vendor-filterer
[workspace.metadata.vendor-filter]
# For now we only care about tier 1+2 Linux. (In practice, it's unlikely there is a tier3-only Linux dependency)
platforms = ["*-unknown-linux-gnu"]
tier = "2"
all-features = true
exclude-crate-paths = [ { name = "libz-sys", exclude = "src/zlib" },
{ name = "libz-sys", exclude = "src/zlib-ng" },
# rustix includes pre-generated assembly for linux_raw, which we don't use
{ name = "rustix", exclude = "src/imp/linux_raw" },
# Test files that include binaries
{ name = "system-deps", exclude = "src/tests" },
# This stuff is giant, trim unused versions
{ name = "k8s-openapi", exclude = "src/v1_25" },
{ name = "k8s-openapi", exclude = "src/v1_27" },
]
# This is an made up key for external binary dependencies.
# setpriv is a proxy for util-linux, and systemctl is a proxy for systemd.
[workspace.metadata.binary-dependencies]
bins = ["skopeo", "podman", "ostree", "zstd", "setpriv", "systemctl", "chcon"]
[workspace.lints.rust]
# Require an extra opt-in for unsafe
unsafe_code = "deny"
# Absolutely must handle errors
unused_must_use = "forbid"
missing_docs = "deny"
missing_debug_implementations = "deny"
# Feel free to comment this one out locally during development of a patch.
dead_code = "deny"
[workspace.lints.clippy]
disallowed_methods = "deny"
# These should only be in local code
dbg_macro = "deny"
todo = "deny"
# These two are in my experience the lints which are most likely
# to trigger, and among the least valuable to fix.
needless_borrow = "allow"
needless_borrows_for_generic_args = "allow"