Skip to content

Commit 438aea3

Browse files
committed
[build] Fix s390x compile errors
see: tokio-rs/io-uring#333 Signed-off-by: Tony Asleson <tasleson@redhat.com>
1 parent 995c73b commit 438aea3

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

Cargo.toml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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]
3251
bindgen = "0.69"
3352
regex = "1.8.3"
3453
anyhow = "1.0.66"
3554

3655
[dependencies]
56+
3757
libc = "0.2"
38-
io-uring = {version="=0.7.9"}
3958
serde = {version = "1.0.99", features = ["derive"]}
4059
serde_json = "1.0.79"
4160
bitmaps = "3.2.0"
@@ -61,3 +80,11 @@ daemonize = "0.5"
6180
env_logger = "0.9"
6281
futures = "0.3.31"
6382
rand = "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

Comments
 (0)