@@ -28,14 +28,33 @@ scripts = ["utils/ublk_chown.sh"]
2828
2929# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
3030
31+
32+ # IMPORTANT: CARGO.TOML SECTION ORDERING
33+ #
34+ # Cargo expects the general, high-level sections (like [dependencies],
35+ # [dev-dependencies], [build-dependencies], etc.) to be defined BEFORE
36+ # any target-specific sections.
37+ #
38+ # If general dependency definitions are placed AFTER any
39+ # [target.'cfg(...)'.dependencies] blocks, Cargo can misinterpret their scope,
40+ # leading to unexpected errors (like dependencies only being available for
41+ # a specific target, or incorrect feature merging).
42+ #
43+ # If you mess up the order, Cargo will make sure your build system spends a weekend
44+ # wandering the dependency graph, wondering where it all went wrong, and you'll lose your hair
45+ # trying to figure out why.
46+ #
47+ # 1. ALWAYS list ALL general [dependencies] first.
48+ # 2. THEN, define ALL conditional [target.'cfg(...)'.dependencies] blocks.
49+
3150[build-dependencies ]
3251bindgen = " 0.69"
3352regex = " 1.8.3"
3453anyhow = " 1.0.66"
3554
3655[dependencies ]
56+
3757libc = " 0.2"
38- io-uring = {version =" =0.7.9" }
3958serde = {version = " 1.0.99" , features = [" derive" ]}
4059serde_json = " 1.0.79"
4160bitmaps = " 3.2.0"
@@ -61,3 +80,11 @@ daemonize = "0.5"
6180env_logger = " 0.9"
6281futures = " 0.3.31"
6382rand = " 0.8"
83+
84+
85+ # Put the conditional stuff at the bottom, order matters, see about comment
86+ [target .'cfg(not(target_arch = "s390x"))' .dependencies ]
87+ io-uring = " ^0.7"
88+
89+ [target .'cfg(target_arch = "s390x")' .dependencies ]
90+ io-uring = { version = " ^0.7" , features = [" bindgen" ] }
0 commit comments