Skip to content

Commit 57b4e4c

Browse files
committed
Sync (copy) bootc blockdev & utils crates
xref discussion in #953 Basically we still need to publish to crates.io for backcompat, and that doens't work with git dependencies. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent b50ffc4 commit 57b4e4c

14 files changed

Lines changed: 1429 additions & 4 deletions

File tree

.github/workflows/sync-code.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Sync bootc-blockdev code
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 1'
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- name: Checkout bootupd
13+
uses: actions/checkout@v4
14+
with:
15+
path: bootupd
16+
17+
- name: Checkout bootc-blockdev
18+
uses: actions/checkout@v4
19+
with:
20+
repository: bootc-dev/bootc
21+
path: bootc
22+
23+
- name: Sync code
24+
run: |
25+
bootcrev=$(cd bootc && git rev-parse HEAD)
26+
echo bootcrev=${bootcrev} >> $GITHUB_ENV
27+
rm bootupd/bootc -rf
28+
mkdir bootupd/bootc
29+
for v in Cargo.toml bootc/blockdev bootc/utils; do
30+
cp -pr bootc/$v bootupd/bootc/$v
31+
done
32+
33+
- name: Create Pull Request
34+
uses: peter-evans/create-pull-request@v6
35+
with:
36+
path: bootupd
37+
commit-message: "Sync code from bootc"
38+
title: "Sync code from bootc"
39+
body: "As of commit ${{ env.bootcrev }}"
40+
branch: "sync-bootc-blockdev"
41+

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ path = "src/main.rs"
2222
[dependencies]
2323
anyhow = "1.0"
2424
bincode = "1.3.2"
25-
bootc-blockdev = { git = "https://github.com/containers/bootc", rev = "v1.3.0" }
26-
bootc-utils = { git = "https://github.com/containers/bootc", rev = "v1.3.0" }
25+
bootc-blockdev = { path = "bootc/blockdev" }
26+
bootc-utils = { path = "bootc/utils" }
2727
cap-std-ext = "4.0.6"
2828
camino = "1.1.9"
2929
chrono = { version = "0.4.41", features = ["serde"] }

bootc/Cargo.toml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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"

bootc/blockdev/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
description = "Internal blockdev code"
3+
# Should never be published to crates.io
4+
publish = false
5+
edition = "2021"
6+
license = "MIT OR Apache-2.0"
7+
name = "bootc-blockdev"
8+
repository = "https://github.com/bootc-dev/bootc"
9+
version = "0.0.0"
10+
11+
[dependencies]
12+
anyhow = { workspace = true }
13+
bootc-utils = { path = "../utils" }
14+
camino = { workspace = true, features = ["serde1"] }
15+
fn-error-context = { workspace = true }
16+
regex = "1.10.4"
17+
serde = { workspace = true, features = ["derive"] }
18+
serde_json = { workspace = true }
19+
tracing = { workspace = true }
20+
21+
[dev-dependencies]
22+
indoc = "2.0.5"
23+
24+
[lib]
25+
path = "src/blockdev.rs"

0 commit comments

Comments
 (0)