|
| 1 | +[workspace] |
| 2 | +members = [ |
| 3 | + "cli", |
| 4 | + "system-reinstall-bootc", |
| 5 | + "lib", |
| 6 | + "mount", |
| 7 | + "ostree-ext", |
| 8 | + "utils", |
| 9 | + "blockdev", |
| 10 | + "xtask", |
| 11 | + "tests-integration", |
| 12 | + "tmpfiles", |
| 13 | + "sysusers", |
| 14 | +] |
| 15 | +resolver = "2" |
| 16 | + |
| 17 | +[profile.dev] |
| 18 | +opt-level = 1 # No optimizations are too slow for us. |
| 19 | + |
| 20 | +[profile.release] |
| 21 | +lto = "thin" |
| 22 | +# We use FFI so this is safest |
| 23 | +panic = "abort" |
| 24 | +# We assume we're being delivered via e.g. RPM which supports split debuginfo |
| 25 | +debug = true |
| 26 | + |
| 27 | +[profile.thin] |
| 28 | +# drop bootc size when split debuginfo is not available and go a step |
| 29 | +# further in size optimization (when tested from 140mb, to 12mb without |
| 30 | +# symbols/debuginfo, to 5.8mb with extra optimizations) |
| 31 | +# https://github.com/johnthagen/min-sized-rust |
| 32 | +# cargo build --profile=thin |
| 33 | +inherits = "release" |
| 34 | +debug = false # Re-strip debug symbols |
| 35 | +strip = true # Strip symbols from binary |
| 36 | +lto = true # Use full lto to remove dead code |
| 37 | +opt-level = 's' # Optimize for size with vector vectorization |
| 38 | +codegen-units = 1 # Reduce number of codegen units to increase optimizations |
| 39 | + |
| 40 | +[profile.releaselto] |
| 41 | +codegen-units = 1 |
| 42 | +inherits = "release" |
| 43 | +lto = "yes" |
| 44 | + |
| 45 | +[workspace.dependencies] |
| 46 | +anstream = "0.6" |
| 47 | +anyhow = "1.0.82" |
| 48 | +camino = "1.1.6" |
| 49 | +cap-std-ext = "4.0.3" |
| 50 | +chrono = { version = "0.4.38", default-features = false } |
| 51 | +clap = "4.5.4" |
| 52 | +clap_mangen = { version = "0.2.20" } |
| 53 | +hex = "0.4.3" |
| 54 | +indoc = "2.0.5" |
| 55 | +indicatif = "0.17.0" |
| 56 | +fn-error-context = "0.2.1" |
| 57 | +libc = "0.2.154" |
| 58 | +openssl = "0.10.72" |
| 59 | +owo-colors = { version = "4" } |
| 60 | +rustix = { "version" = "1", features = ["thread", "net", "fs", "system", "process", "mount"] } |
| 61 | +serde = "1.0.199" |
| 62 | +serde_json = "1.0.116" |
| 63 | +similar-asserts = "1.5.0" |
| 64 | +static_assertions = "1.1.0" |
| 65 | +tempfile = "3.10.1" |
| 66 | +tracing = "0.1.40" |
| 67 | +thiserror = "2.0.11" |
| 68 | +tokio = ">= 1.37.0" |
| 69 | +tokio-util = { features = ["io-util"], version = "0.7.10" } |
| 70 | + |
| 71 | +# See https://github.com/coreos/cargo-vendor-filterer |
| 72 | +[workspace.metadata.vendor-filter] |
| 73 | +# For now we only care about tier 1+2 Linux. (In practice, it's unlikely there is a tier3-only Linux dependency) |
| 74 | +platforms = ["*-unknown-linux-gnu"] |
| 75 | +tier = "2" |
| 76 | +all-features = true |
| 77 | +exclude-crate-paths = [ { name = "libz-sys", exclude = "src/zlib" }, |
| 78 | + { name = "libz-sys", exclude = "src/zlib-ng" }, |
| 79 | + # rustix includes pre-generated assembly for linux_raw, which we don't use |
| 80 | + { name = "rustix", exclude = "src/imp/linux_raw" }, |
| 81 | + # Test files that include binaries |
| 82 | + { name = "system-deps", exclude = "src/tests" }, |
| 83 | + # This stuff is giant, trim unused versions |
| 84 | + { name = "k8s-openapi", exclude = "src/v1_25" }, |
| 85 | + { name = "k8s-openapi", exclude = "src/v1_27" }, |
| 86 | + ] |
| 87 | + |
| 88 | +# This is an made up key for external binary dependencies. |
| 89 | +# setpriv is a proxy for util-linux, and systemctl is a proxy for systemd. |
| 90 | +[workspace.metadata.binary-dependencies] |
| 91 | +bins = ["skopeo", "podman", "ostree", "zstd", "setpriv", "systemctl"] |
| 92 | + |
| 93 | +[workspace.lints.rust] |
| 94 | +# Require an extra opt-in for unsafe |
| 95 | +unsafe_code = "deny" |
| 96 | +# Absolutely must handle errors |
| 97 | +unused_must_use = "forbid" |
| 98 | +missing_docs = "deny" |
| 99 | +missing_debug_implementations = "deny" |
| 100 | +# Feel free to comment this one out locally during development of a patch. |
| 101 | +dead_code = "deny" |
| 102 | + |
| 103 | +[workspace.lints.clippy] |
| 104 | +disallowed_methods = "deny" |
| 105 | +# These should only be in local code |
| 106 | +dbg_macro = "deny" |
| 107 | +todo = "deny" |
| 108 | +# These two are in my experience the lints which are most likely |
| 109 | +# to trigger, and among the least valuable to fix. |
| 110 | +needless_borrow = "allow" |
| 111 | +needless_borrows_for_generic_args = "allow" |
0 commit comments